有没有办法能够将所有窗体的标题栏图标一起修改了
一个一个的修改太麻烦了
一个一个的修改太麻烦了
解决方案 »
- visual studio 2008英文版 卸载问题
- 一个新手的很水的问题
- MasterPage以及继承该母版页的页面都要用到UpdatePannel
- 求一用户控件,picturebox和label的组合,开发平台:vs2005,C#.
- 网络图像监控系统 麻烦 大大们 给个参考价格~
- [求解]URL中的汉字编码问题...不清楚....
- 如何删除一个string变量中的中文字
- 请教:object error
- #######编程菜鸟的简单问题求过路的大哥大姐指点#######
- C# 非阻塞式通信方式
- 求助,极坐标转换为平面直角坐标,连点描线,哪儿出错了呢 ?
- 写了一个自动关闭窗口的小程序 大家试试
遍历所有窗体public delegate bool EnumWindowsProc(IntPtr p_Handle, int p_Param);
[DllImport("user32.dll")]
public static extern int EnumWindows(EnumWindowsProc ewp, int lParam);
[DllImport("User32.dll", CharSet = CharSet.Auto)]
public static extern int GetWindowText(IntPtr hWnd, out STRINGBUFFER text, int nMaxCount);
[DllImport("user32.dll")]
public static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern IntPtr GetWindowThreadProcessId(IntPtr hwnd, ref int lpdwProcessId);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct STRINGBUFFER
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string szText;
} private void button1_Click(object sender, EventArgs e)
{
MessageWindwos();
} public void MessageWindwos()
{ EnumWindowsProc _EunmWindows = new EnumWindowsProc(NetEnumWindows);
EnumWindows(_EunmWindows, 0);
}
private bool NetEnumWindows(IntPtr p_Handle, int p_Param)
{
if (!IsWindowVisible(p_Handle))return true; STRINGBUFFER _TitleString = new STRINGBUFFER();
GetWindowText(p_Handle, out _TitleString, 256); MessageBox.Show(_TitleString.szText); ///获取的窗体
return true;
}
{
this.Icon = new Icon("d:\\1.ico");
}运行时在打开窗体时自动更换图标