How do disable mouse wheel on ddl?


#21

Here I’m talking about WndProc only. Regarding mouse hooks, I used them in my Script Player product, below is mouse hook code, but there I don’t process wheel messages:

wh::MouseProc                 PROCEDURE(LONG pCode, UNSIGNED wParam, LONG lParam)
mouseInfo                       &MOUSEHOOKSTRUCT, AUTO        !-- in lParam 
mouseData                       LIKE(TMouseHookData), AUTO
pt                              LIKE(POINT), AUTO
vLPressed                       BOOL, AUTO    !-- left mouse button pressed
vRPressed                       BOOL, AUTO    !-- right mouse button pressed
ctrl                            &TMouseHooker
  CODE
  IF pCode < 0
    RETURN wh::CallNextHookEx(ctrlMgr.hHook, pCode, wParam, lParam)
  END
  
  mouseInfo &= (lParam)
  
  !-- find an instance
  ctrl &= ctrlMgr.GetControl(mouseInfo.hwnd)
  IF ctrl &= NULL
    !-- this control is not in the list
    RETURN wh::CallNextHookEx(ctrlMgr.hHook, pCode, wParam, lParam)
  END
  
  !-- action
  mouseData.Action = wParam
  
  !-- screen pos
  pt = mouseInfo.pt
  mouseData.ScreenPt = pt
  
  !-- client pos
  wh::ScreenToClient(mouseInfo.hwnd, pt)
  mouseData.ClientPt = pt
  
  mouseData.LPressed = CHOOSE(BAND(wh::GetAsyncKeyState(VK_LBUTTON), 08000h) > 0)
  mouseData.RPressed = CHOOSE(BAND(wh::GetAsyncKeyState(VK_RBUTTON), 08000h) > 0)
  
  IF ctrl.MouseProc(mouseData)
    RETURN wh::CallNextHookEx(ctrlMgr.hHook, pCode, wParam, lParam)
  END
  
  RETURN 0

#23

Update:

I add the wndproc to filter all mouse wheel messages for each drop down list as they are created. The mouse scroll wheel has no effect when the mouse is over the drop down list. This is the desired behavior.

But, when the drop down list is selected, moving the mouse scroll wheel almost anywhere other than the over the drop down list caused the option to change w/o dropping down the list.

I’m starting to sprinkle the wndproc to sheet and tab controls and the window.

Any suggestions?


#24

Yup, when mouse corsor is not over a dropdown box, WM_MOUSEWHEEL message never fires, but the value is changing. Maybe Spy++ will help to find a solution.


#25

Thanks. Already been there.

It appears to be a user defined message.


#26

Possibly try a call to Debuger.GetEventDescr_WM inside of your WndProc, that’s sorta like Spy++ but uses SV’s namings for events, which includes some of the user defined ones.

see https://github.com/MarkGoldberg/ClarionCommunity/blob/master/CW/Shared/Src/debuger.clw for the class and method.


#27

Thanks. I see some TMM_ names come back on wm_user + low numbers.

No matches to the ones I see in spy++.