devxlogo

DiscardMouseMessages – Prevent queud mouse actions from being processed

DiscardMouseMessages – Prevent queud mouse actions from being processed

Private Type POINTAPI    X As Long    Y As LongEnd TypePrivate Type MSG    hwnd As Long    message As Long    wParam As Long    lParam As Long    time As Long    pt As POINTAPIEnd TypePrivate Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg _    As MSG, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, _    ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As LongPrivate Const PM_REMOVE = &H1Private Const WM_MOUSEFIRST = &H200Private Const WM_MOUSELAST = &H209' Discard mouse messages waiting to be processed'' This procedure is sometimes useful to prevent VB' from processing spurious mouse clicksPrivate Sub DiscardMouseMessages(ByVal hWnd As Long)    Dim dummy As MSG    Do While PeekMessage(dummy, hWnd, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE)        ' continue to loop until there are no more mouse messages    Loop    End Sub

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist