@@ -52,7 +52,7 @@ public MainForm() {
5252 }
5353
5454 if ( ! OperatingSystemHelper . IsRunningAsUwp ( ) )
55- Text = $ " { Updater . ApplicationTitle } v { Updater . CurrentVersion } " ;
55+ Text = Updater . ApplicationTitle ;
5656
5757 btnWinUpd . Text = string . Format ( "Windows Update ({0})" , 0 ) ;
5858 btnInstalled . Text = string . Format ( "Installed Updates ({0})" , 0 ) ;
@@ -237,9 +237,6 @@ public MainForm() {
237237 mTimer . Tick += OnTimedEvent ;
238238 mTimer . Enabled = true ;
239239
240- Program . Ipc . PipeMessage += PipesMessageHandler ;
241- Program . Ipc . Listen ( ) ;
242-
243240 Updater . Subscribe (
244241 ( message , isError ) => { MessageBox . Show ( message , Updater . ApplicationTitle , MessageBoxButtons . OK , isError ? MessageBoxIcon . Warning : MessageBoxIcon . Information ) ; } ,
245242 ( message ) => { return MessageBox . Show ( message , Updater . ApplicationTitle , MessageBoxButtons . OKCancel , MessageBoxIcon . Question ) == DialogResult . OK ; } ,
@@ -291,6 +288,20 @@ private void InitializeTheme() {
291288
292289 #endregion
293290
291+ protected override void WndProc ( ref Message m ) {
292+ if ( m . Msg == WinApiHelper . WM_SHOWME ) {
293+ notifyIcon_BalloonTipClicked ( null , null ) ;
294+ Visible = true ;
295+ WindowState = FormWindowState . Normal ;
296+ Activate ( ) ;
297+ BringToFront ( ) ;
298+ WinApiHelper . SetForegroundWindow ( this . Handle ) ;
299+ }
300+ else {
301+ base . WndProc ( ref m ) ;
302+ }
303+ }
304+
294305 private void siteToolStripMenuItem_Click ( object sender , EventArgs e ) {
295306 Updater . VisitAppSite ( ) ;
296307 }
@@ -318,16 +329,6 @@ protected override void SetVisibleCore(bool value) {
318329 base . SetVisibleCore ( allowShowDisplay ? value : allowShowDisplay ) ;
319330 }
320331
321- private void PipesMessageHandler ( PipeIpc . PipeServer pipe , string data ) {
322- if ( data . Equals ( "show" , StringComparison . CurrentCultureIgnoreCase ) ) {
323- notifyIcon_BalloonTipClicked ( null , null ) ;
324- pipe . Send ( "ok" ) ;
325- }
326- else {
327- pipe . Send ( "unknown" ) ;
328- }
329- }
330-
331332 private void OnTimedEvent ( object source , EventArgs e ) {
332333 var updateNow = false ;
333334 if ( notifyIcon . Visible ) {
0 commit comments