2

I'm trying to maximize "Microsoft Minesweeper" (Windows 10) proccess with this code:

    static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
    private const int SW_MAXIMIZE = 3;

    IntPtr HWND = FindWindow(null, "Microsoft Minesweeper");
    ShowWindow(HWND, SW_MAXIMIZE);    

At first this works, but for some reason after I minimize it, the code doesn't work anymore. I've checked that code on another process (Notepad) and it worked perfectly, even after I minimized the notepad. Yet for some reason, the "Microsoft Minesweeper" doesn't work.

Any idea why it doesn't work after I minimize?

pgSystemTester
  • 8,979
  • 2
  • 23
  • 49
Yaniv
  • 63
  • 6

0 Answers0