Control under the Mouse
Moderator: Rathinagiri
Control under the Mouse
Hi to all,
if you want to know the control under the mouse pointer ( to select it or change the shape of the pointer ) here if the way to simulate a MOUSE OVER
DEFINE WINDOW w_test
some controls ( label, textbox, etc ... )
END WINDOW
CREATE EVENT PROCNAME TESTMOVE HWND W_test
ACTIVATE WINDOW W_TEST
function testmove()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom, cForm
if nMsg == 32 .and. wParam <> win_1.HANDLE
GetControlNameByHandle(wParam,@cNom, @cForm)
msgbox("Event " + str( nMsg,3,0) + " / " + str(wParam,8,0) + " / " + cNom + " / " + cForm )
endif
return nil
that's all !!!
bye
if you want to know the control under the mouse pointer ( to select it or change the shape of the pointer ) here if the way to simulate a MOUSE OVER
DEFINE WINDOW w_test
some controls ( label, textbox, etc ... )
END WINDOW
CREATE EVENT PROCNAME TESTMOVE HWND W_test
ACTIVATE WINDOW W_TEST
function testmove()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom, cForm
if nMsg == 32 .and. wParam <> win_1.HANDLE
GetControlNameByHandle(wParam,@cNom, @cForm)
msgbox("Event " + str( nMsg,3,0) + " / " + str(wParam,8,0) + " / " + cNom + " / " + cForm )
endif
return nil
that's all !!!
bye
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Control under the Mouse
That is so nice.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Control under the Mouse
Muy bien amigo!
Saludos
Saludos
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Control under the Mouse
Hi jpp
Welcome aboard
Happy HMG'ing
Welcome aboard
Good sample, thanks to participationjpp wrote:here if the way to simulate a MOUSE OVER
Happy HMG'ing
Viva INTERNATIONAL HMG
Re: Control under the Mouse
hi and thx for ure messages...
Now if u want to select the control change the proc EVENT to this one :
function selectCtrl()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom,cForm
static ctrlselect:= ""
if wParam <> win_1.HANDLE
if nMsg == 528 .and. !empty(ctrlselect)
msgbox("ctrl selected " + ctrlselect )
else
if nMsg == 32
GetControlNameByHandle(wParam,@cNom, @cForm)
ctrlselect:= upper(cNom)
else
ctrlselect:= ""
endif
endif
endif
return nil
i've tested with label, textbox and button ...
Any feeback welcome
Bye
Now if u want to select the control change the proc EVENT to this one :
function selectCtrl()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom,cForm
static ctrlselect:= ""
if wParam <> win_1.HANDLE
if nMsg == 528 .and. !empty(ctrlselect)
msgbox("ctrl selected " + ctrlselect )
else
if nMsg == 32
GetControlNameByHandle(wParam,@cNom, @cForm)
ctrlselect:= upper(cNom)
else
ctrlselect:= ""
endif
endif
endif
return nil
i've tested with label, textbox and button ...
Any feeback welcome
Bye
Re: Control under the Mouse
---------------------------------------------Hi to all,
if you want to know the control under the mouse pointer ( to select it or change the shape of the pointer ) here if the way to simulate a MOUSE OVER
DEFINE WINDOW w_test
some controls ( label, textbox, etc ... )
END WINDOW
CREATE EVENT PROCNAME TESTMOVE HWND W_test
ACTIVATE WINDOW W_TEST
function testmove()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom, cForm
if nMsg == 32 .and. wParam <> win_1.HANDLE <====== ERROR
GetControlNameByHandle(wParam,@cNom, @cForm)
msgbox("Event " + str( nMsg,3,0) + " / " + str(wParam,8,0) + " / " + cNom + " / " + cForm )
endif
return nil
that's all !!!
bye
Hi jpp, gives error, which is defined Win_1?
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Control under the Mouse
Hola jpp,
Me da error, me dice que no existe la variable "W_test"
DEFINE WINDOW w_test
some controls ( label, textbox, etc ... )
END WINDOW
CREATE EVENT PROCNAME TESTMOVE HWND W_test <===== ERROR
ACTIVATE WINDOW W_TEST
function testmove()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom, cForm
if nMsg == 32 .and. wParam <> win_1.HANDLE
GetControlNameByHandle(wParam,@cNom, @cForm)
msgbox("Event " + str( nMsg,3,0) + " / " + str(wParam,8,0) + " / " + cNom + " / " + cForm )
endif
return nil
Saludos
Me da error, me dice que no existe la variable "W_test"
DEFINE WINDOW w_test
some controls ( label, textbox, etc ... )
END WINDOW
CREATE EVENT PROCNAME TESTMOVE HWND W_test <===== ERROR
ACTIVATE WINDOW W_TEST
function testmove()
LOCAL hWnd := EventHWND()
Local nMsg:= EventMsg()
local wParam:= EventWPARAM ()
local cNom, cForm
if nMsg == 32 .and. wParam <> win_1.HANDLE
GetControlNameByHandle(wParam,@cNom, @cForm)
msgbox("Event " + str( nMsg,3,0) + " / " + str(wParam,8,0) + " / " + cNom + " / " + cForm )
endif
return nil
Saludos
Re: Control under the Mouse
Hi,
Sorry for the mistake !
win_1.handle does not exist, it's W_TEST ( the name of the form )
bye
Sorry for the mistake !
win_1.handle does not exist, it's W_TEST ( the name of the form )
bye
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Control under the Mouse
jpp wrote:if you want to know the control under the mouse pointer ( to select it or change the shape of the pointer ) here if the way to simulate a MOUSE OVER
Hola Javier, prueba con: W_test.HANDLE (ejemplo completo es el que acabé postando)Javier Tovar wrote:Hola jpp,
Me da error, me dice que no existe la variable "W_test"
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Control under the Mouse
Hola Pablo César,
Fantastico! me quede
Un Abrazo
Fantastico! me quede
Un Abrazo