Parsi Coders

نسخه‌ی کامل: سورس کد خاموش کردن مانیتور Vb6
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
کد:
'=========================================================================
' =========== Paste the lines below into a standard module ===============

Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long

Const SC_MONITORPOWER = &HF170&
Const MON_OFF = 2&
Const WM_SYSCOMMAND = &H112


Private Sub procTurnOff()

  SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MON_OFF

End Sub


'Now you can call the above procedure using a command button , say cmdTurnOff

'==============Add this code to the command button=======================

Private Sub cmdTurnOff_Click()

Call procTurnOff

End Sub

'====================End=================================================