PDA

View Full Version : Print or Cancel without a mouse



darinf
July 8th, 2010, 08:41 AM
I want the user to have the option of printing the photo or not. (If they don;t like the photo, no need to print and they can try again.)

I thought I could set up an AutoHotKey script to detect when the Print screen is displayed which asks the user to print or cancel.

But, as far as I can tell, that window does not have a title so I can't tell when that window is displayed. (I am not talking about the "processing" screen.)

Since the user doesn't have a mouse or keyboard, There's no way for them to select "print or cancel".

Any ideas on how AutoHotKey can detect when the "print/cancel" window is displayed?

Thanks,
-Darin

Chris Breeze
July 9th, 2010, 07:04 AM
You could look for a window containing the word "Print" e.g.

IfWinExist,,Print
{
MsgBox,Print confirmation displayed
}

I'll add a window title in the next update to make this easier.

BTW the AutoIt3 Window Spy tool that comes with AutoHotKey is very useful for seeing what controls etc. are available in a window.

darinf
July 9th, 2010, 07:20 AM
Hi Chris,

I did see that WindowSpy had the text "print" and "cancel" in the window, but I tried the WinGetText command instead and could not get it to work. I think because the window has no name, I could not get the WinGetText command to return anything.

Your example worked like a charm. Easy enough.

Thanks for your help!

-Darin