|
|
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% |
 |
|
05-30-2009, 11:07 AM
|
#16
|
|
Maximum Bitrate
Join Date: Mar 2005
Location: Rockledge, FL
Posts: 517
|
you could always go pro
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
05-30-2009, 12:58 PM
|
#17
|
|
One Sharp Cheddar
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
|
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.
|
|
|
05-30-2009, 01:30 PM
|
#18
|
|
Maximum Bitrate
Join Date: Dec 2006
Posts: 620
|
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
|
|
|
05-30-2009, 07:22 PM
|
#19
|
|
Mod - Driveline forum
Join Date: Oct 2003
Location: Michigan
Posts: 82
|
That was my plan.. but I've been busy with work. Looking into it now while my wife is on the Wii Fit.
|
|
|
05-30-2009, 08:15 PM
|
#20
|
|
One Sharp Cheddar
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
|
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..
|
|
|
05-30-2009, 09:21 PM
|
#21
|
|
Mod - Driveline forum
Join Date: Oct 2003
Location: Michigan
Posts: 82
|
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.
|
|
|
05-31-2009, 03:32 AM
|
#22
|
|
Maximum Bitrate
Join Date: Dec 2006
Posts: 620
|
Hibernate and Resume is as simple as WM_POWERBROADCAST and then check the wParam (I believe) for PBT_APMRESUMESUSPEND or PBT_APMSUSPEND
|
|
|
05-31-2009, 08:19 AM
|
#23
|
|
Mod - Driveline forum
Join Date: Oct 2003
Location: Michigan
Posts: 82
|
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.
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
05-31-2009, 08:42 AM
|
#24
|
|
One Sharp Cheddar
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
|
Quote: Originally Posted by ClockWorK 
I whipped up an app.
...
Let me know how it goes.
WORKS AWSOME  
|
|
|
05-31-2009, 08:56 AM
|
#25
|
|
Mod - Driveline forum
Join Date: Oct 2003
Location: Michigan
Posts: 82
|
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.
|
|
|
05-31-2009, 10:17 AM
|
#26
|
|
One Sharp Cheddar
Join Date: Aug 2006
Location: West Allis, WI
Posts: 1,558
|
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"
|
|
|
05-31-2009, 11:47 AM
|
#27
|
|
Maximum Bitrate
Join Date: Dec 2006
Posts: 620
|
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.
|
|
|
06-05-2009, 09:08 PM
|
#28
|
|
Low Bitrate
Join Date: Nov 2006
Location: N1 22.921 E103 54.207
Posts: 56
|
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.
|
|
|
06-06-2009, 08:56 AM
|
#29
|
|
Mod - Driveline forum
Join Date: Oct 2003
Location: Michigan
Posts: 82
|
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.
|
|
|
06-06-2009, 09:01 AM
|
#30
|
|
Mod - Driveline forum
Join Date: Oct 2003
Location: Michigan
Posts: 82
|
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.
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:08 PM.
| |