Pop up menus
Hello
Im trying to allow the player in my "game" to right-click the screen and get a menu popped up (just like the regular menus that pops up when you right click stuff -like the desktop, MS Word, Netscape-) and I want to, of course, put any button (or entry) in the menu and be able to read which entry was selected and process it.
Is it hard to do? Can someone help me on this? =]
Thanks a lot!
Cya,
-RoTTer
If you''re using the windows message queue, you want WM_RBUTTONDOWN. If you''re using DirectInput, you want to test the high bit of rgbButtons[1].
Hey!
Thanks for the answer :>
Uhm, Im using Windows'' MSGs. But how can I actually make theat menu pop up, and then read what option the guy selected?
Cya, and thanks again,
-RoTTer
Thanks for the answer :>
Uhm, Im using Windows'' MSGs. But how can I actually make theat menu pop up, and then read what option the guy selected?
Cya, and thanks again,
-RoTTer
If you want a right-click popup menu you will need to use a resource script to design your menu, assign each button an ID etc... The whole process is a bit large to explain here, but if you have the DXSDK quite a few of the samples use those kinds of menu (e.g. the DInput Scrawl sample). You can look at the source code and see how it is done.
-- Jon Hobson --
-- Jon Hobson --
---------- JonHobson ----------
Ah!
Thanks a lot for the hint. I do have the DX SDK here (and am using DX to do the "game", but as it is windowed and is not really a game, I thought it would be easier to use that kind of menu that Windows "supports" and I dont have to make my own), Ill check that sample you pointed out!
Thanks again, and cya,
-RoTTer
Thanks a lot for the hint. I do have the DX SDK here (and am using DX to do the "game", but as it is windowed and is not really a game, I thought it would be easier to use that kind of menu that Windows "supports" and I dont have to make my own), Ill check that sample you pointed out!
Thanks again, and cya,
-RoTTer
Hey
Does anyone have a specific example (sample code) on that subject? Or could write a small example code here?
Cause I was really lost on that DX example as Im not really a Windows expert (not even 1/100 of it heeh) programmer...
I found the part that adds the 3 custom buttons on the pop-up menu, but I couldnt find the code that initializes/assigns the right buttom to pop that up =/.
Thanks a lot, cya,
-RoTTer
Does anyone have a specific example (sample code) on that subject? Or could write a small example code here?
Cause I was really lost on that DX example as Im not really a Windows expert (not even 1/100 of it heeh) programmer...
I found the part that adds the 3 custom buttons on the pop-up menu, but I couldnt find the code that initializes/assigns the right buttom to pop that up =/.
Thanks a lot, cya,
-RoTTer
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement