StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Open or close program same gesture
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Vitor

8 Posts

Posted - 01/28/2014 :  09:54:15  Show Profile  Reply with Quote
Hello all,

I'm trying to figure out how to do this, maybe some of you could help me out.

My goal is to open a program if he is closed, and close it if he is opened... with the same gesture.
Do you think this is possible?

Thanks in advance

Vitor

Rob

USA
2601 Posts

Posted - 01/28/2014 :  10:03:08  Show Profile  Visit Rob's Homepage  Reply with Quote
The easiest was would be finding the window by its class name or using a wildcard on its title:
--local swnd = acFindWindow("Notepad",nil) --this line would match on exact class name
local swnd = acFindWindowByTitleRegex(".* - Notepad") --finds by title wildcard
if swnd > 0 then
	acCloseApplication(swnd)
else
	acRunProgram("c:\\windows\\notepad.exe","",0, 1)
end
Go to Top of Page

Vitor

8 Posts

Posted - 01/28/2014 :  10:40:14  Show Profile  Reply with Quote
THANKS!!!!

That worked nice, but with acTerminateProcess for closing the program


vitor
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000