Вот что я собрал менее чем за 5 минут, чтобы изменить значок в определенном окне. Вы можете легко использовать этот код для создания winform, который будет перечислять открытые в настоящее время окна и позволить вам назначать им произвольные значки. (Код C# ниже)
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr FindWindow(string strClassName, string strWindowName);
[DllImport("user32.dll",CharSet=CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern int DrawMenuBar(int currentWindow);
const int WM_GETICON = 0x7F;
const int WM_SETICON = 0x80;
const int ICON_SMALL = 0; //16
const int ICON_BIG = 1; //32
public static void SetIcon()
{
//Load an icon. This has to be a *.ico.
System.Drawing.Icon i = new Icon("path\to\icon");
//Find the target window. The caption must be entered exactly
//as it appears in the title bar
IntPtr hwnd = FindWindow(null, "Caption of Target Window");
//Set the icon
SendMessage(hwnd, WM_SETICON, (IntPtr)ICON_SMALL, (IntPtr)i.Handle);
//Update the title bar with the new icon. Note: the taskbar will
//update without this, you only need this if you want the title
//bar to also display the new icon
DrawMenuBar((int)hwnd);
}
Любой, у кого есть более полутора десятков веб-сайтов, открыт в то же время, имеет серьезные проблемы с расстройством внимания, выбирает ваш любимый. – TravisO 2008-12-10 17:37:36
(Или, может быть, просто много ...) :-) – leeand00 2008-12-11 13:48:58