Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Codes For VB6

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Mon Oct 29, 2007 6:10 pm    Post subject: Codes For VB6 Reply with quote

I will Be Updating adding more

How To Disable the "x" button
Code:
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Const MF_REMOVE = &H1000&
Private Sub Form_Load()
Dim hSysMenu As Long
Dim nCnt As Long

' First, show the form
Me.Show

' Get handle to our form's system menu
' (Restore, Maximize, Move, close etc.)
hSysMenu = GetSystemMenu(Me.hwnd, False)

If hSysMenu Then
' Get System menu's menu count
nCnt = GetMenuItemCount(hSysMenu)

If nCnt Then

' Menu count is based on 0 (0, 1, 2, 3...)

RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE

RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE ' Remove the seperator

DrawMenuBar Me.hwnd
' Force caption bar's refresh. Disabling X button

End If
End If
End Sub


How To Make a shutdown program:
Code:
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8
Const EWX_RESET = EWX_LOGOFF + EWX_FORCE + EWX_REBOOT

Private Sub Command1_Click()
    Dim X As Long
If Combo1.ListIndex = 0 Then ' If restart option is selected
    X = ExitWindowsEx(EWX_RESET, dwReserved)
ElseIf Combo1.ListIndex = 1 Then 'If Log off option is selected
    X = ExitWindowsEx(EWX_LOGOFF, dwReserved)
ElseIf Combo1.ListIndex = 2 Then 'If Shut down option is selected
    X = ExitWindowsEx(EWX_SHUTDOWN, dwReserved)
Else 'If Else

End If

End Sub

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites