[gimp] win: Group gimp windows together on the taskbar.



commit 3e0d10d860b560c1b61b66e1aa92abbb47838fe1
Author: Michael Henning <drawoc darkrefraction com>
Date:   Mon Aug 10 22:27:45 2015 -0400

    win: Group gimp windows together on the taskbar.
    
    The plug-ins and the main window used to be separate.

 app/main.c     |   11 +++++++++++
 libgimp/gimp.c |   11 +++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/app/main.c b/app/main.c
index 8e2e06a..4c61ef0 100644
--- a/app/main.c
+++ b/app/main.c
@@ -363,6 +363,17 @@ main (int    argc,
       (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
   }
 #endif
+
+  /* Group all our windows together on the taskbar */
+  {
+    typedef HRESULT (WINAPI *t_SetCurrentProcessExplicitAppUserModelID) (PCWSTR lpPathName);
+    t_SetCurrentProcessExplicitAppUserModelID p_SetCurrentProcessExplicitAppUserModelID;
+
+    p_SetCurrentProcessExplicitAppUserModelID = GetProcAddress (GetModuleHandle ("shell32.dll"),
+                                                                "SetCurrentProcessExplicitAppUserModelID");
+    if (p_SetCurrentProcessExplicitAppUserModelID)
+      (*p_SetCurrentProcessExplicitAppUserModelID) (L"gimp.GimpApplication");
+  }
 #endif
 
 #ifdef GIMP_UNSTABLE
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 9e70b53..b871909 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -307,6 +307,17 @@ gimp_main (const GimpPlugInInfo *info,
   }
 #endif
 
+  /* Group all our windows together on the taskbar */
+  {
+    typedef HRESULT (WINAPI *t_SetCurrentProcessExplicitAppUserModelID) (PCWSTR lpPathName);
+    t_SetCurrentProcessExplicitAppUserModelID p_SetCurrentProcessExplicitAppUserModelID;
+
+    p_SetCurrentProcessExplicitAppUserModelID = GetProcAddress (GetModuleHandle ("shell32.dll"),
+                                                                "SetCurrentProcessExplicitAppUserModelID");
+    if (p_SetCurrentProcessExplicitAppUserModelID)
+      (*p_SetCurrentProcessExplicitAppUserModelID) (L"gimp.GimpApplication");
+  }
+
   /* Check for exe file name with spaces in the path having been split up
    * by buggy NT C runtime, or something. I don't know why this happens
    * on NT (including w2k), but not on w95/98.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]