Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Action when mouse on icon and/or button
#1
I am working out a QM function-dialog with a static icon. If mouse is moved over the static icon, a menu should be launched.

I am using the technique introduced in :

http://www.quickmacros.com/forum/showthr...7#pid18207

Nevertheless, I have the following questions :

(a) How can I avoid re-launching this menu in the case WM_SETCURSOR clause, if this menu is already launched and visible.

(b) Is there another technique more suitable to this task?

© Can this technique be extended in the case of a button, to execute the button's left mouse action without clicking on it?

I mostly appreciate any advice.
#2
Macro Macro2544
Code:
Copy      Help
\Dialog_Editor
out
str dd=
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Static 0x54000103 0x20000 0 0 42 34 ""
;4 Button 0x54032000 0x0 76 8 48 14 "Auto click"
;END DIALOG
;DIALOG EDITOR: "" 0x2040300 "" "" "" ""

str controls = "3"
str si3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

int-- t_inMenu t_inButton

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,t_inMenu=0; t_inButton=0
,
,case WM_SETCURSOR
,int cid=GetDlgCtrlID(wParam)
,
,if cid=3
,,if !t_inMenu
,,,t_inMenu=1
,,,int i=ShowMenu("1one[]2two")
,,,out i
,,,t_inMenu=2
,else if(t_inMenu=2) t_inMenu=0
,
,if cid=4
,,if t_inButton=0
,,,t_inButton=1
,,,but 4 hDlg
,else t_inButton=0
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4
,out "button 4"
,
,case IDOK
,case IDCANCEL
ret 1
#3
It is marvelous! Thank you very much indeed.


Forum Jump:


Users browsing this thread: 1 Guest(s)