MsgWaitforMultipleobjects 로 sleep 대체하기

From YYpBD's MediaWiki

Jump to: navigation, search

MsgWaitforMultipleobjects 로 sleep 대체하기.  
hDummy := INVALID_HANDLE_VALUE;

MsgWaitforMultipleobjects(0, hDummy, FALSE, 1000, QS_ALLINPUT...);

다른 방법의 sleep 대체 방법입니다. 1000은 지연시간, 그리고 그 다음의 QS는

wake-up Event에 관한 설정 파라미터입니다.

* QS_ALLEVENTS  
An input, WM_TIMER, WM_PAINT, WM_HOTKEY, or posted message is in the queue.
This value is a combination of QS_INPUT, QS_POSTMESSAGE, QS_TIMER, QS_PAINT, and QS_HOTKEY.


* QS_ALLINPUT  
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_ALLPOSTMESSAGE  
A posted message is in the queue.
This value is cleared when you call GetMessage or PeekMessage without filtering messages.

* QS_HOTKEY  
A WM_HOTKEY message is in the queue.

* QS_INPUT  
An input message is in the queue.
This value is a combination of QS_MOUSE and QS_KEY.
Windows Server 2003 and Windows XP:  This value also includes QS_RAWINPUT.

* QS_KEY  
A WM_KEYUP, WM_KEYDOWN, WM_SYSKEYUP, or WM_SYSKEYDOWN message is in the queue.
QS_MOUSE  A WM_MOUSEMOVE message or mouse-button message (WM_LBUTTONUP, WM_RBUTTONDOWN, and so on).
This value is a combination of QS_MOUSEMOVE and QS_MOUSEBUTTON.

* QS_MOUSEBUTTON  
A mouse-button message (WM_LBUTTONUP, WM_RBUTTONDOWN, and so on).

* QS_MOUSEMOVE  
A WM_MOUSEMOVE message is in the queue.

* QS_PAINT  
A WM_PAINT message is in the queue.

* QS_POSTMESSAGE  
A posted message is in the queue.
This value is cleared when you call GetMessage or PeekMessage, whether or not you are filtering messages.

* QS_RAWINPUT  
A raw input message is in the queue. For more information, see Raw Input.
Windows 2000/NT and Windows Me/98/95:  This value is not supported.

* QS_SENDMESSAGE  
A message sent by another thread or application is in the queue.
QS_TIMER  A WM_TIMER message is in the queue.

참고하시길.

맞춤검색