Thread: Auto shutdown of crashed program...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    15

    Auto shutdown of crashed program...

    Hi All,

    Firstly thanks for all your help over the past couple of years - much appreciated.
    My current problem is this: I run a VNC server on my PC, and it's not terribly stable. So every so often, it crashes leaving me with the standard "Application has performed an illegal operation" and sometimes gives me the opportunity to bebug in VC++.

    I would like to write a program that will find the appropriate buttons on the dialog boxes and press them, such that the program is closed down and cleared away, ready for me to restart it (eg. with the system command).

    Since if I'm using VNC, that implies I won't be at the console, so I can't press the buttons myself. I don't need to auto-detect when something goes wrong - I can trigger the program manually, remotely.

    Any suggestions appreciated. If there's a better way than simulating button presses etc, I'd be glad to hear it.

    Thanks all,

    Phil

  2. #2
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Look up the mouse_event() function. That can simulate a mouseclick anywhere on the screen. You can use EnumWindows() and then EnumChildWindows() to find the button you want. Then use GetWindowRect() to get its exact coordinates.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 10:58 PM
  2. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  3. hOW TO MAKE A PROGRAM WHICH MAKES MY pC TO SHUTDOWN?
    By ALANAIR23 in forum Windows Programming
    Replies: 9
    Last Post: 09-01-2001, 01:27 AM
  4. shutdown program in c++
    By alanair23 in forum C++ Programming
    Replies: 5
    Last Post: 08-26-2001, 09:06 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM