How to handle windows pop ups

I have a button with name print Site Info after a click off this
button it opens another window with print dialog there i need to click
on print button.So i need to know how to handle such windows pop ups i
used the code something like this: require ‘win32ole’
wsh = WIN32OLE.new(‘Wscript.Shell’)
wsh.SendKeys(‘Windows{ENTER}’). but its not working