هل هناك أي طريقة لتغيير رمز شريط المهام المتصفح في ويندوز؟
-
21-08-2019 - |
سؤال
هل هناك أي طريقة لتغيير رمز شريط المهام المتصفح في ويندوز؟
وI فتح الكثير من نوافذ المتصفح، وأود أن مجموعة مواقع مماثلة (في علامات التبويب) من خلال النافذة. لذلك أنا أتساءل عما اذا كان هناك طريقة لتعيين رمز شريط المهام لهم بحيث يمكنك التفريق بسهولة بين لهم.
المحلول
وهنا شيء لقد وضعت في أقل من 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);
}
نصائح أخرى
وأعتقد أن تستخدم شريط المهام والموارد رمز جزءا لا يتجزأ من تنفيذ. حاولت إنشاء اختصارات متعددة إلى Internet Explorer، ولكل منها رمز اختصار فريدة من نوعها، ولكن كان لديهم كل نفس الرمز عندما فتحت على شريط المهام.
وكنت أعتقد أن لديك لتشغيل مثيلات متعددة من تنفيذ المتصفح، وسيكون لكل لديك مورد رمز جزءا لا يتجزأ مختلفة.