19,502
社区成员
发帖
与我相关
我的任务
分享
using System.Runtime.InteropServices;
//Imports Microsoft.VisualBasic
class hideshowtask
{
const int SW_HIDE = 0x0;
const int SW_SHOW = 0x1;
public int Hwnd;
[DllImport("Coredll.dll")]
private int FindWindow(string lpClassName, string lpWindowName)
{
}
[DllImport("Coredll.dll")]
private bool EnableWindow(int hwnd, int fEnable)
{
}
[DllImport("Coredll.dll")]
private bool ShowWindow(int hwnd, int nCmdShow)
{
}
void showtaskbar()
{
// Try
Hwnd = FindWindow("HHTaskBar", null);
ShowWindow(Hwnd, SW_SHOW);
// EnableWindow(Hwnd, True)
// Catch 'ex As Exception
// End Try
}
void hidetaskbar()
{
// Try
Hwnd = FindWindow("HHTaskBar", null);
ShowWindow(Hwnd, SW_HIDE);
// EnableWindow(Hwnd, False)
// Catch ' ex As Exception
// End Try
}
}
Public Declare Function ShowWindow Lib "coredll.dll" (ByVal hwnd As IntPtr, ByVal nCmdShow As Integer) As Integer
Dim htask As IntPtr = FindWindow("HHTaskBar", Nothing)
ShowWindow(htask, SW_HIDE)
Dim htask As IntPtr = FindWindow("HHTaskBar", Nothing)
ShowWindow(htask, SW_SHOWNORMAL)
Public Declare Function FindWindow Lib "coredll.dll" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
int iWidth = GetSystemMetrics(SM_CXSCREEN);
int iHeight = GetSystemMetrics(SM_CYSCREEN);
::SetWindowPos(this->m_hWnd, HWND_TOPMOST, 0, 0, iFullWidth, iFullHeight, SWP_NOOWNERZORDER | SWP_SHOWWINDOW);
HWND hTaskBar;
hTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL);
::ShowWindow(hTaskBar, SW_HIDE);