04-13-2015, 09:45 PM
If I have the below code compiled to .exe, what (and how) do I need to add if I want activate notepad when the mousepointer within a certain position.
In other words the hotspot (black rectangle is screen, red mark is against the top of screen and outside qm dialog area):
I want to add code in the below dialog, so that when the mouspointer is within 300-900 it will activate notepad.
Function hotspot_example
Regarding:WM_MOUSEMOVE
I read here:
When the mouse is over something on the dialog
For most controls, WM_MOUSEMOVE is sent to the control, not to the dialog.
Does this mean that WM_MOUSEMOVE can only be used within dialog area?
(triggering code on mousemove when pointer moves within dialog/control)
Regarding: TrackMouseEvent
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
I have no idea how to approach this, an example (if possible) would be really appreciated.
In other words the hotspot (black rectangle is screen, red mark is against the top of screen and outside qm dialog area):
I want to add code in the below dialog, so that when the mouspointer is within 300-900 it will activate notepad.
Function hotspot_example
;\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x80000840 0x90 0 0 385 11 "DlgMenu"
;3 Button 0x54032000 0x0 0 0 48 11 "Button1"
;4 Button 0x54032000 0x0 48 0 48 11 "Button2"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Regarding:WM_MOUSEMOVE
I read here:
When the mouse is over something on the dialog
For most controls, WM_MOUSEMOVE is sent to the control, not to the dialog.
Does this mean that WM_MOUSEMOVE can only be used within dialog area?
(triggering code on mousemove when pointer moves within dialog/control)
Regarding: TrackMouseEvent
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Quote:The mouse pointer is considered to be hovering when it stays within a specified rectangle
for a specified period of time. Call SystemParametersInfo. and use the values
SPI_GETMOUSEHOVERWIDTH, SPI_GETMOUSEHOVERHEIGHT, and SPI_GETMOUSEHOVERTIME to
retrieve the size of the rectangle and the time.
I have no idea how to approach this, an example (if possible) would be really appreciated.