1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Rep Power

    Can this be done?

    I have a KVMA switch for 4 computers. Only three are in use. 2 x Windows and 1 x Mac OSX.

    I have all three to sleep after 30 minutes of no activity. To wake any of them up, it doesn't matter which one I hit the power button of first, the Mac computer starts first on the KVMA switch. This isn't a problem for me.

    The problem is that the Shared Monitor show the correct resolution for the Mac but both the windows computers come up in 640 x 400 resolution. They all have Radeon ATI Graphics cards.

    I right click on the screen, select Screen Resolution ---> Detect and the monitor resets to the correct resolution.

    What I want to do is write some code, somehow, (Delphi or CBuilder) or maybe even a script or a macro that as soon as the computer wakes it executes the Resolution --> Detect and sets the screen to the correct resolution without needing manual interference.

    Anyone got ideas on how to do this?
  2. #2
  3. Lord of the Dance
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Oct 2003
    Rep Power
    On Windows? Maybe you can find some kind of a VB script to execute at windows wake up.

    For reference, you can see if this wil get you started:
    Run a script when Windows resumes from suspend/hibernate state? - Super User
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Woodland Hills, Los Angeles County, California, USA
    Rep Power
    You can call RegisterPowerSettingNotification() and tell it to call back your program on windows wakeup. Then, in your callback handler, call EnumDisplayDevices() to get a list of display devices, then call EnumDisplaySettings() on each display device to see if it is at the lower resolution or not, and if it is at low res, then call ChangeDisplaySettingsEx() function if needed.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo