Sign in to follow this  
Mortizar

Win32 Question

Recommended Posts

Mortizar    122
This is a question that has to do with a windows wrapper I am trying to write. I want the wrapper to handle some messages internerlly (meaning the class does it without out the user of the wrapper haveing to do anything). To this end I have trying windows hooks as well as grabing the message in the message pump and do the work there. However ever way i try to do this I seem to fail at it. It fails because for some reason when i test the message value for the windows message I want to do the work on i can never get it to test true even when I know the message has to be sent. The question is this, Do the message processing functions (GetMessage, TranslateMessage, Dispatch message) do things the MSG struture variable passed to it that makes what I am trying to do impossable? Or have some of you done what I am trying to do succefully?

Share this post


Link to post
Share on other sites
Fase    133
If I understand your problem, it's because of the way GetMessage works. GetMessage removes the message from the message queue. You might try PeekMessage instead.
See here

Hope that helps.

Share this post


Link to post
Share on other sites
Endurion    5412
From what i understand he tries to process messages inside the message loop.

This will not work (TM).

TranslateMessage will send several different messages to your window proc which you will NEVER see outside of it. A WM_KEYUP message can end with your window proc receiving a WM_CHAR for example. You will not receive a lot of messages by only relying on GetMessage/PeekMessage.

Do not even try. You have to process them via WindowProc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this