How to use SDL_GetWindowWMInfo to get access to the HWND?

I’d like to get a HWND reference to the SDL Window when running under Windows, so I can put a menu bar in it.\bCategoryStruct\b)|(CategorySWM)|(SGStructures)

I’m using the sample code here:

But I get a compile error “error C2039: ‘win’ : is not a member of ‘SDL_SysWMinfo’”

Any ideas what I’m doing wrong? Yes, this is when compiling on Windows.


#include “SDL_syswm.h”

void initMMMenuBar(void )
SDL_SysWMinfo windowInfo;

SDL_GetWindowWMInfo( gSpriteWorldP->mainWindow, &windowInfo );

… // unrelevantcode to create menu bar goes here…

SetMenu(, hMenu); // COMPILE ERROR HERE: no win.window field

The documentation you used is intended for SDL 1.3, but the structure shown in the wiki is out of date even for that version - currently you get access to that property by using:

If you are working with SDL 1.3, I recommend you to keep a copy of its source code handy to look up things that might have changed since the wiki pages were written.