WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Tue Jun 24, 2008 7:28 am Post subject: CreateDialog |
|
|
How do I close the damn dialog? The cursor won't even hover over the red x, and I can't exit it w/o rightclicking item on bar and click close.
HELP!!
| Code: | #include <windows.h>
#include <resource.h>
LRESULT WINAPI DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX WindowClass;
static LPCTSTR szAppName = L"OFWin";
HWND hWnd;
MSG msg;
WindowClass.cbSize = sizeof(WNDCLASSEX);
WindowClass.style = CS_HREDRAW | CS_VREDRAW;
WindowClass.lpfnWndProc = DialogProc;
WindowClass.cbClsExtra = 0;
WindowClass.cbWndExtra = 0;
WindowClass.hInstance = hInstance;
WindowClass.hIcon = LoadIcon(0, IDI_APPLICATION);
WindowClass.hCursor = LoadCursor(0, IDC_ARROW);
WindowClass.hbrBackground = (HBRUSH)(COLOR_MENU);
WindowClass.lpszMenuName = 0;
WindowClass.lpszClassName = szAppName;
WindowClass.hIconSm = 0;
RegisterClassEx(&WindowClass);
hWnd = CreateDialog(
hInstance,
MAKEINTRESOURCE(IDD_DIALOG1),
0,
(DLGPROC)DialogProc
);
while(GetMessage(&msg, 0, 0, 0) == TRUE)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return static_cast<int>(msg.wParam);
}
LRESULT WINAPI DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
return TRUE;
case WM_CLOSE:
DestroyWindow (hWnd);
return TRUE;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
} |
|
|