Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal ProcessID As Long, ByVal ServiceFlags As Long) As Long Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long'请你试试 Ctrl+Alt+Del 是不是你的程序隐藏了Private Sub Command1_Click() dim i as long i = RegisterServiceProcess(GetCurrentProcessId, 1) End Sub
从属性窗口中设定 me.Windowstate=2 me.maxButton=false
隐藏和显示任务栏 任务栏一般是显示在窗口的最底下,但有时我们需要隐藏它。 声明: Dim hWnd1 As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Const SWP_HIDEWINDOW = &H80 Const SWP_SHOWWINDOW = &H40 隐藏的例子: hWnd1 = FindWindow("Shell_traywnd", "") Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW) 显示的例子: Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long'请你试试 Ctrl+Alt+Del 是不是你的程序隐藏了Private Sub Command1_Click()
dim i as long
i = RegisterServiceProcess(GetCurrentProcessId, 1)
End Sub
me.Windowstate=2
me.maxButton=false
声明:
Dim hWnd1 As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
隐藏的例子:
hWnd1 = FindWindow("Shell_traywnd", "")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
显示的例子:
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
设置 Form1.ShowInTaskbar=false