Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Menu on monitor#
#1
is there a way to get a menu to put itself on the monitor that your mouse is on in the center of the screen? a sort of monitor=-1

thanks.
An old blog on QM coding and automation.

The Macro Hook
#2
Function ShowMenuInCenterOfMonitor
Code:
Copy      Help
;/
function# $menu monitor [yOffset] [flags] ;;monitor: 0 primary, 1-30 index, -1 mouse, -2 active window, -3 primary, or window handle.  flags: 1 sync

;Shows popup menu in center of specified monitor.
;Returns 0. If flag 1 used and an item selected, returns 1-based line index.
;Error if menu does not exist.


;menu - menu name.
;yOffset - offset in pixels from screen center vertically. Typically it should be minus half of menu height.
;flags:
;;;1 - wait until the menu is closed.


;EXAMPLE
;ShowMenuInCenterOfMonitor "Menu16" -1 -100



RECT r
MonitorFromIndex monitor 1 &r
int x(r.left+r.right/2) y(r.top+r.bottom/2+yOffset)
if(flags&1) ret mac(menu "" x y)
mac menu "" x y
err+ end _error

In menu properties, select Mouse.
#3
works great!
does seem to be a tad to the right but works flawlessly.

thanks!!!!
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)