Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Huge, huge problem.  (Read 8640 times)

0 Members and 1 Guest are viewing this topic.

Chukka

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:January 28, 2021, 04:28:30 pm
Re: Huge, huge problem.
« Reply #40 on: October 14, 2009, 04:41:26 am »
How do you get them to run at startup?

EDIT: Actually I found something called XYNTService. That should do the trick.
« Last Edit: October 14, 2009, 05:53:02 am by Chukka »

njay

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 466
  • Last login:February 08, 2022, 06:49:35 am
  • To Nudge or Not to Nudge !
Re: Huge, huge problem.
« Reply #41 on: October 14, 2009, 06:48:46 am »
use instantsheller from the gameex website under utilities

it even makes your mouse go away and you can add a new boot screen
Mini Pinball Project [Finished]:
http://forum.arcadecontrols.com/index.php?topic=98826.0

Cab Convert To HyperSpin [Sold due to Move]
http://forum.arcadecontrols.com/index.php?topic=101535.0

New Project - Bartop [Planning Stage]
http://forum.arcadecontrols.com/index.php?topic=105894

smalltownguy

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 924
  • Last login:February 13, 2023, 10:48:26 am
Re: Huge, huge problem.
« Reply #42 on: October 14, 2009, 07:03:04 am »
speaking of boot screens, I thought I'd share my 'winners don't use drugs' bitmap

Man, will my cab EVER be finished?

Finchbyrd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:November 08, 2009, 06:03:22 pm
Re: Huge, huge problem.
« Reply #43 on: October 14, 2009, 08:11:15 am »
Fantatic! Thanks for the logo. I'll add it to the folder of images that boot randomly with bootskin.

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #44 on: October 19, 2009, 12:04:52 am »
Coming to this party late, but my $0.02:
PS--on Windows XP Pro, I was able to right click on the desktop & follow through a few buttons & such till I found an option to hide all desktop icons.  Strangely, I can't find it on my Win XP Home on my laptop... :dizzy:


Re-found it.  It's also on Windows XP home.  Very easy to do--don't recall if it's documented around here...

Simply right-click on your desktop, select Arrange Icons By, then uncheck Show Desktop Icons in the list.

Simple.

Wonder why Microsoft didn't put this in the Display control panel next to the spot where you can define which system icons show & what the icons look like...


Oh, since MaLa crashes on me every now & then, I want to have just 1 obvious MaLa shortcut on my desktop for users to find & launch.  The only thing that I couldn't turn off was the Recycle Bin, so I simply replaced the empty & full recycle bin icons w/ blank ones & turned off Auto Arrange of my desktop icons & just dragged it way down to the bottom right of the screen, where the icon was hidden & the "Recycle Bin" text is off the screen.

Hooray. 8)

Thanks,
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #45 on: October 19, 2009, 02:53:34 pm »
If you want to make it simpler, you could have a script running in the background to detect if MALA is running.  If it isn't, then have the script launch MALA.  You might need some kind of a timer to make sure it doesn't run when you are starting up (so you would have 2 instances).  Anyway, just a thought to simplify if you can't figure out why it crashes.

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #46 on: October 19, 2009, 02:57:45 pm »
That's a wonderful idea, because I realized that the desktop shows long enough during boot that the user would have the opportunity to launch that icon before MaLa launched itself, therefore having 2 instances of MaLa running.


Assuming that I know absolutely nothing about scripts, how would I possibly go about making such a script?

Thanks,
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #47 on: October 19, 2009, 03:12:16 pm »
www.autohotkey.com or www.autoitscript.com/autoit3/

If you can manually do something on the computer, you can use AHK or AI to automate it!  I use AHK, but AI is just as good with slightly different syntax from what I understand.  You should check out the "SetTimer" and the "Process" AHK functions.  I would expect this to only be a few lines of code.  If you are familiar with any kind of coding, you should be able to pick either of these codes up very quickly.  I could code something up right quick, but then you wouldn't have the fun.   :cheers:

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #48 on: October 19, 2009, 04:01:57 pm »
Thanks--this should probably help w/ my gyrations necessary to launch both MaLa & CPWizard upon launch & getting focus back to MaLa!

I've downloaded AutoHotkey & started simple programming.

Using the Run, Sleep, & WinActivate commands, I can launch MaLa & CPWizard & then put focus back to MaLa after X seconds, when CPWizard is done launching.

2 questions:

1 - Can I just use the AutoHotkey.ahk default script & shell my PC to jump right into AutoHotkey.exe (and it will, by default, run that script)?  Then I have full control over launching my applications & delays & window focus...

2 - How can I program AutoHotkey to recognize the difference between MaLa crashing (and wanting to restart MaLa right away) and me manually closing MaLa to get into Explorer & do some work on the cab?  I suppose I could also hold down a hard-to-reach key when I exit from MaLa & AutoHotkey could look for that keystroke & decide if it should restart MaLa or not?


Thanks--very cool program...but I don't know if I'd define it as "fun"... :laugh:
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #49 on: October 19, 2009, 05:00:14 pm »
You can use the sleep and winactivate commands if you want and use the script for startup directly (windows seems to be able to use AHK scripts as startup/shutdown scripts just fine as that's what I do).  To do that, just point windows to the .ahk file and you'll be golden (alternately, compile the script to an exe).

As for crashes vs manual killing MALA, perhaps you could close the script on exiting MALA.  That shouldn't run if MALA crashes...only if it exits gracefully.  Of course, if you launch MALA again, you won't have the script running already.  So, you might want to make the monitoring portion part of a script that launches when MALA starts.

Lots of ways to do it and none are wrong!

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #50 on: October 21, 2009, 01:10:49 am »
Master Kenobi-

You have taught me how to fish.  I thank you.  AutoHotKey is a swell program & this here mechanical engineer re-discovered the joy of simple programming (after I'd re-discovered the joy of making a .CMD file a while back...).

Below is my AutoHotKey file that is in My Documents & that launches when I set C:\Program Files\AutoHotKey\AutoHotKey.exe to be my shell in RegEdit.

Works like a charm.  I haven't yet had a MaLa crash to test it, but when I use Windows Task Manager to close MaLa rudely, it behaves as I wish.

This kills many birds with 1 stone: solves my CPWizard-steals-focus-from-MaLa problem, solves my EmuWave-MaLa-plugin-start-and-exit-sounds-get-clipped problem, lets me get back into not loading explorer.exe as my shell, & pops MaLa back up on-screen in the event of a crash (which I haven't yet been able to create on purpose, of course...for me, MaLa often is sensitive to too much mouse/keyboard activity in the first second or so after game exit & MaLa return).



Only one little item that I'd love to be able to implement.  As you can see, I have a fun video game "close" sound play upon intentional or unintentional close of MaLa.  That works great.  But, under normal usage, the user will tap the PC's power button to shut down Windows & the PC altogether.  My .AHK script doesn't trigger the fun sound when somebody shuts down the PC.  AutoHotKey has a Shutdown command, but that is to trigger a Shutdown, not to detect a shutdown & do something.  Any ideas here for some icing to spread upon this tasty cake?


Thanks!   :cheers:
-Learner Jason



; Launch MaLa & CPW, ensure MaLa focus, play random start & end sounds w/out clipping


; launch CPWizard minimized
run, C:\program files\cpwizard\cpwizard.exe -minimized


; generate random #...set high value to # of files in start sound directory, name all files #.wav
random, startsound, 1, 15

; play random start sound
soundplay, c:\emulators\mala\Sound-MaLa_Start\%startsound%.wav, wait



; launch MaLa
run, C:\emulators\mala\mala.exe

; make sure MaLa exists before continuing
winwait, MaLa

; as soon as MaLa loses focus, get it back
winwaitnotactive, MaLa
winactivate, MaLa


;Loop to monitor if MaLa closes
monitormala:


; wait for MaLa to close (intentionally or not)
winwaitclose, MaLa


;Check for MaLa close while holding down Exit Code Key
getkeystate, state, F10
if state = D
{
  ; generate random #...set 2nd # to # of files in exit sound directory, name all files #.wav
  random, exitsound, 1, 11

  ; play random exit sound
  soundplay, c:\emulators\mala\Sound-MaLa_Exit\%exitsound%.wav, wait

  ; launch Windows Explorer
  run, explorer

  ; exit script
  exit
}


;If MaLa exits w/out Exit Code Key...
else
{
  ; generate random #...set 2nd # to # of files in exit sound directory, name all files #.wav
  random, exitsound, 1, 11

  ; play random exit sound
  soundplay, c:\emulators\mala\Sound-MaLa_Exit\%exitsound%.wav, wait

  run, C:\emulators\mala\mala.exe

  winwait, MaLa
  winactivate, MaLa

  goto, monitormala
}
« Last Edit: October 21, 2009, 01:13:50 am by jasonbar »

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #51 on: October 21, 2009, 01:13:13 am »
PS--Chukka, sorry for any thread hijack--I don't think we've gone too too far off-topic, as we're still talking about methods of shelling & such...   ;D

Thanks,
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #52 on: October 21, 2009, 02:53:25 pm »
Are you trying to play the shutdown sound before windows shuts down?  If so, I'm sure there's a way to play a sound in AHK (just haven't tried before...beeps, yes...sound files, no).

Ahhh, ok.  If that's what you want to do, try the "SoundPlay" command.  The syntax is:

SoundPlay, Filename [, wait]

So, pick the filename then specify a wait time prior sending the shutdown command.

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #53 on: October 21, 2009, 03:15:06 pm »
Thanks, but that's not quite it.  I'm already using the SoundPlay command extensively (when launching MaLa or when MaLa closes without all of Windows shutting down).

So, the catch is being able to *detect* a shutdown that's occurring because somebody physically pushed the power button on the PC & play a sound before/during the actual shutdown.

I don't think AHK can do that.  It's certainly not detecting a MaLa window close when all of Windows is shutting down.

Thanks,
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #54 on: October 21, 2009, 03:53:52 pm »
Ahhh, I glanced at the code, but didn't read it thoroughly.  I see what you are saying and it should be possible to detect a shutdown.  Look at the OnMessage function in the documentation.  There is even an example of how to do a detection of shutdown.  Now, I don't know if there is a way to differentiate HOW Windows is shut down.  Perhaps you could ask that question on the AHK forums though.  They are VERY helpful when provided with a well thought out question that's supported by sufficient information.

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #55 on: October 22, 2009, 01:57:55 am »
Thanks-

I spent the better part of today on this program.   :-[

Barked up lots of wrong trees...trees that were aaaalmost the right tree...

Finally got help at the AutoHotKey forum: xxxxxxxxxxxx


My final scripts, for reference:

AutoHotKey (launches as my Windows XP shell instead of explorer):

; Launch MaLa & CPW, ensure MaLa focus, play random start & end sounds w/out clipping

; run shutdown monitor script
run, C:\Documents and Settings\Customer\My Documents\shutdownmonitor.ahk

; launch CPWizard minimized
run, C:\program files\cpwizard\cpwizard.exe -minimized


; generate random #...set high value to # of files in start sound directory, name all files #.wav
random, startsound, 1, 20

; play random start sound
soundplay, c:\emulators\mala\Sound-MaLa_Start\%startsound%.wav, wait


;Loop to launch MaLa & monitor if MaLa closes
monitormala:


; launch MaLa
run, C:\emulators\mala\mala.exe

; make sure MaLa exists before continuing
winwait, MaLa

; as soon as MaLa loses focus, get it back
sleep, 1000  ; had to have a short pause here or regaining focus wouldn't work...
winwaitnotactive, MaLa
winactivate, MaLa


; wait for MaLa to close (intentionally or not)
winwaitclose, MaLa


;Check for MaLa close while holding down Exit Code Key
getkeystate, state, F10
if state = D
{
  ; generate random #...set 2nd # to # of files in exit sound directory, name all files #.wav
  random, exitsound, 1, 16

  ; play random exit sound
  soundplay, c:\emulators\mala\Sound-MaLa_Exit\%exitsound%.wav, wait

  ; launch Windows Explorer
  run, explorer

  ; exit script
  exit
}


;If MaLa exits w/out Exit Code Key...
else
{
  ; generate random #...set 2nd # to # of files in exit sound directory, name all files #.wav
  random, exitsound, 1, 11

  ; play random exit sound
  soundplay, c:\emulators\mala\Sound-MaLa_Exit\%exitsound%.wav, wait

  goto, monitormala
}




And here's the concise shutdown monitor that detects shutdown & plays a sound & then shuts down.  The only catch is that it can't distinguish between a restart from the Start Menu & a shutdown from the PC case button.  Oh well...

shutdownmonitor.ahk:

#singleinstance ignore

SetTimer, soundoff, Off

OnMessage(0x11, "powerbutton")
Return

powerbutton(wParam, lParam)
{
    SetTimer, soundoff, On
    Return false ; abort shutdown
}


soundoff:
  SetTimer, soundoff, Off

  ; generate random #...set 2nd # to # of files in exit sound directory, name all files #.wav
  random, exitsound, 1, 16

  ; play random exit sound
  soundplay, c:\emulators\mala\Sound-MaLa_Exit\%exitsound%.wav, wait

  Shutdown,5

  ExitApp

Return



Phew.  Done!   :cheers:


Thanks,
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #56 on: October 22, 2009, 12:13:39 pm »
Nice work!  Isn't it satisfying coding it yourself rather than having someone else do it for you.   :cheers:

Btw, I didn't know about OnMessage to start with, so this has been informative for me too!

jasonbar

  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2252
  • Last login:July 17, 2025, 07:40:40 pm
  • Dr. Inferno
    • The Infernolab
Re: Huge, huge problem.
« Reply #57 on: October 23, 2009, 03:15:11 pm »
Glad you learned something too!  Yah, it's satisfying to figure it out myself, but it's also been a big time-sink for me while I fuss with it.  :]

Also, I had a big scare where I foolishly edited the script incorrectly so that it would simply shut down my PC as soon as the script launched, & I have my main script as my shell & the first thing it does is call the shutdownmonitor script, so I simply got a power-down every time I booted.  =(  Safe mode didn't work, as it was still shelling to my main script.  Then I discovered a "safe mode with command prompt" option.  Phew!   :dizzy:


Anyway, a little further discussion & code optimization/explanation at the AHK forum: http://www.autohotkey.com/forum/viewtopic.php?p=304698


Thanks,
-Jason

bkenobi

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:August 16, 2021, 10:41:52 pm
Re: Huge, huge problem.
« Reply #58 on: October 23, 2009, 03:33:13 pm »
Yeah, that would be pretty scary.  I would have been all over google for that one!

BamBam

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 283
  • Last login:November 03, 2011, 07:18:19 am
  • This is better than Disney Land man!
Re: Huge, huge problem.
« Reply #59 on: November 01, 2009, 12:15:30 am »
First and foremost...  Try updating the title of this topic.  Can you be any more generic?

Perhaps you will get a greater response when you are specific in what you need help with.

Just a thought.

D

Eat ####.

Thanks everyone else for their help. The CD drive wasn't working because the power wire wasn't connected properly. I got it working and used the XP CD to rebuild the boot.ini. The boot.bmp was the problem. Got it working now.

Thanks to all the helpful people except Delusional and BamBam.

Chucka,

My bad.  I should have thrown a  ;) in with my comment.  Chill out and have fun.
Galaga... Was there any other game?