Re: Writing a DLL
Posted: Sat Feb 22, 2014 6:08 pm
				
				Awesome, thanks a lot for everyone's help.
			Code: Select all
    Select wParam
      Case #WM_LBUTTONDBLCLK
        OutputDebugString_("Left double click detected!")
      Case #WM_MBUTTONDBLCLK
        OutputDebugString_("Middle double click detected!")
      Case #WM_XBUTTONDBLCLK
        ; We need to find out if X1 or X2 button was used!
        ; https://docs.microsoft.com/en-us/windows/desktop/inputdev/wm-xbuttondblclk
        OutputDebugString_("X double click detected!")
      ; Press and hold cases
      Case #WM_LBUTTONDOWN
        OutputDebugString_("Left DOWN click detected!")
    EndSelect
Don't know if this suits your needs, but you could do something like this...oO0XX0Oo wrote:Is it possible to distinguish #WM_LBUTTONDBLCLK from #WM_LBUTTONDOWN in your hook?
Code: Select all
Enumeration
  #NLH_DLL_CONTROL = #WM_USER + 101
EndEnumeration
Procedure TimerProc(hwnd, uMsg, idEvent, dwTime)
  KillTimer_(hwnd, idEvent)
  OutputDebugString_("Left DOWN click detected!")
EndProcedure
ProcedureDLL NLH( nCode, wParam, *lParam.MOUSEHOOKSTRUCT )
  
  If nCode < 0 : ProcedureReturn CallNextHookEx_( @NLH(), nCode, wParam, *lParam ) : EndIf
  
  Select wParam
      
    Case #WM_LBUTTONDOWN
      SetTimer_(*lParam\hwnd, 1, GetDoubleClickTime_(), @TimerProc())
      
    Case #WM_LBUTTONDBLCLK
      KillTimer_(*lParam\hwnd, 1)
      OutputDebugString_("Left double click detected!")
      
  EndSelect
  
  ProcedureReturn CallNextHookEx_( @NLH(), nCode, wParam, *lParam )
  
EndProcedureI've never experienced such crashes with my DLLMistrel wrote:I'm linking this here in case you have any crashes related to making a global hook DLL with PureBasic