peekmessage

Is there a function like PeekMessage that doesn't process messages?

夙愿已清 提交于 2019-12-23 22:18:38
问题 I'm trying to innocently call PeekMessage(&msg, 0, WM_KEYDOWN, WM_KEYUP, PM_NOREMOVE | PM_NOYIELD); and Windows Vista 64, in the PeekMessage call, is processing messages . The result is that I'm going re-entrant on my paint call, and all sorts of other code. Painting can take seconds in our application, so we added the PeekMessage call to see if the user hit a key, so we could interrupt that painting and start up the next one. Little did we realize that Windows could start processing messages

PeekMessage not getting the message?

不问归期 提交于 2019-12-23 21:08:20
问题 I've created a custom message type for use in resizing my Window , called WM_NEED_RESIZE . I've defined it in my .h file, and initialized in my .cpp file. I have also registered my WindowProc function to accept messages. Here is the code for these items: const uint32 WindowsGLWindow::WM_NEED_RESIZE = WM_USER + 100; LONG WINAPI WindowsGLWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static PAINTSTRUCT ps;// do I need this? static sint32 newWidth = 0; static sint32

Peek MSMQ message with unlimited timeout

ε祈祈猫儿з 提交于 2019-12-11 09:09:53
问题 I am writing an application that peeks message from Microsoft Message Queue (MSMQ). I want my application peeks MSMQ messages in turn(from the first message to the last message ). After peeks the last message completly, the main thread will be blocked until MSMQ have a new message arrive. I've already used MessageQueue.Peek(TimeSpan, Cursor, PeekAction) Method with TimeSpan=MessageQueue.InfiniteTimeout and have a problem: MessageQueue.InfiniteTimeout value approximates 49 days but I want my

Peek MSMQ message with infinite timeout

戏子无情 提交于 2019-12-11 03:08:46
问题 I am writing an application that peeks message from Microsoft Message Queue (MSMQ). I want my application peeks MSMQ messages in turn(from the first message to the last message ). After peeks the last message completly, the main thread will be blocked until MSMQ have a new message arrive. I've written a bit of code, but have an exception that explained like below: Message ret = null; Cursor cursor = mq.CreateCursor(); bool isTheFirst = true; while (true) { if (isTheFirst) { ret = mq.Peek(new