Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When the mouse is over something on the dialog
#1
I have looked and all I find is mouse over for HTML does QM have any way to do a mouse over say for a picture and the picture will change to another picture? This is for an EXE dialog.

Function Dialog3
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog3" &Dialog3)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;5 Button 0x54032080 0x0 6 50 11 9 "Bitmap without text"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,SendMessage(id(5 hDlg) BM_SETIMAGE IMAGE_BITMAP LoadPictureFile(":200 $my qm$\1-1.bmp" 0)) ;;can be bmp, gif of jpg

,case WM_DESTROY
,DeleteObject(SendMessage(id(5 hDlg) BM_GETIMAGE IMAGE_BITMAP 0))
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#2
Use WM_MOUSEMOVE or WM_SETCURSOR message. These and others documented in MSDN Library.
#3
How come this works but only when mouse is over dialog not picture?

Function Mouse_Move2
Trigger F11     Help - how to add the trigger to the macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Mouse_Move2" &Mouse_Move2)) ret

;BEGIN DIALOG
;0 "" 0x90CF0A44 0x100 0 0 222 134 "Mouse_Move2"
;5 Button 0x54032080 0x0 6 50 11 9 "Bitmap without text"
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "0" ""

ret
;messages
sel message
,case WM_INITDIALOG
,SendMessage(id(5 hDlg) BM_SETIMAGE IMAGE_BITMAP LoadPictureFile(":200 $my qm$\1-1.bmp" 0)) ;;can be bmp, gif of jpg
,
,case WM_COMMAND goto messages2
,case WM_MOUSEMOVE(id(5 hDlg))
,,SendMessage(id(5 hDlg) BM_SETIMAGE IMAGE_BITMAP LoadPictureFile(":200 $my qm$\3-1.bmp" 0)) ;;can be bmp, gif of jpg
,case WM_DESTROY
ret
;messages2
sel wParam
,case IDCANCEL
ret 1
#4
For most controls, WM_MOUSEMOVE is sent to the control, not to the dialog. Then use WM_SETCURSOR.

Call DeleteObject for each LoadPictureFile, when you already don't need it. If bitmaps are not deleted, your program will crash after some time.

Also try TrackMouseEvent function. Documented in msdn. If the same problem as with WM_MOUSEMOVE, subclass the control.


Forum Jump:


Users browsing this thread: 2 Guest(s)