1.概要
アプリケーションの仕様上、タスクバーが非常に邪魔な時がありました。
その為、表示、非表示の制御を行うようにしました。
制御はWIN32APIから行います。
2.スクリプト
Public Declare Auto Function FindWindow Lib "USER32.DLL" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr Public Declare Auto Function ShowWindow Lib "USER32.DLL" (ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean Private Const SW_SHOW As Integer = 5 Private Const SW_HIDE As Integer = 0 Private hwnd As IntPtr = FindWindow("Shell_TrayWnd", vbNullString) Public Sub tskBarHide() ShowWindow(hwnd, SW_HIDE) End Sub Public Sub tskBarDisp() ShowWindow(hwnd, SW_SHOW) End Sub
[DllImport("USER32.DLL", CharSet = CharSet.Auto)] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("USER32.DLL", CharSet = CharSet.Auto)] public static extern IntPtr ShowWindow(IntPtr hWnd, int nCmdShow); private static int SW_SHOW = 5; private static int SW_HIDE = 0; private IntPtr hwnd = FindWindow("Shell_TrayWnd", null); public void tskBarHide() { ShowWindow(hwnd, SW_HIDE); } public void tskBarDisp() { ShowWindow(hwnd, SW_SHOW); }