Results 1 to 1 of 1

Thread: [vb.net 2003] problem on turning off the monitor

  1. #1

    Thread Starter
    Member frix199's Avatar
    Join Date
    Dec 2005
    Location
    Thessaloniki, Greece iamthebest: True
    Posts
    59

    Arrow [vb.net 2003] problem on turning off the monitor

    hey there!
    im trying to turn off my monitor using api, lots of vb6 examples found here.
    i tried to convert it to vb.NET, but it doesnt seem to work.
    please check it out and tell me if u got a clue

    VB Code:
    1. Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" _
    2. (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
    3. '
    4.  
    5.     Public Sub turnoffmonitor()
    6.         Const HWND_BROADCAST As Int32 = &HFFFFI
    7.         Const WM_SYSCOMMAND As Int32 = &H112
    8.         Const SC_MONITORPOWER As Int32 = &HF170
    9.  
    10.         SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 0&)
    11.     End Sub
    and yes, i DO know i am not good at translating vb6 to vb.net
    Last edited by Hack; Sep 15th, 2006 at 06:15 AM.


    Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.

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