OpenProcessToken hdlProcessHandle, (TOKEN_ADJUST_PRIVILEGES Or _ TOKEN_QUERY), hdlTokenHandle
' Get the LUID for shutdown privilege.
LookupPrivilegeValue "", "SeShutdownPrivilege", tmpLuid
tkp.PrivilegeCount = 1 ' One privilege to set
tkp.TheLuid = tmpLuid tkp.Attributes = SE_PRIVILEGE_ENABLED
' Enable the shutdown privilege in the access token of this process.
AdjustTokenPrivileges hdlTokenHandle, False, _ tkp, Len(tkpNewButIgnored), tkpNewButIgnored, lBufferNeeded
End Sub
Public Sub ShutDown() AdjustToken ExitWindowsEx (EWX_SHUTDOWN), &HFFFF End Sub
Public Sub ReStart()
AdjustToken ExitWindowsEx (EWX_FORCE), &HFFFF
End Sub
Public Sub ReBooT() AdjustToken ExitWindowsEx (EWX_REBOOT), &HFFFF End Sub Source Code Bell Otomatis Update Ke-3
Dim db As Connection
Dim Con1, Con2 As Recordset Dim List As Variant Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Private Declare Function GetActiveWindow Lib "user32" () As Long Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long Dim wHandler As Long Dim fShortName As String, TrackLength As String * 60 Dim a As Integer, cou As Integer Dim tt As Boolean Option Explicit
Public Function GetShortName(ByVal sLongFileName As String) As String
Dim lRetVal As Long Dim sShortPathName As String Dim iLen As Integer 'Set up buffer area for API function cal ' l return sShortPathName = Space(255) iLen = Len(sShortPathName) 'Call the function lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen) 'Strip away unwanted characters. GetShortName = Left(sShortPathName, lRetVal) End Function
Sub Pesan()
TaskDialog.Reset TaskDialog.CommonButtons = 0 TaskDialog.WindowTitle = "Informasi" TaskDialog.MainIcon = xtpTaskIconInformation TaskDialog.MessageBoxStyle = True TaskDialog.EnableCommandLinks = True TaskDialog.FooterText = "Programmer Wawan Supriadi" & Chr(13) & "Wulansoft° Soft Computindo" & Chr(13) & "Tahun 2010" TaskDialog.FooterIcon = xtpTaskIconShield
End Sub
Sub Buka()
Combo1.Locked = False PT1.Locked = False PT2.Locked = False ME1.Enabled = True
End Sub