![]() |
Adding drop-down menus to SDL surface window? | ![]() |
![]() |
![]() |
miker00lz
![]() |
![]() |
Ah, I figured out a way to do it myself. I will post how in case anybody in the future comes across this thread in a search.
I #include "SDL_syswm.h" and <windows.h> and created a function to return the SDL surface window's hWnd value like this:
I'm using MS Visual Studio 2003, so I created a menu using it's resource editor tools. My menu's resource number is 102, so knowing that I made a function to attach the menu resource to SDL's window:
And voila, we have a menubar! ![]() Now I just need to figure out how to intercept SDL's WndProc function to handle the menu items getting clicked. I am thinking I can do this with GetWindowLong to get the old procedure's pointer, and replace it with my own using SetWindowLong. I will need to forward callbacks I do not handle to SDL's old procedure handler though. Time to do some experimentation. If anybody knows a better way to do this, let me know please! ![]() |
||||||||||||||
|