Mouse at screen corner activates functions...
Posted: Wed Apr 22, 2009 6:42 pm
Just a simple code to start some window functions when you move your mouse to a screen corner...
I started with activating the screen saver, but now some cool ideas are needed what to do at the four positions...
...what about maximizing (or minimizing) the active window?
...or hiding/showing all windows (like using the shortcut Windows-D)?
...or something completely different?
Michael
Code: Select all
#MausTrigger=30
Global sx=GetSystemMetrics_(#SM_CXSCREEN)
Global sy=GetSystemMetrics_(#SM_CYSCREEN)
Global Mausi.q
Global Mecki.l
Enumeration
#Idle
#TopLeft
#TopRight
#BottomLeft
#BottomRight
EndEnumeration
Procedure MausArnie(corner)
If Mecki=#MausTrigger
Select corner
Case #TopLeft
PostMessage_(GetForegroundWindow_(),#WM_SYSCOMMAND,#SC_SCREENSAVE,0)
Case #TopRight
Debug "TopRight"
Case #BottomLeft
Debug "BottomLeft"
Case #BottomRight
Debug "BottomRight"
EndSelect
EndIf
Mecki+1
EndProcedure
Repeat
Delay(10)
GetCursorPos_(@Mausi)
If Mausi=0
MausArnie(#TopLeft)
ElseIf Mausi=sx-1
MausArnie(#TopRight)
ElseIf Mausi=(sy-1)<<32
MausArnie(#BottomLeft)
ElseIf Mausi=(sy-1)<<32+sx-1
MausArnie(#BottomRight)
Else
Mecki=#False
EndIf
Until GetAsyncKeyState_(#VK_SPACE)
...what about maximizing (or minimizing) the active window?
...or hiding/showing all windows (like using the shortcut Windows-D)?
...or something completely different?
Michael