using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace TaskbarSwitch
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("coredll.dll")]
private static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll")]
internal extern static int EnableWindow(int hwnd, int fEnable);
[DllImport("coredll.dll")]
public static extern int ShowWindow(int hwnd, int nCmdShow);
private void Form1_Load(object sender, EventArgs e)
{
//屏蔽系统任务栏
int hTaskBarWnd = FindWindow("HHTaskBar", null);
ShowWindow(hTaskBarWnd, 0);
this.Size = new Size(240, 240);
}
private void Form1_Closed(object sender, EventArgs e)
{
//屏蔽系统任务栏
int hTaskBarWnd = FindWindow("HHTaskBar", null);
ShowWindow(hTaskBarWnd, 1);
}
}
}
相关文章:
- WinCE隐藏任务栏 2021-07-24
- vc任务栏隐藏 2022-12-23
- C#显示及隐藏任务栏 2022-12-23
- 显示和隐藏系统任务栏的类 2021-12-23
- C#实现系统托盘,C#窗体最小化时隐藏为任务栏图标 2022-12-23
- winfrom 隐藏任务栏(win7) 2021-11-30
- 隐藏/显示任务栏 2022-01-02
- 隐藏,显示任务栏 2021-12-23