Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- BOOL CALLBACK find_and_resize_proc1(HWND hwnd, LPARAM lParam)
- {
- WCHAR wsz1[128];
- WCHAR wsz2[128];
- GetClassName(hwnd, wsz1, 128);
- GetWindowText(hwnd, wsz2, 128);
- if (wcscmp(wsz1, L"Chrome_WidgetWin_0") != 0 || !wsz2[0])
- return TRUE;
- RECT rc, rc1, rc2;
- GetClientRect(hwnd, &rc);
- HWND hwnd1 = GetWindow(hwnd, GW_CHILD);
- HWND hwnd2 = GetWindow(hwnd1, GW_HWNDNEXT);
- hwnd2 = GetWindow(hwnd2, GW_HWNDNEXT);
- GetWindowRect(hwnd1, &rc1);
- GetWindowRect(hwnd2, &rc2);
- MapWindowPoints(HWND_DESKTOP, hwnd, (LPPOINT)&rc1, 2);
- MapWindowPoints(HWND_DESKTOP, hwnd, (LPPOINT)&rc2, 2);
- rc1.left += 100;
- rc1.top += 100;
- rc1.bottom -= 100;
- rc1.right = rc.right / 2;
- MoveWindow(hwnd1, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, TRUE);
- return FALSE;
- }
- int APIENTRY _tWinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPTSTR lpCmdLine,
- int nCmdShow)
- {
- EnumWindows(find_and_resize_proc2, NULL);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement