Questions tagged [peekmessage]

32 questions
9
votes
3 answers

Why peekmessage before getmessage?

Why the peekMessage statement is required before Getmessage() for creating message queue?
Josh
  • 93
  • 1
  • 3
6
votes
5 answers

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

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…
Matt Cruikshank
  • 2,932
  • 21
  • 24
4
votes
1 answer

Combine GetMessage and PeekMessage

I intend to create a small application with 2 windows, a normal window with controls and a 3D window, rendered with DirectX. For 3D window PeekMessage() is recommended because it doesn't wait after checking the messages but for normal windows (no 3D…
ali
  • 10,927
  • 20
  • 89
  • 138
3
votes
2 answers

PeekMessage not getting the message?

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…
Jarrett
  • 1,767
  • 25
  • 47
3
votes
0 answers

Latency of Polling Next Event if Available on MacOS

I am trying to write a simple game loop for MacOS. The event polling solution I found on libraries like GLFW, SDL, and MacOS game ports for DOOM, Quake, Handmade Hero is to use the nextEventMatchingMask API. I am interested in the latency of event…
llins
  • 75
  • 4
3
votes
1 answer

GetMessage/PeekMessage - remove all messages in message queue

I have the following code SendApp, when click button [X], the following code execute HWND pHWndReceiveApp = FindWindowA(NULL, "ReceiveApp"); if (NULL == pHWndReceiveApp) { MessageBox(0, MSG_FAIL, CAPTION, 0); return; } …
123iamking
  • 2,387
  • 4
  • 36
  • 56
3
votes
2 answers

Message peek in IBM MQ

In MSMQ there is a functionality that lets users to peek at a message without actually consuming it. i.e. I peek at the next message in a Queue based on MessageID. If I am not interested in the message I can put the message back into the Queue (i.e.…
user2595169
  • 147
  • 1
  • 14
3
votes
0 answers

Delphi PeekMessage access violation Delphi 2009 Windows API

Periodically getting an access violation from a PeekMessage. This is not my call to PeekMessage, it's from Application.Run. Stack trace from MadExcept shows Application.Run calling PeekMessage which in turn is calling…
RBrowning99
  • 411
  • 2
  • 9
  • 21
2
votes
1 answer

Why the PeekMessage always return TRUE?

// Main message loop MSG msg; ZeroMemory( &msg, sizeof( msg ) ); while(msg.message!=WM_QUIT) { if(PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) ) { TranslateMessage(…
2
votes
1 answer

Peek MSMQ message with infinite timeout

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…
GIANGPZO
  • 380
  • 2
  • 3
  • 21
1
vote
0 answers

PeekMessage C++ 64-bit

I am using the following code in my WinMain function: // Main message loop: bool noQuit = true; while (noQuit) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); if…
M. Laing
  • 1,607
  • 11
  • 25
1
vote
1 answer

PeekMessage don't get any message

I am trying to create a rendering loop inside a C++/CLI library for a .NET Windows Form application but the PeekMessage never get any messages. So my render loop is infinite and the form appear frozen. I have tried several way of doing it but here…
Karnalta
  • 518
  • 1
  • 9
  • 24
1
vote
2 answers

Launching application via CreateProcess but cant seem to PeekMessage?

I have a simple (windows) application that launches another application using the CreateProcess function. It then gets the correct hwnd by using EnumWindows and the process id of the newly created process. After the hwnd has been gained, the 'main…
Dekita RPG
  • 11
  • 4
1
vote
1 answer

Peek MSMQ message with unlimited timeout

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…
GIANGPZO
  • 380
  • 2
  • 3
  • 21
1
vote
1 answer

PostThreadMessage doesn't work

I have an event-handling thread class which allows me to raise events from other threads without interrupting their operation. When the destructor is called I send a quit message to the thread, but its message loop doesn't seem to receive this…
user3235832
1
2 3