Jump to content

How to show a console application


Recommended Posts

Hi,

I have two applications, one is a GUI based and the second one is an autoit console application.

From the GUI application I execute the console with the run command

Run(@ScriptDir & "\" & "Console.exe", @SystemDir, @SW_HIDE)

The console launch and run properly but in hidden mode as expected.

Now I want to SHOW the console application from the main GUI.

What function should I call to show the console?

regards!

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

Hi,

I have two applications, one is a GUI based and the second one is an autoit console application.

From the GUI application I execute the console with the run command

Run(@ScriptDir & "\" & "Console.exe", @SystemDir, @SW_HIDE)

The console launch and run properly but in hidden mode as expected.

Now I want to SHOW the console application from the main GUI.

What function should I call to show the console?

regards!

I think I have got the idea unless you have a shorter solution then this:

$var = WinList()

For $i = 1 to $var[0][0]
 
  If  $var[$i][0] <> ""  Then

        If StringInStr($var[$i][0],"Console.exe") then

        MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
        WinSetState(HWnd($var[$i][1]), "", @SW_SHOW)
    ;   WinSetState(HWnd($var[$i][1]), "", @SW_HIDE)

  EndIf


  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...