?
Juhuuuuuu !!!! xDDD .. funzt danke
ich hatte sowas vorher schonmal probiert also sowas wie:
char a = LoadMenu( ... );
SetMenu(Fenster, a);
aber da der erforderliche Wert ja HWND ist (hätt ich wissen müssen) musses ja anders aussehen ..
Danke! ..
Nochmal der cpp-Source-Code für Leute die ähnliche Probleme haben:
#include <windows.h>
#include <resource.h>
bool Prozedur(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_CLOSE)
{
PostQuitMessage(0);
}
return 0;
}
int WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
{
HMENU a = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU1));
MSG msg;
HWND Fenster = CreateWindowEx(0, WC_DIALOG, "Mein Fenster", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, NULL, NULL, NULL, NULL);
SetWindowLong(Fenster, DWL_DLGPROC, (long)Prozedur);
SetMenu(Fenster, a);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
Nun müsst ihr nur noch die resource-datei + header datei schreiben ..
Diese stehen ganz oben ..