Build Your Own Arcade Controls Forum
Main => Main Forum => Topic started by: big daddy on February 14, 2007, 11:43:39 pm
-
I have some PC games on my arcade and my 3 year old loves to play them, but he gets overzealous (or impatient) and hits the button several times so several instances of the games start up. This eventually causes focus problems and I'll have to break out the keyboard to "end task" some of the things.
Occassionally I'll come in and there'll be like 3 or 4 different games running (Dora, Clifford, etc.) :)
Anyways...is there anyway to prevent this (any sort of wrapper I can run or way to prevent multiple copies from opening?)
I also use Mamewah and can have the games kickoff from there, but it always loses focus (again probably from all the button mashing while the game is being started) and I end up having to break out the keyboard for that as well.
Any suggestions? (aside from actually teaching my kid not to do it...'cause he just doesn't seem to want to listen!) "I pushed it once dad! (after he hits it 3 or 4 times) :)
-
If you have keys mapped to cntrl, alt, shift, or space - you should probably change those mappings for starters.
Also, this problem fixes itself in about 6-7 years. ;)
-
I tried to tackle a similar problem yonkers ago, but I threw away the code. I just wasn't very happy with it. Essentially what I did was write a simple VB application where you would just pass in a launch string and the program would attempt to see if it was already launched.
Unfortunately, I wasn't very experienced at the time and the method I chose to see if a particular app was already launched was by writing a file out. If the program or OS crashed, it wouldn't let you launch it again. :( I figured a way to fix it, but by then, the need for having such a thing disappeared... or I lost interest... something like that. Basically, if I found this http://support.microsoft.com/kb/185730 I might've been better off.
I did a quick Google search and found the following links
http://www.windowsitpro.com/Article/ArticleID/37748/37748.html
I don't know if it'll work in XP or not and it's a VBS, which tends to set off some virus scanners.
I can find gobs of code in a variety of programming languages that can be modified to accomplish what you want. But I can't find any universal tool to accomplish it.
That should be an interesting and useful tool to make if there isn't one out there.
-
OK, I've put together a quickie hack. Took me about 15 minutes to research and write the code using the samples, took me about 1.5 hours to remember how to use the Microsoft VB IDE. It'll probably take me another hour to remember how to build a setup package.
The code seems to run OK, but I'm only testing it on things like notepad, solitaire and whatever else.
How it works is pretty simple. Where ever you have a shortcut, add insert the path to the executable instead. For instance, if you have a shortcut to C:\windows\notepad.exe then change the short cut so it reads "C:\program files\SavannahLion\O1G.exe" C:\windows\notepad.exe (I'm just picking paths out randomly :P )
Now if you click on it, notepad (or whatever) should appear. Click on the shortcut again, no new program should appear.
Some things to consider.
The program launches whatever you ask it and it waits until the application shuts down. This could give the appearance of "dead shortcuts" if the application should be minimized.
It's not very bright. If you create two shortcuts to two different applications using this wrapper, then launch one, the other will not launch at all.
I'm not sure of any timing issues. I thought about throwing up a splash screen to block your little tyke from pushing more buttons but that's up to err... maybe I'll make it a configurable option next time if people wish.
Once the VB app calls the application, it appears to go to sleep. But I didn't track it for any long term effects.
My Windows coding is a bit rusty and the code is embarrasingly sloppy. ::) This really should be written in something like C to keep the package size extremely small, but my Windows C skills are even rustier than my VB skills. :cry: :banghead:
As always, please run a virus scanner. I trust my PC, but I don't expect anyone else too.
I don't see an option to upload files here, so I guess I'll upload it to my project site server (http://www.vortigaunt.com/modules.php?name=Downloads&op=getit&lid=6).
-
wow, thanks for the effort on this! I'll give it a try. Thanks again!