Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function WinSetOnTop (or not and/or activate, size it, move it to POS and/or Monitor)
#1
To set dialog windows that normally do not have this Feature in QM (e.g. Input box, OpenSaveDialog...)  - or if you wish also for other existing windows - if you do not want to use - in this case - the built-in routines (e.g.: act, CenterWindow, MoveWindowToMonitor, mov, Zorder ...) here...

I originally needed it in the company - to put QM dialogues always in the foreground, and to move them...

Insert the function before the actual dialog call - and specify its title...

The function also works for other existing Windows (see Firefox example...)

The special thing:
The function calls itself again as mac - so that the calling program can continue running and display the following dialog...

Examles:
Simply with a Windows title as parameter:
;WinSetOnTop "Title" ;(Topmost with Activation and Center on Monitor with the mouse pointer is default)
or
;NOT setontop with -2 Firefox (Nothing or NULL = setontop) and mov Windows to 100 200 and primary Monitor
;WinSetOnTop "Mozilla Firefox* - *" "MozillaWindowClass" -2 100 200 -3
;detto with setontop and moves the window on the monitor #2 (Short Title without Class Parameters - also works!)
;WinSetOnTop "*Firefox*" "" 0 0 0 -2 (or -1 0 0 2)


Update now: 
Additional specification of window size change, activation (or not) and maximization possible

function# ~Title [~Class] [Topmost] [Activate] [left] [top] [width] [height] [Center]
   WinSetOnTop "Title" "Class" [NOT/TOPMOST] [NOT/ACTIVATE] [x] [y] [width] [height] [NOT/CENTER/Monitor#]
   Topmost: HWND_TOPMOST(HWND)=-1 (or 0 = Standard) or HWND_NOTOPMOST(HWND)=-2 (=Parameters von MS SetWindowPos)
   Activate: (>-1 = Standard), -1 or (more negativ - test it ;-) = NOT ACTIVATE
   if you wish to "MOVE" to x AND y position then minimum VALUE = 1 (or -1...!) NOT 0
   if only x = 0  or nothing = Center VERTICAL on Monitor with the mouse pointer
   if only y = 0  or nothing = Center HORIZONTAL on Monitor with the mouse pointer
   if x and y = -1 NOT Center - keeps the screen orientation
   if x and/or y is negativer as -1 - offset from screen right and/or bottom.
   if width and heigh = -1 POS window and max it at the end (original size)
   if x, y, width and heigh = -1  max the window at the end (original POS and size)
   if x = 0 and y = 0 and Move = 0 or nothing or -1 = Center on Monitor with the mouse pointer
   if x = 0 and y = 0 and Move <> 0 = Center on Monitor with Center Parameter:
   1-30 Monitor#, -1 mouse, -2 active window, -3 primary, or window handle
   
   Examles:
   WinSetOnTop "Title"   (Topmost Active with Center on Monitor with the mouse pointer is default)
   WinSetOnTop "w"   (Topmost with Activation and Center on Monitor with the mouse pointer is default)
   WinSetOnTop F"*{w}*"   (detto only Part of Windows)
   Setontop with -1 Firefox (or NULL = setontop) and Center and Active on Monitor with the mouse pointer
   WinSetOnTop "Mozilla Firefox*" "MozillaWindowClass" (Nothing or 0 or or -1)
   detto with moves the window on the primary monitor
   WinSetOnTop "Mozilla Firefox*" "MozillaWindowClass" 0 0 0 0 0 0 -3 or or -1 0 0 0 0 0 -3)
   detto Windows inactive
   WinSetOnTop "Mozilla Firefox*" "MozillaWindowClass" 0 -1 0 0 0 0 -3 or or -1 0 0 0 0 0 -3)
   NOT setontop (with -2) Firefox and moving and resizing and not activation on Monitor#1
   WinSetOnTop "Mozilla Firefox*" "MozillaWindowClass" -2 -2 100 200 400 400 1
   detto with moves the window on the monitor with the mouse pointer
   WinSetOnTop "Mozilla Firefox*" "MozillaWindowClass" -2 -2 100 300 400 400 -1 (or Nothing or 0)
   detto with Center (x and y = 0)
   WinSetOnTop "Mozilla Firefox*" "MozillaWindowClass" -2 -2 0 0 400 400 -1 (or Nothing or 0)
   detto with setontop, activation Center and no size change , moves the window to the monitor #2
   WinSetOnTop "*Firefox*" "" 0 0 0 0 0 0 2 (or -1 0 0 0 0 0 2)
   detto with setontop and moves the window on the monitor with the mouse pointer
   WinSetOnTop "*Firefox*" "" 0 -1 0 0 0 0 0 (or Nothing or 0)
   The same as
   WinSetOnTop "*Firefox*"

See integrated function Help too...

Have fun with it!!!

wfg. from Schindi aus Austria


Attached Files
.qml   WinSetOnTop.qml (Size: 8 KB / Downloads: 18)


Forum Jump:


Users browsing this thread: 1 Guest(s)