- 143 Views
- 03/10/2024
Phần mềm Ẩn Desktop, Taskbar, Open Notepad bằng VB6
Sau đây là hướng dẫn Lập trình code VB6 (Visual Bacsic 6.0) với phần mềm hệ thống:
- Nội dung phần mềm: ẩn Hide Desktop, ẩn Taskbar, và mở một phần mềm trong hệ thống có sẵn trong windows như Calc.exe hay Notepad.exe,....
- Đầu tư ta mở 01 standard EXE, kéo tạo 01 TabStrip, tạo 03 Checkbox và 01 command nội dung EXIT để thoát app
- Kèm theo có File hệ thống: WinLockDll.dll
Code như sau:
Option Explicit
' Functions inside the DLL
Private Declare Function Desktop_Show_Hide Lib "WinLockDll.dll" (ByVal bShowHide As Boolean) As Integer
Private Declare Function StartButton_Show_Hide Lib "WinLockDll.dll" (ByVal bShowHide As Boolean) As Integer
Private Declare Function Taskbar_Show_Hide Lib "WinLockDll.dll" (ByVal bShowHide As Boolean) As Integer
Private Declare Function Clock_Show_Hide Lib "WinLockDll.dll" (ByVal bShowHide As Boolean) As Integer
Private Declare Function Process_Desktop Lib "WinLockDll.dll" (ByVal szDesktopName As String, ByVal szPath As String) As Integer
Private Declare Function Keys_Enable_Disable Lib "WinLockDll.dll" (ByVal bEnableDisable As Boolean) As Integer
Private Declare Function AltTab1_Enable_Disable Lib "WinLockDll.dll" (ByVal bEnableDisable As Boolean) As Integer
Private Declare Function AltTab2_Enable_Disable Lib "WinLockDll.dll" (ByVal hWnd As Long, ByVal bEnableDisable As Boolean) As Integer
Private Declare Function TaskSwitching_Enable_Disable Lib "WinLockDll.dll" (ByVal bEnableDisable As Boolean) As Integer
Private Declare Function TaskManager_Enable_Disable Lib "WinLockDll.dll" (ByVal bEnableDisable As Boolean) As Integer
Private Declare Function CtrlAltDel_Enable_Disable Lib "WinLockDll.dll" (ByVal bEnableDisable As Boolean) As Integer
Private Sub Form_Load()
Me![Hide].Visible = True
End Sub
Private Sub Exit_Click()
' Enable everything before quitting
Desktop_Show_Hide (True)
StartButton_Show_Hide (True)
Taskbar_Show_Hide (True)
Clock_Show_Hide (True)
Keys_Enable_Disable (True)
AltTab1_Enable_Disable (True)
AltTab2_Enable_Disable 0, True
TaskSwitching_Enable_Disable (True)
TaskManager_Enable_Disable (True)
CtrlAltDel_Enable_Disable (True)
' Close app
Unload MainFrm
End Sub
Private Sub Tab_Click()
If Me![Tab].SelectedItem = "Hide" Then
Me![Hide].Visible = True
Else
Me![Hide].Visible = False
End If
End Sub
Private Sub Hide_Desktop_Click()
If Me![Hide_Desktop] Then
Desktop_Show_Hide (False)
Else
Desktop_Show_Hide (True)
End If
End Sub
Private Sub Hide_StartButton_Click()
If Me![Hide_StartButton] Then
StartButton_Show_Hide (False)
Else
StartButton_Show_Hide (True)
End If
End Sub
Private Sub Hide_Taskbar_Click()
If Me![Hide_Taskbar] Then
Taskbar_Show_Hide (False)
Else
Taskbar_Show_Hide (True)
End If
End Sub
Private Sub Hide_SystemClock_Click()
If Me![Hide_SystemClock] Then
Clock_Show_Hide (False)
Else
Clock_Show_Hide (True)
End If
End Sub
Private Sub Hide_DeskProcess_Click()
If Me![Hide_DeskProcess] Then
Process_Desktop "MyDesktop2", "Notepad.exe"
Else
End If
End Sub
Private Sub Disable_AltTab1_Click()
If Me![Disable_AltTab1] Then
AltTab1_Enable_Disable (False)
Else
AltTab1_Enable_Disable (True)
End If
End Sub
Private Sub Disable_AltTab2_Click()
If Me![Disable_AltTab2] Then
AltTab2_Enable_Disable 0, False
Else
AltTab2_Enable_Disable 0, True
End If
End Sub
Private Sub Disable_TaskSwitching_Click()
If Me![Disable_TaskSwitching] Then
TaskSwitching_Enable_Disable (False)
Else
TaskSwitching_Enable_Disable (True)
End If
End Sub
Private Sub Disable_TaskMgr_Click()
If Me![Disable_TaskMgr] Then
TaskManager_Enable_Disable (False)
Else
TaskManager_Enable_Disable (True)
End If
End Sub
Private Sub Disable_CtrlAltDel_Click()
If Me![Disable_CtrlAltDel] Then
CtrlAltDel_Enable_Disable (False)
Else
CtrlAltDel_Enable_Disable (True)
End If
End Sub
- Theo ý tưởng của Antonio Feijao trên diễn đàn: codeproject.com
Tải APP về test: https://drive.google.com/file/d/1aOjVQzxFlR3NtIAouiVqFLOmSDmAtF3b