zoukankan      html  css  js  c++  java
  • 隐藏/显示任务栏

      /// <summary>
            /// Retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search.
            /// </summary>
            /// <param name="lpClassName">The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
    ///If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.
    ///If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter.</param>
            /// <param name="lpWindowName">The window name (the window's title). If this parameter is NULL, all window names match.</param>
            /// <returns></returns>
            [DllImport("user32.dll")]
            public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
            /// <summary>
            /// Sets the specified window's show state.
            /// </summary>
            /// <param name="hwnd">A handle to the window.</param>
            /// <param name="nCmdShow">Controls how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values.</param>
            /// <returns></returns>
            [DllImport("user32.dll")]
            public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
           
            private const int SW_HIDE = 0;
            private const int SW_RESTORE = 9;
            private void btnHide_Click(object sender, EventArgs e)
            {
                ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE); 
            }
    
            private void btnShow_Click(object sender, EventArgs e)
            {
                ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);
            }
  • 相关阅读:
    委托-张子扬博客
    委托-雾中人博客
    委托基础
    C# 字典
    相机标定目的<3>
    相机标定程序详解<2>
    相机标定 <1>
    Opencv 几何变换<9>
    Opencv ROI<8>
    Opencv 通道分离合并<7>
  • 原文地址:https://www.cnblogs.com/wjshan0808/p/4233973.html
Copyright © 2011-2022 走看看