Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <stdio.h>
- int main()
- {
- wchar_t window_name[128] = { 0 };
- HWND window_handle = 0;
- int window_x = 0;
- int window_y = 0;
- while (!window_handle)
- {
- wprintf(L"enter window name: ");
- wscanf(L"%s", window_name);
- window_handle = FindWindow(NULL, window_name);
- if (window_handle)
- {
- wprintf(L"window found.\n\n");
- }
- else
- {
- wprintf(L"could not find window.\n\n");
- }
- }
- wprintf(L"enter window x: ");
- wscanf(L"%d", &window_x);
- wprintf(L"enter window y: ");
- wscanf(L"%d", &window_y);
- SetWindowPos(window_handle, NULL, 0, 0, window_x, window_y, NULL);
- wprintf(L"window resolution changed.\n\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement