WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open a program

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
oman00339



Joined: 28 Jan 2007
Posts: 7

Digg It
PostPosted: Tue Feb 06, 2007 3:34 am    Post subject: Open a program

Is there a way that when I press a button it will open a program, and when I press it again it will close that program? I know there is a way to do it, I just don't know how.
Back to top
View user's profile Send private message
TylerK



Joined: 18 Dec 2006
Posts: 384
Location: Springfield, IL

Digg It
PostPosted: Tue Feb 06, 2007 4:10 am    Post subject:

Basic, but does the trick.
Code:
if (!var.init) then
  var.switch = false
  var.init = true
endif

if (Pressed(Wiimote.A)) then
  if (var.switch) then
   Alt && F4 = true
   wait 30 ms;
   Alt && F4 = false
  else
   Execute("C:\somefolder\someprogram.exe")
  endif

  var.switch = !var.switch
endif
Back to top
View user's profile Send private message
oman00339



Joined: 28 Jan 2007
Posts: 7

Digg It
PostPosted: Wed Feb 07, 2007 3:51 am    Post subject:

It works to open the program, but it won't shut it down. Is there a way to close a specific program? I was thinking about if there was a command to stop a specific process, like you can do in the windows task manager
Back to top
View user's profile Send private message
JoCliMe



Joined: 15 Dec 2006
Posts: 16
Location: El Centro, CA

Digg It
PostPosted: Wed Feb 07, 2007 4:54 am    Post subject:

Maybe map a key to "alt + f4"?
Edit: Wait, you mean you want to close a program/window that does not have the focus? The above script opens/closes the window that's open.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
ZW



Joined: 11 Jan 2007
Posts: 18

Digg It
PostPosted: Fri Feb 09, 2007 7:00 pm    Post subject:

Here's a way to do it even if the program you want to close isn't the active window:

Have a counter variable which increments anytime you open a program. Then have separate variables for each program you open that store the value of the counter when you opened that program. From that number you could know how many alt+tabs you need to do before you alt+f4.

There is probably a better way to do it though, because with what I am describing everything has to be opened through glovepie...otherwise the numbers will be off.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group