# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1593046772 0 # Node ID 37758cfed67be4f48ed301d1beff1257a6721838 # Parent f9a2fc59611cc427f70af49b07c12dc346d59aa2 Win: Move the fallback AppID creation above _dw_edge_detect() call. diff -r f9a2fc59611c -r 37758cfed67b win/dw.c --- 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