Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #define null NULL
- int MBox(LPWSTR title, LPWSTR text, long type)
- {
- return MessageBox(null, text, title, type);
- }
- int MBox(LPWSTR title, LPWSTR text)
- {
- return MBox(title, text, MB_OK);
- }
- LRESULT CALLBACK OnWindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message)
- {
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- break;
- }
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
- {
- HWND hWnd;
- WNDCLASSEX wc;
- ZeroMemory(&wc, sizeof(wc));
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = OnWindowEvent;
- wc.hInstance = hInstance;
- wc.hCursor = LoadCursor(null, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
- wc.lpszClassName = L"Window1";
- RegisterClassEx(&wc);
- hWnd = CreateWindowEx(null, L"Window1", L"D3DTest1 Main Window", WS_OVERLAPPEDWINDOW, 300, 300, 500, 600, null, null, hInstance, null);
- ShowWindow(hWnd, nShowCmd);
- MSG message;
- while (GetMessage(&message, null, 0, 0))
- {
- TranslateMessage(&message);
- DispatchMessage(&message);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement