From 429187c6a8816e6df73f69530d0641ac0dcc514e Mon Sep 17 00:00:00 2001 From: sirius-m Date: Sat, 3 Oct 2009 11:52:21 +0000 Subject: [PATCH] Startup folder shortcut opens the program minimized. Restoring a minimized-to-tray window works correctly. git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@12 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- bugs.txt | 1 - ui.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bugs.txt b/bugs.txt index 0f00111e94..f990b67a3c 100644 --- a/bugs.txt +++ b/bugs.txt @@ -1,3 +1,2 @@ Known bugs: -- When the program is minimized to tray, double clicking the icon only restores it to the task bar - Window flickers when blocks are added (problem with repainting?) \ No newline at end of file diff --git a/ui.cpp b/ui.cpp index e69630d398..e7be55da3c 100644 --- a/ui.cpp +++ b/ui.cpp @@ -3002,6 +3002,7 @@ void CBitcoinTBIcon::OnMenuRestore(wxCommandEvent&) { void CBitcoinTBIcon::Restore() { pframeMain->Show(); + pframeMain->Iconize(false); pframeMain->Raise(); if (!alwaysShowTrayIcon) Hide(); @@ -3296,6 +3297,9 @@ bool CMyApp::OnInit2() taskBarIcon = new CBitcoinTBIcon(); ApplyUISettings(); + if (mapArgs.count("/min") && minimizeToTray) { + pframeMain->Iconize(true); + } return true; } @@ -3408,6 +3412,7 @@ void ApplyUISettings() { IPersistFile* ppf = NULL; // Set the path to the shortcut target psl->SetPath(exePath); + psl->SetArguments("/min"); // Query IShellLink for the IPersistFile interface for // saving the shortcut in persistent storage. hres = psl->QueryInterface(IID_IPersistFile,