X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinjump.c;h=85963a32fff23cc319b0ae910cc1d2514b439118;hb=bf00bcd2a4fee0855567b62cff83a0006c7c3232;hp=e5bca9358ead86ddb74a8c48c7b138afe9842486;hpb=c5ce372a361bc4f68aa74fae92bec60e981830ec;p=PuTTY.git diff --git a/windows/winjump.c b/windows/winjump.c index e5bca935..85963a32 100644 --- a/windows/winjump.c +++ b/windows/winjump.c @@ -714,3 +714,33 @@ void remove_session_from_jumplist(const char * const sessionname) clear_jumplist(); } } + +/* Set Explicit App User Model Id to fix removable media error with + jump lists */ + +BOOL set_explicit_app_user_model_id() +{ + DECL_WINDOWS_FUNCTION(static, HRESULT, SetCurrentProcessExplicitAppUserModelID, + (PCWSTR)); + + static HMODULE shell32_module = 0; + + if (!shell32_module) + { + shell32_module = load_system32_dll("Shell32.dll"); + GET_WINDOWS_FUNCTION(shell32_module, SetCurrentProcessExplicitAppUserModelID); + } + + if (p_SetCurrentProcessExplicitAppUserModelID) + { + if (p_SetCurrentProcessExplicitAppUserModelID(L"SimonTatham.PuTTY") == S_OK) + { + return TRUE; + } + return FALSE; + } + /* Function doesn't exist, which is ok for Pre-7 systems */ + + return TRUE; + +}