PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Which window handle, WM_NOTIFY ?  (Read 339 times)

jermy

  • Junior Member
  • **
  • Posts: 64
Which window handle, WM_NOTIFY ?
« on: August 01, 2020, 12:28:21 PM »

Dear people,

how can I determine which window handle the WM_NOTIFY comes from ?.
If I want to use more than one Rich Edit control, I can't separate them to make them respond differently

Code: [Select]
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
 SendMessage (frmMain.RichEdit1.hWindow, EM_SETEVENTMASK,0, ENM_SCROLLEVENTS or ENM_SCROLL or ENM_MOUSEEVENTS or ENM_KEYEVENTS)
    Function = 0
End Function

''
''
Function frmMain_AllEvents( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT

 dim as LPNMHDR pnm
 dim as MSGFILTER ptr pmf

   select case E.Message
     
          Case WM_NOTIFY

               pnm = cast(LPNMHDR,E.lParam)

                select case pnm->code
                    case EN_MSGFILTER
                           pmf = cast(MSGFILTER ptr, pnm)

                        select case   pmf->msg
                             case WM_MOUSEWHEEL
                              Print "WM_MOUSEWHEEL" 
                             Case WM_VSCROLL
                              ? "WM_VSCROLL"
                             case WM_HSCROLL
                              ? "WM_HSCROLL" 
                             case WM_MOUSEMOVE
                             
                             case else
                             ' ? MessageName(pmf->msg)
                        end select
 
                end select   
                             case else
                                 
                ' ? MessageName(e.Message)
   end select
 
    Function = 0
End Function

Thanks in advance for your help

code changed so the example works
« Last Edit: August 01, 2020, 12:47:55 PM by jermy »
Logged