How can i bring a process window to the front using AutoIt3?

if (au3.WinExists(processName, "") == 0)
            {
                au3.Run(@"C:Program Files (x86)Paint.exe", "", au3.SW_SHOW);
                Thread.Sleep(10000);
                au3.MouseClick("LEFT", 358, 913, 1, -1);

            }
            else
            {
                au3.Run(@"C:Program Files (x86)Paint.exe", "", au3.SW_SHOW);
Thread.Sleep(10000);
                au3.MouseClick("LEFT", 358, 913, 1, -1);
            }

I’m using AutoIt3XClass which is part of the AutoIt3XLib
So i’m checking if the process exist or not. If not run it and it will show in the front in the center of the screen.

The problem is if the process already running and I want to maximize it and bring it to the front to the center of the screen.
I didn’t find any properties in au3(AutoIt3XClass) that will bring it to the front. Doing au3.Run bring it to the front but i don’t want to run it again if it’s already running.

So maybe au3 have a property to just show/bring it to the front ? If not maybe using other way to bring it to the front ?


Source: .net

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.