🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Win32 APi GetMessage Vs MFC Message Maps VS DirectInput

Started by
3 comments, last by St_Shadow 24 years, 5 months ago
Wich one is the best to use and why
Advertisement
That last part should be DirectX DirectInput
Well lets start out with GetMessage() vs MFC message maps.
When you use MFC message maps you are using GetMessage(). Deep within the bowls of MFC you will find a message pump that calls GetMessage() just like any standard windows application. If you look hard enough you will even find the gigantic case statement that MFC is supposed to eliminate. MFC apps are no different than any other windows app, MFC just uses a different method of getting the messages to the code that will handle it.

Now when we talk about DirectInput we are actualy talking about a different beast entirely. DirectInput gives you more direct access to the keyboard, mouse, and joysticks. But you still need to use GetMessage() (or the related PeekMessage() which is better for games) to process the standard windows messages. In my opinion the only thing DirectInput is good for is access to joysticks, gamepads, or forcefeed back devices. If you need to poll the keyboard or mouse in real time you can call GetCursorPos() and GetAsyncKeyState(), both are serviced by hardware interupts and are as up-to-date as any state info you would get from DirectInput.

So in a nut shell, you are always using GetMessage() and you only need DirectInput if you want to access joysticks, gamepads, or forcefeed back devices.
Thanks ....could you point me towards a good source of the actual window''s messages I''ve looked in my help files for MSVC and on the microsoft site but can''t find a good list of as many of them as possible
Actually, I have found that the online docs with MSVC has a rather good list of Windows messges. Try going into the docs index and typing in WM_. Since all Windows messages begin with this prefix, it will lead you right to the beginning of them.

"Programming Windows" by Charles Petzold and "Programming Windows with MFC" by Jeff Prosise are two really good books for learning the Win32 SDK and then MFC. Maybe these will help you.

Edited by - I-Shaolin on 1/25/00 5:03:58 AM

This topic is closed to new replies.

Advertisement