Sign in to follow this  
Followers 0
Venom4444

Minimize Windows Executing APP

3 posts in this topic

Hi to All

I have something to ask

I have an Wrote an example App that will open CMD.exe the menu will open and you click on Enable

How do i get the App Menu minimized after CMD.exe is open .?

Exmaple

#include <GUIConstantsEx.au3>

opt("MustDeclareVars", 1)

_MAIN()

Func _MAIN()

Local $YESID, $NOID, $EXITID, $MSG

GUICreate("CMD OPEN", 320, 100)

GUICtrlCreateLabel("CMD OPEn", 10, 10)

$YESID = GUICtrlCreateButton("Notepad.exe", 10, 50, 50, 20)

$NOID = GUICtrlCreateButton("CMD", 80, 50, 50, 20)

$EXITID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)

GUISetState()

Do

$MSG = GUIGetMsg()

Select

Case $MSG = $YESID

Run("notepad.exe")

Sleep(1000)

;RunWait("net stop fcsam")

;Sleep(1000)

Case $MSG = $NOID

Run("cmd.exe")

Sleep(1000)

Case $MSG = $EXITID

Case $MSG = $GUI_EVENT_CLOSE

MsgBox(0, "Application Will Exit", "Close")

EndSelect

Until $MSG = $GUI_EVENT_CLOSE Or $MSG = $EXITID Or $MSG = $YESID Or $MSG = $NOID

EndFunc

Sleep("1000")

Exit

#include <GUIConstantsEx.au3>
opt("MustDeclareVars", 1)
_MAIN()

Func _MAIN()
    Local $YESID, $NOID, $EXITID, $MSG
    GUICreate("CMD OPEN", 320, 100)
    GUICtrlCreateLabel("CMD OPEn", 10, 10)
    $YESID = GUICtrlCreateButton("Notepad.exe", 10, 50, 50, 20)
    $NOID = GUICtrlCreateButton("CMD", 80, 50, 50, 20)
    $EXITID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
    GUISetState()
    Do
        $MSG = GUIGetMsg()
        Select
            Case $MSG = $YESID
                Run("notepad.exe")
                Sleep(1000)
                ;RunWait("net stop fcsam")
                ;Sleep(1000)
            Case $MSG = $NOID
                Run("cmd.exe")
                Sleep(1000)
            Case $MSG = $EXITID
            Case $MSG = $GUI_EVENT_CLOSE
                MsgBox(0, "Application Will Exit", "Close")
        EndSelect
    Until $MSG = $GUI_EVENT_CLOSE Or $MSG = $EXITID Or $MSG = $YESID Or $MSG = $NOID
EndFunc

Sleep("1000")
Exit

How can i change the code that if you open an App like CMD.exe from the Option Menu that the main

Windows can just Minimize to my system tray so if im finished with the App Example opening the CMD.exe in my script i can

Only click on the main menu to choose the new App i wanne open.

CMD Example.au3

Share this post


Link to post
Share on other sites



Use

GUISetState(@SW_MINIMIZE)
to minimize the GUI.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Use

GUISetState(@SW_MINIMIZE)
to minimize the GUI.

Thanx Its working fine now

#include <GUIConstantsEx.au3>
opt("MustDeclareVars", 1)
_MAIN()

Func _MAIN()
    Local $YESID, $NOID, $EXITID, $MSG
    GUICreate("CMD OPEN", 320, 100)
    GUICtrlCreateLabel("CMD OPEn", 10, 10)
    $YESID = GUICtrlCreateButton("Notepad.exe", 10, 50, 50, 20)
    $NOID = GUICtrlCreateButton("CMD", 80, 50, 50, 20)
    $EXITID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
    GUISetState()
    Do
        $MSG = GUIGetMsg()
        Select
            Case $MSG = $YESID
                Run("notepad.exe")
                Sleep(1000)
                ;RunWait("net stop fcsam")
                ;Sleep(1000)
                GUISetState(@SW_MINIMIZE)
            Case $MSG = $NOID
                Run("cmd.exe")
                Sleep(1000)
                GUISetState(@SW_MINIMIZE)
            Case $MSG = $EXITID
            Case $MSG = $GUI_EVENT_CLOSE

                MsgBox(0, "Application Will Exit", "Close")
        EndSelect
    Until $MSG = $GUI_EVENT_CLOSE or $MSG = $EXITID
EndFunc

Sleep("1000")
Exit

I did it like this and it seems to work after i lick on the open it minimizes

Thanx for the Help

:-)

Share this post


Link to post
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
Sign in to follow this  
Followers 0