(1) I want to make my program run at startup. I did that step:
I added my program path to that registry key:
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run [Or]
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
Previously, the program was running at startup but after I have added the Manifest File to give my program the administrative privileges as follow:
Since that action, the program doesn't run at startup.
Finally, the code which adds the value to Software\\Microsoft\\Windows\\CurrentVersion\\Run
:
// Set launch at startup setting
bool startup = wxAtoi(CPublic::getConfigItem("settings/startup"));
wxString appName = wxTheApp->GetAppName();
wxRegKey regKey(wxRegKey::HKCU, "Software\\Microsoft\\Windows\\CurrentVersion\\Run");
if (startup == 1) {
regKey.SetValue(appName, wxStandardPaths::Get().GetExecutablePath());
} else {
regKey.DeleteValue(appName);
}
What's the problem then?
(2) There is another simple question related to that question:
How to make my program hides after running at startup into the system tray?