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: Help! Mala preventing Windows 7 from shutting down....  (Read 10134 times)

0 Members and 1 Guest are viewing this topic.

CrazyClimber2

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 18, 2012, 11:09:24 pm
Help! Mala preventing Windows 7 from shutting down....
« on: November 02, 2011, 10:28:49 am »

I have a cabinet I recently upgraded to Windows 7 and Mala from Windows XP and MameWah. I have a button on top of the the cab wired to the motherboard power switch, and Windows set to shutdown when it is pressed.  I use this to turn the cabinet off and on. Unfortunately with Mala, when I press the button, Windows says Mala is preventing Windows from shutting down, and Windows will not shutdown until I click either "Cancel" or "Force shut down".

I've tested pressing the power button while Mala is running on two other Windows 7 machines, and they behave exactly the same.

Anyone else run into this problem?  Anyone know how to prevent this from happening and allow Windows 7 to shutdown without first exiting Mala? I really would like to keep my cabinet powered off and on by the single power button.

Thanks in advance!


drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #1 on: November 02, 2011, 11:19:31 am »
Have you played around with the settings for exit?

Right click the main mala screen to get into the options, click the GUI tab, then MALA exit

You could try DISABLING the exit function (so the user can't actually manually exit MALA) but then also disable the Confirm Exit option.

You might have to play around with some of those options.

Alternately, you could allow the user to exit mala and when they do, you can configure mala to perform the shutdown.

CrazyClimber2

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 18, 2012, 11:09:24 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #2 on: November 02, 2011, 12:44:01 pm »

Yeah, I've tried playing with the exit settings in Mala, but no luck. Those settings only seem to control exiting via Mala, no via an OS initiated shutdown.

I thought about having Mala just do a shutdown on exit and mapping a key to a special button on the cabinet, but then I'd still have to have a separate button to turn on the cabinet.

Thanks for the ideas tho. Any others?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #3 on: November 02, 2011, 01:31:20 pm »
Hmmm. The only other thing I can think of that might work the way you're wanting it to is to write up a little utility program that starts when Mala is started.

it runs in the background and all it does is way for Windows to shut it down forcably (ie when you press the poweroff button and win7 runs through all the running applications telling them to shut down).

When this utility gets that signal to shutdown, it in turn just forces mala to shutdown via killprocess (there's tons of utilities out there that can forcibly kill a process).

That'd probably do it, but I haven't turned up a prebuilt solution for that.

Maybe you could put together am Autohotkey script for that?

CrazyClimber2

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 18, 2012, 11:09:24 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #4 on: November 02, 2011, 04:43:03 pm »

Wow, that's actually a very clever idea, however I think I'd probably change to another front-end before going that route and to all that trouble.

Thanks for all the ideas though. Still hoping there is a way to fix this issue, or a fix coming for it in the next version of Mala.
 

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #5 on: November 02, 2011, 06:14:52 pm »
Ok, how about this. Instead of wiring the button to the MB power switch, wire it to your IPAC (or keyboard encoder).

Then Setup a hotkey on a shortcut to run when that button is pressed.

I just tried this and it seemed to work for me.

Open a dos box
run mala
in the dos box, type SHUTDOWN /r

It popped a "windows is closing" message for 1 minute and then the machine shutdown, taking mala with it.

Looks like you can use

SHUTDOWN /s /t 1

to cause s shutdown (instead of restart) and only delay 1 second with no prompt.

CrazyClimber2

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 18, 2012, 11:09:24 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #6 on: November 02, 2011, 08:24:48 pm »

Yeah I'm sure that would work to shut things down, but I'm not sure I understand how you're saying I would turn the cabinet on, without having the motherboard power switch wired to a button. 

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #7 on: November 02, 2011, 08:48:31 pm »
Duh, Read right past that. What version of mala are you using?

CrazyClimber2

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 18, 2012, 11:09:24 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #8 on: November 03, 2011, 10:36:19 am »
I'm running 1.74 on my cabinet, although I tested 1.745 on another machine, and it also seems to suffer from this shutdown problem.  I'm surprised I've hardly seen anyone else around here with this issue. I'm thinking it may only exist with Mala under Windows 7.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #9 on: November 03, 2011, 10:54:48 am »
When I get some time later today, i'll give it a shot. I'll have to check my bios and windows to see how their set to handle the powerbutton.

chopperthedog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1049
  • Last login:Today at 03:59:36 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #10 on: December 24, 2012, 05:13:52 pm »
*bump* any one have an answer/work around for this. Pushing power button on cab to shutdown leaves me with the "This program is preventing windows from shutting down bla bla bla bla"


good day.

aza9999

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 9
  • Last login:February 26, 2013, 06:54:22 am
  • I want to build my own arcade controls!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #11 on: January 17, 2013, 03:37:05 am »
In the same basket with windows 7 and Mala preventing shutdown when i press the power button on my cab. Maximus arcade would exit cleanly when i pushed the power button and i'd love to have Mala able to do the same because i much prefer it's customisability in layout.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #12 on: January 17, 2013, 09:26:42 am »
One possibility is to use this command line

shutdown /f /s /t 0

Attach it to a hotkey and then, instead of hooking the remote button up to the power button, set it to that hotkey
not ideal, but it might be an alternative.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #13 on: January 17, 2013, 10:06:12 am »
Autohotkey can probably do this.

A quick google search turned this up:
http://www.autohotkey.com/board/topic/46320-script-to-play-a-sound-before-shutdown/
(the jasonbar in the thread is also a member here)

It doesn't pertain to Windows 7, but the concept is probably still possible.

Basically, it cancels the shutdown triggered by the power button press, then the script shuts down Mala and the PC.
I'd try to have it exit Mala properly.  Mala writes to mala.ini on exit.  If you just kill it, some changes you've made won't be saved and it won't be on the same gamelist and game that you left it on when you exited.

There are some autohotkey gurus in the Software forum on here.
I'd create a thread there asking how to accomplish this and one of them will probably help you out.

(It's a bit over my head.  I could probably figure it out given enough time, but it would take me more time than I have right now)

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #14 on: January 17, 2013, 10:46:33 am »
Badmouth's right. Unfortunately, it would appear that, for whatever reason, Mala isn't handling the WM_CLOSE or WM_QUIT messages quite right.

If an app doesn't respond to those messages properly, Windows will think it's intentionally not terminating because doing so would possibly damage files, loose data etc, so you get that "Force shutdown anyway" message.

Actually, the problem could be Mala, but it could also be a Mala Plugin, or some of the utility libs that mala uses (like the video player stuff). Basically, anything with a window has to properly handle those messages or the app will look like it can't be terminated at the moment.

loadman's the only one that could know for sure whether it's a mala thing and I believe he's been pretty busy with other things lately.


....

Just thinking. Another possibility is, believe it or not, a plugin for mala that watches for a terminate request and tells mala via it's api to shutdown. I KNOW the mala MALAMSG_EXIT request works. I've used it before.

I might have to give that a whirl. I've been up to my ears in Ruby stuff lately, would be nice to do a little .net stuff again.

chopperthedog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1049
  • Last login:Today at 03:59:36 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #15 on: January 17, 2013, 12:10:51 pm »
I still suffer from this and did before any plug-ins were added. I use "esc" as game start/end, so I hit power get the pop up and tap esc and cab shuts down (not ideal but works). I tried various registry edits and other crap but gave up. I'm too stupid for the script stuff unless it includes remedial instructions.


good day.

aza9999

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 9
  • Last login:February 26, 2013, 06:54:22 am
  • I want to build my own arcade controls!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #16 on: January 17, 2013, 02:31:57 pm »
For now i guess i'll just quit mala before powering down and hope it's addressed in a patch or plugin eventually. Maximus arcade isn't configurable enough with the interface and hyperspin is just far too much of a learning curve and too user unfriendly to bother learning.

Thanks for the info guys :)

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #17 on: June 05, 2013, 04:09:12 pm »
Hi,

I don't know if this is still an issue for other user or if there is a fix available,
but I got the same problem and was able to fix the 'shutdown while running" behaviour on Windows 7 with a small plugin called "Graceful Exit", attached here (binary *and* sourcecode). It hooks the MaLa window procedure and corrects the reaction to the shutdown events from the system.
I found also that if you try to 'logout' while MaLa is running, it will shutdown the PC. This is also fixed with the plugin.

Philip.

P.S: for some reason the MaLa API exit message (WM_USER + 70) does not work at all for me. I tried it also with a different program to send the message but got no reaction.

chopperthedog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1049
  • Last login:Today at 03:59:36 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #18 on: June 05, 2013, 06:59:03 pm »
Hi,

I don't know if this is still an issue for other user or if there is a fix available,
but I got the same problem and was able to fix the 'shutdown while running" behaviour on Windows 7 with a small plugin called "Graceful Exit", attached here (binary *and* sourcecode). It hooks the MaLa window procedure and corrects the reaction to the shutdown events from the system.
I found also that if you try to 'logout' while MaLa is running, it will shutdown the PC. This is also fixed with the plugin.

Philip.

P.S: for some reason the MaLa API exit message (WM_USER + 70) does not work at all for me. I tried it also with a different program to send the message but got no reaction.
Nice work! Tested on both my cabs that have win7. On my cocktail that uses servostiks along with the DaOldman's JoyChoose plugin and upon hitting power it pops a dialog box that wants to "save settings" and if I hit save it will power down but wipe out the joy stick plugin config in mala. I had better success on my Golden Tee cab that does not use any plugins, but noticed that with your plugin upon power down and start-up it goes to the last game played in the list. I understand that's the general behavior with mala when the "exit" command is used to go to last game that was highlighted in list. Just a couple observations, it's close though. I just wish mala acted the same way in 7 as it does in xp with regards to a power button push.


***back up your plugin configs before testing above file***



good day.

Gray_Area

  • -Banned-
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3363
  • Last login:June 23, 2013, 06:52:30 pm
  • -Banned-
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #19 on: June 07, 2013, 08:34:54 pm »
'Shutdown at exit' ALWAYS works on ALL my rigs. Did you change your button-to-OS settings before selecting that option in Mala?
-Banned-

chopperthedog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1049
  • Last login:Today at 03:59:36 pm
Re: Help! Mala preventing Windows 7 from shutting down....
« Reply #20 on: June 08, 2013, 04:26:18 pm »
'Shutdown at exit' ALWAYS works on ALL my rigs. Did you change your button-to-OS settings before selecting that option in Mala?
Main power button for cab is wired to mobo with setting in os to shutdown when power button is pressed. Plus I don't like admin buttons or shift functions on my cabs.


good day.