Results 1 to 3 of 3

Thread: Turn monitor on [Please Help]

  1. #1

    Thread Starter
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Turn monitor on [Please Help]

    Hi,

    I'm not sure if this is the correct category.

    I am trying to find some code which will allow me to turn the monitor on, when it is in standby mode.

    This is for a network administrator, who needs a remote administration project which i'm working on.

    this is for vb6

    Thanks for any reply

  2. #2

    Thread Starter
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Turn monitor on [Please Help]

    This has been resolved now, I used an API that forces a keydown, which makes the monitor wake up.

    Thanks anyway

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Turn monitor on [Please Help]

    Since random keypressings can do funny things, the best way is to use the pure API method

    VB Code:
    1. Declare Function SendMessage Lib "user32" Alias "SendMessageW" ( _
    2.     ByVal hWnd As Long, _
    3.     ByVal uMsg As Long, _
    4.     ByVal wParam As Long, _
    5.     ByRef lParam As Any _
    6. ) As Long
    7.  
    8. Const HWND_BROADCAST = &HFFFF
    9. Const WM_SYSCOMMAND = &H112
    10. Const SC_MONITORPOWER = &HF170
    11.  
    12. ' Turn monitor on
    13. SendMessage HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal -1&
    14.  
    15. ' Turn monitor off
    16. SendMessage HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal 0&

Posting Permissions

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



Click Here to Expand Forum to Full Width