- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using a wheel mouse in my graphics application.
I can scroll the wheel mouse to zoom in and out and if I hold the wheel mouse down I can pan. This is the same funcionality as AutoCAD.
I now want to be able to double click the wheel mouse to do an zoom extents. How do I detect that the user has double clicked the wheel mouse?
Below is a sample of code I'm using:
case (WM_MOUSEWHEEL)
i2=HIWORD(wParam)
if (i2>0) then ! zoom in
! get new screen extents
else ! zoom out
! get new screen extents
end if
! display graphics
case (WM_MBUTTONDOWN) ! middle button down store postion
mButtonDown=.TRUE.
mButtonE=LOWORD(lParam) ! store cursor position in client view
mButtonN=HIWORD(lParam)
case (WM_MBUTTONUP) ! middle button up
mButtonDown=.FALSE.
Thanks
I can scroll the wheel mouse to zoom in and out and if I hold the wheel mouse down I can pan. This is the same funcionality as AutoCAD.
I now want to be able to double click the wheel mouse to do an zoom extents. How do I detect that the user has double clicked the wheel mouse?
Below is a sample of code I'm using:
case (WM_MOUSEWHEEL)
i2=HIWORD(wParam)
if (i2>0) then ! zoom in
! get new screen extents
else ! zoom out
! get new screen extents
end if
! display graphics
case (WM_MBUTTONDOWN) ! middle button down store postion
mButtonDown=.TRUE.
mButtonE=LOWORD(lParam) ! store cursor position in client view
mButtonN=HIWORD(lParam)
case (WM_MBUTTONUP) ! middle button up
mButtonDown=.FALSE.
Thanks
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're using QuickWin, we had a bug in the library which prevented double-click from being recognized. That was fixed in Update 6.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
I've tried WM_MBUTTONDBLCLK and it's bot being recognised, I am recognising WM_MBUTTONDOWN - a sample of my code is shown below.
case (WM_MBUTTONDOWN) ! middle button down store postion
call MsgBox ('Middle mouse button down'c,"E")
MainWndProc = 0
end if
return
case (WM_MBUTTONDBLCLK)
call MsgBox ('Middle mouse button double click'c,"E")
MainWndProc = 0
return
It is a Windows application, not a QuickWin application but the double-click is not being recognised.
How can I tell which version I'm running - the 'help about' just gives the version of Visual Studio.
I've tried WM_MBUTTONDBLCLK and it's bot being recognised, I am recognising WM_MBUTTONDOWN - a sample of my code is shown below.
case (WM_MBUTTONDOWN) ! middle button down store postion
call MsgBox ('Middle mouse button down'c,"E")
MainWndProc = 0
end if
return
case (WM_MBUTTONDBLCLK)
call MsgBox ('Middle mouse button double click'c,"E")
MainWndProc = 0
return
It is a Windows application, not a QuickWin application but the double-click is not being recognised.
How can I tell which version I'm running - the 'help about' just gives the version of Visual Studio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is shown in the build log, or you can look at the detailed list of "Additional Products" in Help. But if you're not using QuickWin, then the bug I referred to does not apply to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
The build log says:
Compiling with Intel Visual Fortran Compiler XE 12.0.4.196 [IA-32]...
Do you have any suggestions why double clicking on the middle button on the mouse is not being recognised?
WM_MBUTTONDOWN and WM_MBUTTONUP are being recognised.
I've checked what message I'm getting - 519 & 520 for WM_MBUTTONDOWN & WM_MBUTTONUP which is Hex 207 & 208.
If I double click I just get a WM_MBUTTONDOWN followed by a WM_MBUTTONUP.
Maybe I will have to check on a 'Down' followed by an 'Up' over a 'short' time.
The build log says:
Compiling with Intel Visual Fortran Compiler XE 12.0.4.196 [IA-32]...
Do you have any suggestions why double clicking on the middle button on the mouse is not being recognised?
WM_MBUTTONDOWN and WM_MBUTTONUP are being recognised.
I've checked what message I'm getting - 519 & 520 for WM_MBUTTONDOWN & WM_MBUTTONUP which is Hex 207 & 208.
If I double click I just get a WM_MBUTTONDOWN followed by a WM_MBUTTONUP.
Maybe I will have to check on a 'Down' followed by an 'Up' over a 'short' time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MSDN sez:
Only windows that have the CS_DBLCLKS style can receive WM_MBUTTONDBLCLK messages, which the system generates when the user presses, releases, and again presses the middle mouse button within the system's double-click time limit. Double-clicking the middle mouse button actually generates four messages: WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MBUTTONDBLCLK, and WM_MBUTTONUP again.
Does your window have the CS_DBLCLKS style?
Only windows that have the CS_DBLCLKS style can receive WM_MBUTTONDBLCLK messages, which the system generates when the user presses, releases, and again presses the middle mouse button within the system's double-click time limit. Double-clicking the middle mouse button actually generates four messages: WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MBUTTONDBLCLK, and WM_MBUTTONUP again.
Does your window have the CS_DBLCLKS style?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thanks, I hadn't read right to the bottom of the documentation.
I'm now getting the double clicks.
Thanks, I hadn't read right to the bottom of the documentation.
I'm now getting the double clicks.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page