Advertisement
Guest User

Untitled

a guest
Jan 12th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3.  
  4. using namespace std;
  5.  
  6. BOOL CALLBACK EnumWindowsProc(_In_ HWND hwnd, _In_  LPARAM lParam)
  7. {
  8.     DWORD pid;
  9.     GetWindowThreadProcessId(hwnd, &pid);
  10.  
  11.     if (pid == 2324)
  12.     {
  13.         auto result = SetWindowPos(hwnd, 0, 400, 400, 400, 400, 0);
  14.  
  15.         if (result == 0)
  16.         {
  17.             cout << "Error " << GetLastError() << endl;
  18.         }
  19.     }
  20.  
  21.     return TRUE;
  22. }
  23.  
  24. int main()
  25. {
  26.     EnumWindows(EnumWindowsProc, 0);
  27.  
  28.     system("pause");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement