I'm writing a win32 app in Win API, using VC++ 7.0.
So I made my dialog box in the resource editor... and put this code in my main.cpp
Code:
BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
switch(Message) {
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam)) {
}
}
return TRUE;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
MSG Msg;
HICON hMyIcon = LoadIcon(hInstance, "icon1.ico");
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_MAIN), 0, MainDlgProc);
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
But the dialog box shows up with some parts transparent and just screwed up, and i cant interact with it, and I have to ctrl+alt+del to quit
Any ideas?
Thanks