Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include "resource.h"
- BOOL CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
- {
- HWND hDlg;
- MSG msg;
- hDlg = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), 0, DialogProc, 0);
- ShowWindow(hDlg, iCmdShow);
- while (GetMessage(&msg, NULL, 0, 0))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- return 0;
- }
- BOOL CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
- {
- static HWND edit1;
- switch (message)
- {
- case WM_INITDIALOG:
- edit1 = GetDlgItem(hDlg, IDC_EDIT1);
- return TRUE;
- case WM_CLOSE:
- EndDialog(hDlg, 0);
- DestroyWindow(hDlg);
- return 0;
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- }
- return DefWindowProc(hDlg, message, wParam, lParam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement