Page 1 of 6 123456 LastLast
Results 1 to 15 of 84

Thread: Utility to change behavior of ATX power button (e.g.: launch an app)

  1. #1
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695

    Utility to change behavior of ATX power button (e.g.: launch an app)

    I've been looking and looking, but can't find this. Does anyone know if there is a Windows utility (software) that will change the behavior of the hardware power button of the computer?

    What I envision is a util that will allow me to tie an application or script to the power button. Such that if I press the power button, it will launch the app (or execute the script).

    I'm sure you know why this is useful. Imagine how great it would be if when the Opus initiates a shutdown sequence (or hibernation sequence) throught the ATX power connector, it could launch a script INSTEAD! Then you could have your script do a number of things such as synchronize files, shutdown devices, etc. etc. and then at the end send a shutdown or hibernate command.

    The closest workaround I've seen is a utility (posted on this forum) that intercepts the hibernation sequence and allows you to launch an app/script, but the problem is that if the app you're launching takes more than 20 seconds to 'do its thing' then Windows forces it to close because it thinks the app has crashed.

    Any help finding something like this would eliminate a lot of headaches for a lot of people in this forum. Please post if you find anything.
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  2. #2
    MySQL Error MatrixPC's Avatar
    Join Date
    Sep 2003
    Location
    Beach City, Socal
    Posts
    4,053
    if you do a little search, you will find this app already.
    Run programs on hibernate/suspend and resume!
    2004 Matrix XR A7N8X-VM/400 AMD XP-M 2500+, DS-ATX
    89 Supra Turbo P3 600E@750/Abit BE6 II, Alpine M-BUS Car2PC.
    Y2K Accord Dell GX150
    RoadRunner is the best FE PERIOD
    EmoRebellion is a SCAMMER

  3. #3
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    If you do a little reading of my message above, you would know that:

    1)This is not what I am looking for, and
    2) My message above even refers to that specific utility on that thread, as the 'workaround' to what I want.

    I'm sick of the search Police. Especially the lousy ones.

    EDIT: Ok, OK... at least I give credit for trying to help me out Sorry for the initial burst of frustration.

    Quote Originally Posted by MatrixPC
    if you do a little search, you will find this app already.
    Run programs on hibernate/suspend and resume!
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  4. #4
    FLAC evandude's Avatar
    Join Date
    Mar 2005
    Location
    Maine
    Posts
    937
    Quote Originally Posted by justintime
    The closest workaround I've seen is a utility (posted on this forum) that intercepts the hibernation sequence and allows you to launch an app/script, but the problem is that if the app you're launching takes more than 20 seconds to 'do its thing' then Windows forces it to close because it thinks the app has crashed.
    matrix, that's exactly what he was talking about. and as he stated, that gives you a max of about 20 seconds to get all the stuff done. if you have file synchronization or something that will take longer, you're screwed.

    looks like we need some "at least read their post before you tell them to search" police around here to police the search police

    perhaps it would be easier to tie your script to something other than the actual power button... like a line on the serial port or parallel port or something. you could just connect the SDC to that instead of the power button pins on the mobo header. at most, it might require a couple resistors for interfacing... but you'd get easier access to it than you would with the power button (as you have seen)
    But don't take it from me! here's a quote from a real, live newbie:
    Quote Originally Posted by Viscouse
    I am learning buttloads just by searching on this forum. I've learned 2 big things so far: 1-it's been done before, and 2-if it hasn't, there is a way to do it.
    eegeek.net

  5. #5
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    Yeah, one solution I had in mind, was to wire the Opus to an IPAC device (a keyboard encoder), and program the IPAC input to be say, F10 key.

    Then simply assign F10 on the carputer to launch the script.

    But it is OVERKILL! I resist from doing that, even though I have 4 IPACs sitting on ym desk, with no intended use.

    Quote Originally Posted by evandude
    matrix, that's exactly what he was talking about. and as he stated, that gives you a max of about 20 seconds to get all the stuff done. if you have file synchronization or something that will take longer, you're screwed.

    looks like we need some "at least read their post before you tell them to search" police around here to police the search police

    perhaps it would be easier to tie your script to something other than the actual power button... like a line on the serial port or parallel port or something. you could just connect the SDC to that instead of the power button pins on the mobo header. at most, it might require a couple resistors for interfacing... but you'd get easier access to it than you would with the power button (as you have seen)
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  6. #6
    MySQL Error MatrixPC's Avatar
    Join Date
    Sep 2003
    Location
    Beach City, Socal
    Posts
    4,053
    Well, unlike most guys in this forum who always slap icon to every opportunity.
    That is one of the ultility that can be use, but things you want to do take longer than windows allow. My bad.
    I don' t think there is a software solution to what you want to do cuz the button is part of the ACPI spec which is implemented by the mobo. If there is software solution, it has to be part of the OS.
    The only solution is the hardware solution either thru com port and/or the SDC.
    2004 Matrix XR A7N8X-VM/400 AMD XP-M 2500+, DS-ATX
    89 Supra Turbo P3 600E@750/Abit BE6 II, Alpine M-BUS Car2PC.
    Y2K Accord Dell GX150
    RoadRunner is the best FE PERIOD
    EmoRebellion is a SCAMMER

  7. #7
    Raw Wave
    Join Date
    Jun 2004
    Location
    On the beach
    Posts
    2,223
    There is a way using the API to detect for the shutdown of a machine, cancel it, run some apps then reinitiate shutdown, I can't remember the exact API calls but it can't be too hard to find them.

  8. #8
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    That makes a ton of sense.

    Maybe one can use the suspend utility mentioned above, to run a script with the following instructions:

    <First, the suspend.exe detects the hibernation request, and it runs the script...>
    <script begins>
    a) Cancel the hibernation sequence (trick is, how to do this?!)
    b) run everything you want here
    c) Initiate a hibernation sequence command (must be an easy way to do this)
    <script ends>

    Any more seasoned scripters want to have a go at this?



    Quote Originally Posted by UK_MP3Car
    There is a way using the API to detect for the shutdown of a machine, cancel it, run some apps then reinitiate shutdown, I can't remember the exact API calls but it can't be too hard to find them.
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  9. #9
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    instead you could use code that just captures the hibernate message from windows...and in its routing to "prepare for hibernation" do the routine you are looking for. So i think all you need is the code that everyone uses to "survive" hibernation
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

  10. #10
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    a) invoking shutdown -a cancels hibernation, but i'm sure there is an api way to do it
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

  11. #11
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    nice!

    But I just tried a shutdown /? command for all the provided switches, and I came to realize this cancels a SHUTDOWN sequence. Maybe it does work with hibernation too?

    Also, doesn't seem like I can use this SHUTDOWN command to initiate a hibernation. but I know of several other command line utilities that allow you to do that. We're getting closer!

    EDIT: This utility can initiate a hibernation via command line:
    http://www.slawdog.com/products/smartsd/

    EDIT 2: Well, I went ahead and tried the whole setup, but sadly the shutdown -a command does not apply to hibernation. Otherwise, IT WOULD WORK. Anyone know of a way to cancel hibernation using command line utils?

    Quote Originally Posted by Peoples
    a) invoking shutdown -a cancels hibernation, but i'm sure there is an api way to do it
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  12. #12
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    Based on my research, it is easier to deal with intercepting/cancelling a shutdown sequence in Windows. SO at this point, I am pretty much convinced that the best approach is to set up Windows Power options to SHUT DOWN when the Opus sends a power button 'press', intercept the shutdown sequence (easy), run your script, and then send a hibernation command (easy)

    Thoughts?
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  13. #13
    Super Moderator xBrady's Avatar
    Join Date
    Apr 2004
    Location
    USA
    Posts
    3,687
    Quote Originally Posted by justintime
    Based on my research, it is easier to deal with intercepting/cancelling a shutdown sequence in Windows. SO at this point, I am pretty much convinced that the best approach is to set up Windows Power options to SHUT DOWN when the Opus sends a power button 'press', intercept the shutdown sequence (easy), run your script, and then send a hibernation command (easy)

    Thoughts?
    Yes that would be a way you could do it. If you wanted I could build something to do this pretty easily. Let me know exactly what you want (including any gui or setup) if you want me to make it. Would you mind if it was based on .NET or would you prefer not? I can do either way but .NET is easiest.
    AMD XP 2600+/512MB RAM/120GB hard drive
    Opus 150W/DVD/GPS/7" Lilliput TS/802.11g/Bluetooth
    Installed.


    -GPSSecure- - GPS Tracking
    -AltTabber2.2.2- - Handy touchscreen utility.

  14. #14
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    Hey, thanks for offering man.

    I did find a utility that performs the exact task I was looking for, it is this utility called ActiveExit XP. It does a whole lot more than what I need it to, and unfortunatley at a pretty heft price: $30, and almost 3 MB of RAM. (ouch!)

    Here is a screenshot of the configuration piece that allows you to run a command upon hibernation. I tested this today, and it will halt the hibernation sequence until the program that you configure to run has closed (even if it takes 1 hour to complete). So it works well.

    I would love to see something like this for less $$ (preferably freeware of course), but most importantly something that doesn't eat up all that memory -- certainly don't need all the extra features!

    Anyhow, something is out there, and it works. Not really sure we need to waste your (or anyone's) time in re-inventing the wheel. If you are really interested in coding it though, I am more than happy to provide some basic software specifications and requirements. (at least what I envision!)

    Thanks!


    Quote Originally Posted by xBrady
    Yes that would be a way you could do it. If you wanted I could build something to do this pretty easily. Let me know exactly what you want (including any gui or setup) if you want me to make it. Would you mind if it was based on .NET or would you prefer not? I can do either way but .NET is easiest.
    Attached Images Attached Images  
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90


    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music

  15. #15
    Super Moderator xBrady's Avatar
    Join Date
    Apr 2004
    Location
    USA
    Posts
    3,687
    Ya, if you want something I'll throw it together. Hopefully I can get around to it before your trial expires
    Let me know if you want it to just run in the background or if you want a system tray icon. Also let me know what other setup stuff you want.
    AMD XP 2600+/512MB RAM/120GB hard drive
    Opus 150W/DVD/GPS/7" Lilliput TS/802.11g/Bluetooth
    Installed.


    -GPSSecure- - GPS Tracking
    -AltTabber2.2.2- - Handy touchscreen utility.

Page 1 of 6 123456 LastLast

Similar Threads

  1. linking into laptop power button
    By corsamel in forum General Hardware Discussion
    Replies: 22
    Last Post: 04-23-2010, 04:53 AM
  2. Rewiring ATX power button
    By DCC in forum Power Supplies
    Replies: 10
    Last Post: 02-07-2008, 05:17 AM
  3. Replies: 7
    Last Post: 06-15-2004, 09:29 PM
  4. ATX board power??
    By Alphared in forum Power Supplies
    Replies: 9
    Last Post: 01-10-2003, 12:36 PM
  5. PC power button problem
    By BMp3W in forum Power Supplies
    Replies: 4
    Last Post: 10-12-2002, 02:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •