0

Sorry is this is a basic question but I can't wrap my head around this. I am trying to maximize a new chrome window, but I cant seem to find the handle to it. Here is the code I wrote so far to try to debug it but...

 LPCWSTR window = L"chrome.exe";
    HWND hWND = FindWindow(NULL, window);
    SetWindowPos(
        hWND,
        HWND_TOPMOST,
        10,
        10,
        10,
        10,
        SWP_SHOWWINDOW
    );

The values were set to 10 just to see if it would move.

a) how do i get the handle of a specific window (in this case a new window of chrome)

b) is there a faster way to maximize a window than SetWindowPos()

bolov
  • 72,283
  • 15
  • 145
  • 224
  • 1
    See https://stackoverflow.com/questions/16530871/findwindow-does-not-find-the-a-window. The window title is probably not "chrome.exe", even if that's what you see in the physical caption bar – Silvio Mayolo Apr 25 '21 at 03:07
  • Oh I see, thank you very much, the link definitely helped. – The1Guy Apr 25 '21 at 04:04

0 Answers0