Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mouse Over r Display Mes or out
#1
Hi Gintaras and all,

Having a little trouble with this one. Need to have this func running continually, and
if mouse is over the rect
   display mes (be it mes, Mes, OSD, ect.)
if mouse not over rect anymore
   destroy mes ect.

The following code part before else statement works good with output, but
after the else no good.

Please any help, Thanks in advance.
Scott

Function FunctionOne25
Code:
Copy      Help
/ FunctionOne25 \

#region   __Description
;; Description of Function:
;; Want to be able to display a mes or output with coordinates,
;; when mouse pointer is over any part of specified rect and
;;  destroy mes or different output when mouse Not over rect.
#endregion

int w=win("$My QM$" "CabinetWClass")

;; Loop1
RECT r
SetRect &r 99 267 128 290 ;;coordinates in the client area of the window
if wait(0 -S "" w r 16)
,POINT p; xm(p w 1) ;;get mouse position into p.x and p.y
,out "[]Cursor coordinates are:[]%i %i" p.x p.y
else
,;wait(0 -S "" w r 16|0x400)
,xm(p w 1) ;;get mouse position into p.x and p.y
,out "[]Cursor coordinates now are:[]%i %i" p.x p.y
goto Loop1
#2
something like this should work for you
Code:
Copy      Help
int w=win("$My QM$" "CabinetWClass")
if(!w) ret
RECT r
SetRect &r 99 267 128 290 ;;coordinates in the client area of the window
POINT p
rep
,xm(p w 1)
,int inRect=PtInRect(&r p.x p.y)    
,OnScreenDisplay iif(inRect F"mouse is in rectangle[]Cursor coordinates are:[]{p.x} {p.y}" "mouse is not in rectangle") -1 0 0 0 0 0 4|8 "MouseInRect"
,0.3
#3
That's IT! Exactly.
Perfect, thank you Kevin.

Scott
#4
Kevin,
quick question, is it possible to tell when mouse pointer is over a certain folder in the SysTreeView
pane no matter where the folder is at in the pane???
#5
not sure of this is the best way but seems to work for me on win10
Code:
Copy      Help
int w=win("" "CabinetWClass")
int c=id(100 w)
err+
,out "Explorer window not open"
,ret
Acc a
str name FolderName="Desktop";;change to folder name you want to search for
int mhwnd
rep
,a.FromMouse
,mhwnd=a.Hwnd
,if mhwnd=c
,,name=a.Name
,,if name=FolderName
,,,out "Mouse is over folder"
,,,break
,name.fix(0)
,0.3

​​​​​​​maybe Gintaras has a better idea
#6
Yes I believe I can work with this.
Thanks for sharing your knowledge!!


Forum Jump:


Users browsing this thread: 1 Guest(s)