Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

steg

Best way to create a message pump

This topic is 5494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a thread and want it to accept windows messages, problem is, the thread has no user interface, hence no message pump. What is the best way to do one, does the following look ok ? while(true) { if (::GetMessage(&m, NULL, WM_BUTTON_RANGE_LOW , WM_BUTTON_RANGE_HI)) { ::TranslateMessage(&m); ::DispatchMessage(&m); } } BTW - this is in a MFC applicaiton DLL. Regards, Steve

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
see my answer to your other thread regarding the processing of non-window oriented msgs.

on NT/2K/XP, you can also create a message-only window if you want to have the msgs dispatched to a particular WindowProc but have no GUI. you do this by specifying HWND_MESSAGE as the parent to your window, either in the CreateWindow/Ex call or via SetParent.

on 9x, you can create a window without making it visible (don''t specify WS_VISIBLE and don''t call ShowWindow) and making it''s width and height = 0 to achieve the same result.

i have no idea how any of this applies to MFC though.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
try it. i''d imagine that the call would fail, but you never know.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!