Skip to content

Conversation

@SHMAKET
Copy link

@SHMAKET SHMAKET commented Feb 17, 2025

main.c: Implemented automatic application restart registration on unexpected termination, along with debug messages confirming successful registration. These modifications address the issue where the program would sometimes close unexpectedly.

<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, thanks for PR!

We don't want to bump the toolset version so the program code will remain compile-able for Windows XP...

// with the same command-line arguments as originally provided.
// Windows will only restart the application if it terminates unexpectedly.
// If the user closes the application normally, no restart will occur.
HRESULT hr = RegisterApplicationRestart(L"", 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...And, from what I've read, RegisterApplicationRestart function has only been implemented since Vista.

So, there should also be some sort of check whether it is available to link or not (otherwise it will probably crash on XP right after starting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants