Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How can I make a program start when another program opens?

29 Jul 2015   #11
UsernameIssues

W7 Pro SP1 64bit
 
 

See if this works for you.

Code:
Opt("TrayIconDebug", 1)
Opt("WinTitleMatchMode", 2)

$Notepad = "no"
$WordPad = "no"
$Calculator = "no"
$Paint = "no"

While 1
    Sleep(50)

    If WinExists("Notepad") And $Notepad = "no" Then
        Run("c:\windows\system32\calc.exe")
        WinWait("Calculator")
        $Notepad = "yes"
        $Calculator = "yes"
    EndIf
    If Not WinExists("Notepad") And $Calculator = "yes" Then
        WinClose("Calculator")
        WinWaitClose("Calculator")
        $Notepad = "no"
        $Calculator = "no"
    EndIf

    If WinExists("WordPad") And $WordPad = "no" Then
        Run("c:\windows\system32\mspaint.exe")
        WinWait("Paint")
        $WordPad = "yes"
        $Paint = "yes"
    EndIf
    If Not WinExists("WordPad") And $Paint = "yes" Then
        WinClose("Paint")
        WinWaitClose("Paint")
        $WordPad = "no"
        $Paint = "no"
    EndIf
WEnd



My System SpecsSystem Spec
.
30 Jul 2015   #12
SammyTheBEAST

Windows 7 x64
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
See if this works for you.

Code:
Opt("TrayIconDebug", 1)
Opt("WinTitleMatchMode", 2)

$Notepad = "no"
$WordPad = "no"
$Calculator = "no"
$Paint = "no"

While 1
    Sleep(50)

    If WinExists("Notepad") And $Notepad = "no" Then
        Run("c:\windows\system32\calc.exe")
        WinWait("Calculator")
        $Notepad = "yes"
        $Calculator = "yes"
    EndIf
    If Not WinExists("Notepad") And $Calculator = "yes" Then
        WinClose("Calculator")
        WinWaitClose("Calculator")
        $Notepad = "no"
        $Calculator = "no"
    EndIf

    If WinExists("WordPad") And $WordPad = "no" Then
        Run("c:\windows\system32\mspaint.exe")
        WinWait("Paint")
        $WordPad = "yes"
        $Paint = "yes"
    EndIf
    If Not WinExists("WordPad") And $Paint = "yes" Then
        WinClose("Paint")
        WinWaitClose("Paint")
        $WordPad = "no"
        $Paint = "no"
    EndIf
WEnd
Thanks so much its working perfectly!
My System SpecsSystem Spec
Reply

 How can I make a program start when another program opens?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
one program opens on 3rd monitor
Hello : I have one program that on start up , it opens on the 3 rd monitor . I have tried the dragging to the correct monitor , maximizing / minimizing the program , but it always returns to the other monitor ... Ideas and thanks for having a community like this ..
General Discussion
Changing theme when program opens
Hey guys I have a quick question, I play videogames on my pc and get much better performance when I go to windows classic, but I like the look of windows aero for general computing. Is there any way I can make the computer change themes when a certain program is open, like battlefield 3, and switch...
Themes and Styles
Windows Runs Installation of Program When I Start Program
I installed Weathrbug Plus and for some odd reason recently when I run it Windows runs the installation for the program. When I run the prograsm I get the typical "Preparing to install..." abnd then tyhe 'Configuring Weatherbug. I've been in contact with Weatherbug Support all day and we can't seem...
Software
How to make a program start at windows startup:
How to make a program start at windows start-up: Run - These are the most common start-up locations for programs to install auto start from. By default these keys are not executed in Safe mode. If you prefix the value of these keys with an asterisk, *, it will run in Safe Mode. ...
General Discussion
Click on shortcut, other program opens
64 bit Win 7 Ultimate Had a few problems recently with my PC, finally have them resolved, I hope. I only use IE 9 and have a short cut icon on my desk top. When I click on it, Ask Jeeves appears instead. If I go to start/programs, click on IE 9, same thing happens.
Browsers & Mail
LiveMail opens the MSN site not the program!
Hi! I have decided to use MSN Messenger and LiveMail on my Windows 7 laptop. I signed up for a LiveMail email address and this works fine on MSN Messenger. If I click the envelope icon on the top right of the MSN Messenger screen, it causes the MSN web site to open and not the LiveMail...
Software


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:25.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App