Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double Click without Single Click Notification
#1
Hi Gintaras,

I am having trouble with notification code for double click:. I can't seem to register the double click without also firing off the single click. I feel pretty silly that I can't figure this out.

Code:
Copy      Help
,case [5,BN_DBLCLK<<16|5]
,,;out lParam
,,sel wParam
,,,case BN_DBLCLK<<16|5;
,,,,out "double clicked"
,,,,ret
,,,case else
,,,,out "single clicked"
,,,,ret

I just discovered the BN_DOUBLECLICKED or BN_DBLCLK WIN Message. I set the button to BS_NOTIFY and I also read that from MSDN that
Quote:BS_NOTIFY Enables a button to send BN_DBLCLK, BN_KILLFOCUS, and BN_SETFOCUS notification messages to its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style.
But don't know how to filter between whether single click or double click.
Thanks for any thoughts!!!, S

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

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;5 Button 0x54036000 0x0 86 56 48 14 "Button"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "*" "" "" ""
;
if(!ShowDialog("Function2" &Function2)) ret



ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,
,case [5,BN_DOUBLECLICKED<<16|5]
,,sel wParam
,,,case BN_DOUBLECLICKED<<16|5;
,,,,out "double clicked"
,,,,ret
,,,case else
,,,,out "single clicked"
,,,,ret
ret 1
#2
Macro Macro2504
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;5 Button 0x54036000 0x0 86 56 48 14 "Button"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0 "*" "" "" ""

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
,case WM_TIMER
,sel wParam
,,case 5
,,KillTimer hDlg wParam
,,out "single clicked"
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,
,case 5
,,SetTimer hDlg 5 GetDoubleClickTime+50 0
,case BN_DOUBLECLICKED<<16|5
,,KillTimer hDlg 5
,,out "double clicked"
ret 1
#3
Thanks...it works!!!
S


Forum Jump:


Users browsing this thread: 1 Guest(s)