c#怎么隐藏任务栏

来源:百度知道 编辑:UC知道 时间:2024/05/28 12:37:38
注意是在程序运行时隐藏任务栏,而不是程序图标在任务栏中不可见。请不要把没有测试的代码发上来 谢谢
额 求救啊 是像系统自带的那样隐藏 不是直接屏蔽 ~谢谢提供啊 不过2楼我的是2005 我怎么发现你的那个方法任务栏不是隐藏而是被你用大屏遮挡了 不是我要的啊

简单的,去下面看吧,刚给你写的

http://www.zu14.cn/2009/03/13/csharp-show-hide-taskbar-by-api/

效果:点击button1程序完全全屏(包括任务栏的位置),点击button2程序还原。
打开vs2005或2008,新建一个窗口form1,在窗口上加入两个按钮button1和button2。然后打开form1.cs,将下列代码复制进去。
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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
private const int SW_HIDE = 0;
private const int SW_SHOW = 1;
[DllImport("user32.dll")]
private static extern int FindWindow(string className, string windowText);
[DllImport("user32.dll")]
private static extern int Sh