SDL2 & Winapi question/problem


I’m brand new here, but I’m glad to be part of this community :slight_smile:

I have problem with bringing together WinApi GUI and SDL2.

What I have:

I’m making by SDL2 a normal window, then (except other things I do) I retriving that sdl window hwnd and use it tomake winapi menu and other stuff. Everything works fine. I even making the new window only in winapi and it is also working.


When I try to handle menu, by using WM_COMMAND, then nothing happends. How I should do that?

I tryed to get the native events, by enabling the SDL_SYSWMEVENT and retriving wParam, lParam and the rest of that stuff. Only sysevent is working.

Ofcourse I also defined the winapi new events like that:
#define ID_MENU_NEW FILE 9001

Can someone point me in the right direction how to handle WM_COMMAND from this menu?

PS: If there will be need I can post the code. I can’t do that now, unfortunatly.

Thanks for any kind of help!

Here it is hopw I tryed to handle mernu bar commands.

void WinGUI::MenuUpd(SDL_Event &e)

						UINT Message = e.syswm.msg->;
						WPARAM wParam = e.syswm.msg->;
						LPARAM lParam = e.syswm.msg->;
						HWND hwnd = e.syswm.msg->;

						if (e.syswm.msg-> == WM_DEVICECHANGE) 
							//This event is actualy working

						if (e.syswm.msg-> == WM_COMMAND) 
							// ...and that is not working
							Logger::Instance()->write2console("WM_COMMAND Event");

								case ID_FILE_EXIT:
									PostMessage(mainhwnd, WM_CLOSE, 0, 0);
								case ID_INFO_ABOUT:
									MessageBox( NULL, "To jeszcze nie dziaA?a!", "Info", MB_ICONINFORMATION );