message loop

3 отговора 153 прегледа
#1

message loop

Възможно ли е да изтрия съобщенията, намиращи се в message queue и ако да как? Става дума за Win 32 API.

I wanna read interesting postingz
Отговор
в отговор на expeler #2

Re: message loop

ето малка извадка от MSDN - мисля, че ще ти свърши работа...

PeekMessage
The PeekMessage function dispatches incoming sent messages, checks the thread message queue for a posted message, and retrieves the message (if any exist).

BOOL PeekMessage(
LPMSG lpMsg, // message information
HWND hWnd, // handle to window
UINT wMsgFilterMin, // first message
UINT wMsgFilterMax, // last message
UINT wRemoveMsg // removal options
);
Parameters
lpMsg
[out] Pointer to an MSG structure that receives message information.
hWnd
[in] Handle to the window whose messages are to be examined. The window must belong to the current thread.
If hWnd is NULL, PeekMessage retrieves messages for any window that belongs to the current thread. If hWnd is INVALID_HANDLE_VALUE, PeekMessage retrieves messages whose hWnd value is NULL, as posted by the PostThreadMessage function.

wMsgFilterMin
[in] Specifies the value of the first message in the range of messages to be examined. Use WM_KEYFIRST to specify the first keyboard message or WM_MOUSEFIRST to specify the first mouse message.
If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed).

wMsgFilterMax
[in] Specifies the value of the last message in the range of messages to be examined. Use WM_KEYLAST to specify the first keyboard message or WM_MOUSELAST to specify the last mouse message.
If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed).

wRemoveMsg
[in] Specifies how messages are handled. This parameter can be one of the following values. Value Meaning
PM_NOREMOVE Messages are not removed from the queue after processing by PeekMessage.
PM_REMOVE Messages are removed from the queue after processing by PeekMessage.


You can optionally combine the value PM_NOYIELD with either PM_NOREMOVE or PM_REMOVE. This flag prevents the system from releasing any thread that is waiting for the caller to go idle (see WaitForInputIdle).

By default, all message types are processed. To specify that only certain message should be processed, specify one of more of the following values. Value Meaning
PM_QS_INPUT Windows 98/Me, Windows 2000 or later: Process mouse and keyboard messages.
PM_QS_PAINT Windows 98/Me, Windows 2000 or later: Process paint messages.
PM_QS_POSTMESSAGE Windows 98/Me, Windows 2000 or later: Process all posted messages, including timers and hotkeys.
PM_QS_SENDMESSAGE Windows 98/Me, Windows 2000 or later: Process all sent messages.



Return Values
If a message is available, the return value is nonzero.

If no messages are available, the return value is zero.

най-често умните хора са и лоши
Отговор
в отговор на vroom #3

Re: message loop

Аз имам МСДН, благодаря все пак. То вече си реших проблема по друг начин де.

I wanna read interesting postingz
Отговор
в отговор на expeler #4

Re: message loop

wiv ::PeekMessage(..., ..., ..., ..., PM_REMOVE), s edno while-4e 6te zatrie6 wsi4ko, ama towa e samo za konkreten djam ;)

kjfskdhg dfs lasdjfol ldksf iwoertoret !!!
Отговор