fsw wrote:[...]Besides, on a dual (pick your own amount...) monitor setup handling is weird because a corner of the main screen could be in the middle of the total desktop space.
[...]
Hm,
seems to be something like a logical puzzle to find out wich are the coordinates of the "real" four corners...
...will think about that
Another point is, I tried to find some nice functions for using this tools, but I failed to realize some ideas...
• put active window to the back (z-order)
• minimize all windows but active
• simulate Windows+D
...other functions could be done, but are not very useful, like...
Code: Select all
handle=GetForegroundWindow_()
If IsIconic_(handle)
PostMessage_(GetForegroundWindow_(),#WM_SYSCOMMAND,#SC_RESTORE,0)
Else
ShowWindow_(handle,#SW_SHOWMINNOACTIVE)
EndIf
Any further ideas?
Here's the actual version which has the following functions:
TL - activate screen saver (works

)
TR - minimize active (but not topmost

) window
BL - moves active window to the background, should activate the next ( also not so perfect

)
BR - restores first minimized window (seems to work

)
Code: Select all
#MausTrigger=16
Global sx=GetSystemMetrics_(#SM_CXSCREEN)
Global sy=GetSystemMetrics_(#SM_CYSCREEN)
Global Mausi.q
Global Mecki.l
Enumeration
#Idle
#TopLeft
#TopRight
#BottomLeft
#BottomRight
EndEnumeration
Procedure RestoreMinimizedWindow(handle,dummy)
If IsIconic_(handle)
PostMessage_(handle,#WM_SYSCOMMAND,#SC_RESTORE,0)
ProcedureReturn #False
EndIf
ProcedureReturn #True
EndProcedure
Procedure MausArnie(corner)
Protected handle=GetForegroundWindow_()
;handle=GetActiveWindow_()
;handle=GetTopWindow_(0)
If Mecki=#MausTrigger
Select corner
Case #TopLeft
PostMessage_(handle,#WM_SYSCOMMAND,#SC_SCREENSAVE,0)
Case #TopRight
ShowWindow_(handle,#SW_MINIMIZE)
Case #BottomLeft
SetWindowPos_(handle,#HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE|#SWP_NOACTIVATE)
handle=GetTopWindow_(0)
SetActiveWindow_(handle)
Case #BottomRight
EnumWindows_(@RestoreMinimizedWindow(),1)
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)