News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

MsgWaitForMultipleObjects wrong value Value

Started by ragdog, January 09, 2019, 12:01:46 AM

Previous topic - Next topic

ragdog

Hello

I working with threads and MsgWaitForMultipleObjects and wonder why my wait code is not successful.
In all Masm32 version is in the windws.inc the wrong value.

QS_ALLINPUT = 000000FF     is wrong it should  04FFh


Update qs_... value

QS_KEY            equ 1h
QS_MOUSEMOVE      equ 2h
QS_MOUSEBUTTON    equ 4h
QS_MOUSE          equ 6h ;<<<<<<<<<<<<<<< missing
QS_POSTMESSAGE    equ 8h
QS_TIMER          equ 10h
QS_PAINT          equ 20h
QS_SENDMESSAGE    equ 40h
QS_HOTKEY         equ 80h
QS_ALLPOSTMESSAGE equ 100h
QS_RAWINPUT       equ 400h ;<<<<<<<<<<< missing
QS_MOUSE          equ QS_MOUSEMOVE OR QS_MOUSEBUTTON


;QS_INPUT
;0x407
;An input message is in the queue.
;This value is a combination of QS_MOUSE, QS_KEY, and QS_RAWINPUT.

QS_INPUT         equ QS_MOUSE OR QS_KEY or QS_RAWINPUT ; <<< update
QS_ALLEVENTS     equ QS_INPUT OR QS_POSTMESSAGE OR QS_TIMER OR QS_PAINT OR QS_HOTKEY


;QS_ALLINPUT
;0x04FF
;Any message is in the queue.
This value is a combination of QS_INPUT, QS_POSTMESSAGE, QS_TIMER, QS_PAINT, QS_HOTKEY, and QS_SENDMESSAGE.

;QS_ALLINPUT  equ QS_SENDMESSAGE OR QS_PAINT OR QS_TIMER OR QS_POSTMESSAGE OR QS_MOUSEBUTTON OR QS_MOUSEMOVE OR QS_HOTKEY OR QS_KEY
QS_ALLINPUT equ  QS_INPUT OR QS_POSTMESSAGE OR QS_TIMER OR QS_PAINT OR QS_HOTKEY OR QS_SENDMESSAGE  ;<<< update


Greets,

dedndave

QS_MOUSE          equ 6h ;<<<<<<<<<<<<<<< missing
QS_POSTMESSAGE    equ 8h
QS_TIMER          equ 10h
QS_PAINT          equ 20h
QS_SENDMESSAGE    equ 40h
QS_HOTKEY         equ 80h
QS_ALLPOSTMESSAGE equ 100h
QS_RAWINPUT       equ 400h ;<<<<<<<<<<< missing
QS_MOUSE          equ QS_MOUSEMOVE OR QS_MOUSEBUTTON


your text says QS_MOUSE is missing, yet it is listed as QS_MOUSEMOVE OR QS_MOUSEBUTTON ( = 6 )

dedndave

my version has QS_RAWINPUT, but it is not listed in the same area of windows.inc  :P

jj2007

Quote from: ragdog on January 09, 2019, 12:01:46 AMQS_ALLINPUT = 000000FF     is wrong it should  04FFh

Are you sure? Visual Studio lists these:#define QS_ALLINPUT        (QS_INPUT         | \
                            QS_POSTMESSAGE   | \
                            QS_TIMER         | \
                            QS_PAINT         | \
                            QS_HOTKEY        | \
                            QS_SENDMESSAGE)

Hint: the right value depends on the OS version 8)

dedndave

the one to look at is QS_INPUT, Jochen  :t
according to MS, it includes QS_RAWINPUT
if you straighten that one out, then fix the definition for QS_ALLINPUT, you should be good to go


i updated my windows.inc file, as follows...
1) move the value for QS_RAWINPUT
it was located about half-way through the file, between MAPVK_VK_TO_VSC_EX and USER_TIMER_MAXIMUM
i moved it up, near the other QS_ values
2) i then updated the combined values, per MS documentation

QS_KEY                               equ 1h
QS_MOUSEMOVE                         equ 2h
QS_MOUSEBUTTON                       equ 4h
QS_POSTMESSAGE                       equ 8h
QS_TIMER                             equ 10h
QS_PAINT                             equ 20h
QS_SENDMESSAGE                       equ 40h
QS_HOTKEY                            equ 80h
QS_ALLPOSTMESSAGE                    equ 100h
QS_RAWINPUT                          equ 400h
QS_MOUSE                             equ QS_MOUSEMOVE OR QS_MOUSEBUTTON
QS_INPUT                             equ QS_MOUSE OR QS_KEY OR QS_RAWINPUT
QS_ALLEVENTS                         equ QS_INPUT OR QS_POSTMESSAGE OR QS_TIMER OR QS_PAINT OR QS_HOTKEY
QS_ALLINPUT                          equ QS_INPUT OR QS_POSTMESSAGE OR QS_TIMER OR QS_PAINT OR QS_HOTKEY OR QS_SENDMESSAGE

TimoVJL

So since WindowsXP
#if(_WIN32_WINNT >= 0x0501)
#define QS_RAWINPUT         0x0400
#endif /* _WIN32_WINNT >= 0x0501 */

#define QS_MOUSE           (QS_MOUSEMOVE     | \
                            QS_MOUSEBUTTON)

#if (_WIN32_WINNT >= 0x0501)
#define QS_INPUT           (QS_MOUSE         | \
                            QS_KEY           | \
                            QS_RAWINPUT)
#else
#define QS_INPUT           (QS_MOUSE         | \
                            QS_KEY)
#endif // (_WIN32_WINNT >= 0x0501)
May the source be with you

ragdog

Quotethen updated the combined values, per MS documentation

Correct Dave :t  :t