02-04-2007, 03:12 AM
I wrote a little program to swap a window between monitors. It was handy enough to convert to an .exe to send to a friend. Because .exe don't support triggers I built in a wait for key event. My hot key is Ctrl-Up, but it catches the Ctrl alone. How can I wait for CU. Here's the code:
Thanks,
Matt B
int hand
int x y cx cy
mes "Running"
rep
,wait 0 KF CU ;; wait for Ctrl+Up
,
,hand=win
,GetWinXY hand x y cx cy ;;get window location
,,;Deb
,,if x > ScreenWidth-5 ;; if on primary monitor, send to secondary
,,,res hand
,,,mov 0 0 hand
,,,0.1
,,,max hand
,,else ;; if on secondary monitor, send to primary
,,,res hand
,,,mov ScreenWidth 0 hand
,,,0.1
,,,max hand
,,,
,,act hand
Thanks,
Matt B
Matt B