changeset 2125:37758cfed67b

Win: Move the fallback AppID creation above _dw_edge_detect() call.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 25 Jun 2020 00:59:32 +0000
parents f9a2fc59611c
children 97839ff3c985
files win/dw.c
diffstat 1 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Thu Jun 25 00:38:37 2020 +0000
+++ b/win/dw.c	Thu Jun 25 00:59:32 2020 +0000
@@ -4431,6 +4431,22 @@
       exit(1);
    }
 
+    if(!_dw_app_id[0])
+    {
+        /* Generate an Application ID based on the PID if all else fails. */
+        snprintf(_dw_app_id, 100, "%s.pid.%d", DW_APP_DOMAIN_DEFAULT, getpid());
+    }
+    if(!_dw_app_name[0])
+    {
+       /* If we still don't have an app name, get the executable name */
+       char fullpath[261] = {0}, *pos;
+       GetModuleFileNameA(DWInstance, fullpath, 260);
+       pos = strrchr(fullpath, '\\');
+       if(pos)
+          pos++;
+       strncpy(_dw_app_name, pos ? pos : fullpath, 100);
+    }
+    
 #if (defined(BUILD_DLL) || defined(BUILD_HTML))
    /* Register HTML renderer class */
    memset(&wc, 0, sizeof(WNDCLASS));
@@ -4498,21 +4514,6 @@
          hrichedit = LoadLibrary(TEXT("riched32"));
    }
 #endif
-    if(!_dw_app_id[0])
-    {
-        /* Generate an Application ID based on the PID if all else fails. */
-        snprintf(_dw_app_id, 100, "%s.pid.%d", DW_APP_DOMAIN_DEFAULT, getpid());
-    }
-    if(!_dw_app_name[0])
-    {
-       /* If we still don't have an app name, get the executable name */
-       char fullpath[261] = {0}, *pos;
-       GetModuleFileNameA(DWInstance, fullpath, 260);
-       pos = strrchr(fullpath, '\\');
-       if(pos)
-          pos++;
-       strncpy(_dw_app_name, pos ? pos : fullpath, 100);
-    }
 #ifdef BUILD_TOAST
    _dw_toast_init(UTF8toWide(_dw_app_name), UTF8toWide(_dw_app_id));
 #endif