c# 获取当前系统所有窗口句柄含任务栏托盘图标等 完整源码下载.docx
- 文档编号:12403524
- 上传时间:2023-06-05
- 格式:DOCX
- 页数:41
- 大小:47.59KB
c# 获取当前系统所有窗口句柄含任务栏托盘图标等 完整源码下载.docx
《c# 获取当前系统所有窗口句柄含任务栏托盘图标等 完整源码下载.docx》由会员分享,可在线阅读,更多相关《c# 获取当前系统所有窗口句柄含任务栏托盘图标等 完整源码下载.docx(41页珍藏版)》请在冰点文库上搜索。
c#获取当前系统所有窗口句柄含任务栏托盘图标等完整源码下载
【核心代码】
usingSystem;
usingSystem.Drawing;
usingSystem.Collections;
usingSystem.ComponentModel;
usingSystem.Windows.Forms;
usingSystem.Runtime.InteropServices;
usingSystem.Security.Permissions;
usingSystem.Reflection;
usingSystem.Globalization;
usingSystem.Diagnostics;
usingCommon;
namespaceTaskbarSorter
{
///
///SummarydescriptionforForm1.
///
publicclassForm1:
System.Windows.Forms.Form
{
privateSystem.Windows.Forms.Buttonbutton1;
privateSystem.Windows.Forms.ToolBartoolBar1;
privateSystem.Windows.Forms.TreeListViewtreeListView1;
privateSystem.Windows.Forms.ColumnHeadercolumnHeader1;
privateSystem.ComponentModel.IContainercomponents;
privateSystem.Windows.Forms.ColumnHeadercolumnHeader2;
privateSystem.Windows.Forms.ColumnHeadercolumnHeader3;
privateSystem.Windows.Forms.ColumnHeadercolumnHeader4;
privateSystem.Windows.Forms.ToolBarButtontoolBarButtonMoveFirst;
privateSystem.Windows.Forms.ToolBarButtontoolBarButtonMoveUp;
privateSystem.Windows.Forms.ImageListimageListToolbar;
privateSystem.Windows.Forms.ToolBarButtontoolBarButtonMoveDown;
privateSystem.Windows.Forms.ToolBarButtontoolBarButtonMoveLast;
privateSystem.Windows.Forms.Button_Apply;
privateSystem.Windows.Forms.Button_ViewTree;
privateSystem.Windows.Forms.Button_ExpandAll;
privateSystem.Windows.Forms.Button_CollapseAll;
privateSystem.Windows.Forms.ImageListimageListTreeView;
privateSystem.Windows.Forms.Button_Repair;
privateSystem.Windows.Forms.ToolTip_ToolTips;
privateIcon_Icon=null;
privatebool_FirstActivation=true;
privateITree_Tree=NodeTree.NewTree(typeof(DataBase));
privateIntPtr_ToolbarWindowHandle=IntPtr.Zero;
privatebool_Glomming=true;
publicForm1()
{
string[]a=Assembly.GetEntryAssembly().GetManifestResourceNames();
Trace.WriteLine("\nResourceNames:
");
foreach(stringsina)Trace.WriteLine("\t" s);
Trace.WriteLine("");
InitializeComponent();
}
protectedoverridevoidOnHandleCreated(EventArgse)
{
base.OnHandleCreated(e);
UInt32hIcon=User32.GetClassLong(Handle,GCL.HICONSM);
if(hIcon==0)
{
if(_Icon==null)_Icon=newIcon(typeof(Form1),"Icons.App.ico");
User32.SetClassLong(Handle,GCL.HICONSM,(UInt32)_Icon.Handle);
}
}
///
///Cleanupanyresourcesbeingused.
///
protectedoverridevoidDispose(booldisposing)
{
if(disposing)
{
if(components!
=null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
#regionWindowsFormDesignergeneratedcode
///
///RequiredmethodforDesignersupport-donotmodify
///thecontentsofthismethodwiththecodeeditor.
///
privatevoidInitializeComponent()
{
ponents=newSystem.ComponentModel.Container();
System.Resources.ResourceManagerresources=newSystem.Resources.ResourceManager(typeof(Form1));
this.button1=newSystem.Windows.Forms.Button();
this.toolBar1=newSystem.Windows.Forms.ToolBar();
this.toolBarButtonMoveFirst=newSystem.Windows.Forms.ToolBarButton();
this.toolBarButtonMoveUp=newSystem.Windows.Forms.ToolBarButton();
this.toolBarButtonMoveDown=newSystem.Windows.Forms.ToolBarButton();
this.toolBarButtonMoveLast=newSystem.Windows.Forms.ToolBarButton();
this.imageListToolbar=newSystem.Windows.Forms.ImageList(ponents);
this.treeListView1=newSystem.Windows.Forms.TreeListView();
this.columnHeader1=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader2=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader3=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader4=newSystem.Windows.Forms.ColumnHeader();
this.imageListTreeView=newSystem.Windows.Forms.ImageList(ponents);
this._Apply=newSystem.Windows.Forms.Button();
this._ViewTree=newSystem.Windows.Forms.Button();
this._ExpandAll=newSystem.Windows.Forms.Button();
this._CollapseAll=newSystem.Windows.Forms.Button();
this._Repair=newSystem.Windows.Forms.Button();
this._ToolTips=newSystem.Windows.Forms.ToolTip(ponents);
this.SuspendLayout();
//
//button1
//
this.button1.FlatStyle=System.Windows.Forms.FlatStyle.System;
this.button1.Location=newSystem.Drawing.Point(8,32);
this.button1.Name="button1";
this.button1.TabIndex=1;
this.button1.Text="Refresh";
this.button1.Click =newSystem.EventHandler(this.button1_Click);
//
//toolBar1
//
this.toolBar1.Appearance=System.Windows.Forms.ToolBarAppearance.Flat;
this.toolBar1.Buttons.AddRange(newSystem.Windows.Forms.ToolBarButton[]{
this.toolBarButtonMoveFirst,
this.toolBarButtonMoveUp,
this.toolBarButtonMoveDown,
this.toolBarButtonMoveLast});
this.toolBar1.DropDownArrows=true;
this.toolBar1.ImageList=this.imageListToolbar;
this.toolBar1.Location=newSystem.Drawing.Point(0,0);
this.toolBar1.Name="toolBar1";
this.toolBar1.ShowToolTips=true;
this.toolBar1.Size=newSystem.Drawing.Size(592,28);
this.toolBar1.TabIndex=0;
this.toolBar1.ButtonClick =newSystem.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
//toolBarButtonMoveFirst
//
this.toolBarButtonMoveFirst.ImageIndex=0;
this.toolBarButtonMoveFirst.ToolTipText="MoveFirst";
//
//toolBarButtonMoveUp
//
this.toolBarButtonMoveUp.ImageIndex=1;
this.toolBarButtonMoveUp.ToolTipText="MoveUp";
//
//toolBarButtonMoveDown
//
this.toolBarButtonMoveDown.ImageIndex=2;
this.toolBarButtonMoveDown.ToolTipText="MoveDown";
//
//toolBarButtonMoveLast
//
this.toolBarButtonMoveLast.ImageIndex=3;
this.toolBarButtonMoveLast.ToolTipText="MoveLast";
//
//imageListToolbar
//
this.imageListToolbar.ImageSize=newSystem.Drawing.Size(16,16);
this.imageListToolbar.ImageStream=((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListToolbar.ImageStream")));
this.imageListToolbar.TransparentColor=System.Drawing.Color.Transparent;
//
//treeListView1
//
this.treeListView1.AllowColumnReorder=true;
this.treeListView1.Anchor=((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top|System.Windows.Forms.AnchorStyles.Bottom)
|System.Windows.Forms.AnchorStyles.Left)
|System.Windows.Forms.AnchorStyles.Right)));
this.treeListView1.Columns.AddRange(newSystem.Windows.Forms.ColumnHeader[]{
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4});
this.treeListView1.HideSelection=false;
this.treeListView1.Location=newSystem.Drawing.Point(8,64);
this.treeListView1.MultiSelect=false;
this.treeListView1.Name="treeListView1";
this.treeListView1.Size=newSystem.Drawing.Size(572,392);
this.treeListView1.SmallImageList=this.imageListTreeView;
this.treeListView1.Sorting=System.Windows.Forms.SortOrder.None;
this.treeListView1.TabIndex=6;
this.treeListView1.DoubleClick =newSystem.EventHandler(this.treeListView1_DoubleClick);
//
//columnHeader1
//
this.columnHeader1.Text="Process/Window";
this.columnHeader1.Width=300;
//
//columnHeader2
//
this.columnHeader2.Text="Windows";
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- c# 获取当前系统所有窗口句柄含任务栏托盘图标等 完整源码下载 获取 当前 系统 所有 窗口 句柄 任务栏 托盘 图标 完整 源码 下载