Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development


View Poll Results: Is this working for you?
Yes, I have Windows XP home 1 50.00%
No, I have Windows XP home 0 0%
Yes, I have Windows XP Pro 1 50.00%
No, Windows XP Pro 0 0%
Yes, I have Windows Vista 0 0%
No, I have Windows Vista 0 0%
Voters: 2. You may not vote on this poll

Reply
 
Share Thread Tools Display Modes
Old 05-30-2009, 11:07 AM   #16
Maximum Bitrate
 
Injector's Avatar
 
Join Date: Mar 2005
Location: Rockledge, FL
Posts: 517
Injector is on a distinguished road
you could always go pro
Injector is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 05-30-2009, 12:58 PM   #17
One Sharp Cheddar
 
ThunderStick's Avatar
 
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
ThunderStick is on a distinguished road
That may be the plan, I do have a copy of it. I just hate re-installing windows all the time.
I was thinking of just disabling any shutdown action at all when the power button is pressed and instead have a script to monitor my system power voltage. The idea is when the car turns off there is a power drop because the alternator is no longer charging. When detected a voltage drop below 12 volts for more than 1 minute it will fire the script and begin my personalized shutdown sequence.
I can set my PSU to kill the PC after 10 minutes which should give my computer plenty of time to shutdown and complete the script.
ThunderStick is offline   Reply With Quote
Old 05-30-2009, 01:30 PM   #18
Maximum Bitrate
 
colin's Avatar
 
Join Date: Dec 2006
Posts: 620
colin will become famous soon enoughcolin will become famous soon enough
It is not impossible. I havent checked this thread because I figured someone would have given an answer.

If any of you have some programming knowledge, trap Windows' messages! Windows tells each program to close nicely, and prior to Vista, the programs had an option as to whether or not they would shut down.

This caused problems because people would press shutdown and the computer would still be on 5 minutes later before they realized that something went wrong!

From MSDN:
Quote:
"The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.

After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message

__________________
2001 Mustang Convertible Worklog
Indigo Custom Frontend (Flash/Delphi)
Blog

Code:
Currently: - Working on my new product! Wiring: |■■■■■■■■■■■■■■■■■■--| Trunk: |■■■-----------------| Sound: |■■■■■■--------------| Screen: |■■■■■■--------------|

colin is offline   Reply With Quote
Old 05-30-2009, 07:22 PM   #19
Mod - Driveline forum
 
ClockWorK's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 82
ClockWorK is on a distinguished road
That was my plan.. but I've been busy with work. Looking into it now while my wife is on the Wii Fit.
ClockWorK is offline   Reply With Quote
Old 05-30-2009, 08:15 PM   #20
One Sharp Cheddar
 
ThunderStick's Avatar
 
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
ThunderStick is on a distinguished road
If someone can create a solution for my it would be greatly appreciated. I am getting pretty good with AutoIT but anyother type of program is still greek to me..
ThunderStick is offline   Reply With Quote
Old 05-30-2009, 09:21 PM   #21
Mod - Driveline forum
 
ClockWorK's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 82
ClockWorK is on a distinguished road
Smile Try this

I whipped up an app. It's called PBTintercept. It's just an EXE file and an INI file. It runs silently (find it's process in taskmanager to kill it). It intercepts the shutdown message, and cancels it. Then it runs the specified EXE and waits until that EXE is terminated, or can be set to only wait for a predetermined amount of time. Lastly, the app issues a shutdown command. I've tested it. It works for me. I hope this works on the first try.

VB.Net 2008 souce code is included. I was going to try to detect suspend and hibernate, and go further with this program, but my XP laptop has issues, so testing this is a pain..

From what I read, this app will NOT work in Windows Vista or Windows 7.


Here's what the ini looks like:

[OnShutdown]
Runapp=c:\windows\system32\notepad.exe
RuncmdLine=
MaxWaitSecs=0



Let me know how it goes.
Attached Files
File Type: zip PBTintercept_App.zip (15.6 KB, 18 views)
File Type: zip PBTintercept_Source.zip (105.1 KB, 9 views)
ClockWorK is offline   Reply With Quote
Old 05-31-2009, 03:32 AM   #22
Maximum Bitrate
 
colin's Avatar
 
Join Date: Dec 2006
Posts: 620
colin will become famous soon enoughcolin will become famous soon enough
Hibernate and Resume is as simple as WM_POWERBROADCAST and then check the wParam (I believe) for PBT_APMRESUMESUSPEND or PBT_APMSUSPEND
__________________
2001 Mustang Convertible Worklog
Indigo Custom Frontend (Flash/Delphi)
Blog

Code:
Currently: - Working on my new product! Wiring: |■■■■■■■■■■■■■■■■■■--| Trunk: |■■■-----------------| Sound: |■■■■■■--------------| Screen: |■■■■■■--------------|

colin is offline   Reply With Quote
Old 05-31-2009, 08:19 AM   #23
Mod - Driveline forum
 
ClockWorK's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 82
ClockWorK is on a distinguished road
PBT_APMRESUMESUSPEND and PBT_APMSUSPEND will detect hibernate/resume and suspend/resume, but I wanted to differentiate between suspend and hibernate. I figured it would be in the wParam or lParam, but I didn't see the information anywhere, and the original poster was only looking to detect shutdown, so I just let it go with that.


The front-end I wrote (DriveLine -- check it out) detects hibernate/resume just fine. But it doesn't need to know the difference between suspend and hibernate.
ClockWorK is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 05-31-2009, 08:42 AM   #24
One Sharp Cheddar
 
ThunderStick's Avatar
 
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
ThunderStick is on a distinguished road
Thumbs up

Quote: Originally Posted by ClockWorK View Post
I whipped up an app.
...
Let me know how it goes.

WORKS AWSOME
ThunderStick is offline   Reply With Quote
Old 05-31-2009, 08:56 AM   #25
Mod - Driveline forum
 
ClockWorK's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 82
ClockWorK is on a distinguished road
Cool

Now THAT makes me smile.

As soon as I saw the post that said it was impossible, I knew I'd have to do it.
ClockWorK is offline   Reply With Quote
Old 05-31-2009, 10:17 AM   #26
One Sharp Cheddar
 
ThunderStick's Avatar
 
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
ThunderStick is on a distinguished road
I knew if I said it was impossible someone would be trying pretty hard to prove me wrong..
"Mamma allways said that nothin' is impossible"
ThunderStick is offline   Reply With Quote
Old 05-31-2009, 11:47 AM   #27
Maximum Bitrate
 
colin's Avatar
 
Join Date: Dec 2006
Posts: 620
colin will become famous soon enoughcolin will become famous soon enough
Nicely done, that's pretty sly

The only reason I knew anything about the ARM commands was because my frontend now also supports hibernate/resume, and similar to yours, ClockWork, doesn't need to know the difference.
__________________
2001 Mustang Convertible Worklog
Indigo Custom Frontend (Flash/Delphi)
Blog

Code:
Currently: - Working on my new product! Wiring: |■■■■■■■■■■■■■■■■■■--| Trunk: |■■■-----------------| Sound: |■■■■■■--------------| Screen: |■■■■■■--------------|

colin is offline   Reply With Quote
Old 06-05-2009, 09:08 PM   #28
Low Bitrate
 
Cycfari's Avatar
 
Join Date: Nov 2006
Location: N1 22.921 E103 54.207
Posts: 56
Cycfari is an unknown quantity at this point
Thanks for this great app for my current problem! Basically I need to close RR/Winamp first before the PC does a shutdown so that the last VST presets will be saved. Now i'll have to try & create a bat file or find a exe command to close RR.

Last edited by Cycfari; 06-05-2009 at 09:11 PM.
Cycfari is offline   Reply With Quote
Old 06-06-2009, 08:56 AM   #29
Mod - Driveline forum
 
ClockWorK's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 82
ClockWorK is on a distinguished road
I think you can write a BAT to do what you need with the TASKLIST and TASKKILL commands.

It's a little tricky, but not impossible.
ClockWorK is offline   Reply With Quote
Old 06-06-2009, 09:01 AM   #30
Mod - Driveline forum
 
ClockWorK's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 82
ClockWorK is on a distinguished road
On second thought, TASKKILL might kill the apps without letting them save their settings. It's worth a try, but might not be the right solution.
ClockWorK is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2008 Yaris 4 Door Sedan PC Install rizaydog Show off your project 55 05-21-2009 08:03 AM
Utility to change behavior of ATX power button (e.g.: launch an app) justintime Software & Software Development 83 05-08-2009 05:45 PM
2007 Ford Fusion Carputer (version 2.0) FusionFanatic Show off your project 43 04-20-2009 05:56 PM
DC-DC Car Power for Mac Mini MikeH MacCar 53 02-19-2005 01:13 PM
I want to add a power button on my dash. Which can i use? Sonicxtacy02 General Hardware Discussion 2 10-25-2004 04:17 PM



All times are GMT -5. The time now is 02:08 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics