From: <tw...@us...> - 2013-01-30 13:10:11
|
Revision: 13498 http://jvcl.svn.sourceforge.net/jvcl/?rev=13498&view=rev Author: twm Date: 2013-01-30 13:10:01 +0000 (Wed, 30 Jan 2013) Log Message: ----------- added TJvTrayIcon.OnQueryEndSession event Modified Paths: -------------- trunk/jvcl/run/JvTrayIcon.pas Modified: trunk/jvcl/run/JvTrayIcon.pas =================================================================== --- trunk/jvcl/run/JvTrayIcon.pas 2013-01-26 20:59:33 UTC (rev 13497) +++ trunk/jvcl/run/JvTrayIcon.pas 2013-01-30 13:10:01 UTC (rev 13498) @@ -98,6 +98,7 @@ FCurrentIcon: TIcon; FState: TJvTrayIconStates; FStreamedActive: Boolean; + FOnQueryEndSession: TNotifyEvent; function GetApplicationVisible: Boolean; procedure SetApplicationVisible(const Value: Boolean); @@ -181,6 +182,7 @@ procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure DoDoubleClick(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure DoClick(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure doOnQueryEndSession; function ApplicationHook(var Msg: TMessage): Boolean; function NotifyIcon(uFlags: UINT; dwMessage: DWORD): Boolean; procedure SetCurrentIcon(Value: TIcon); //HEG: New @@ -235,6 +237,7 @@ property OnBalloonHide: TNotifyEvent read FOnBalloonHide write FOnBalloonHide; property OnBalloonClick: TNotifyEvent read FOnBalloonClick write FOnBalloonClick; property OnContextPopup: TContextPopupEvent read FOnContextPopup write FOnContextPopup; + property OnQueryEndSession: TNotifyEvent read FOnQueryEndSession write FOnQueryEndSession; end; procedure RefreshTray; @@ -823,6 +826,12 @@ DoContextPopup(X, Y); end; +procedure TJvTrayIcon.doOnQueryEndSession; +begin + if Assigned(FOnQueryEndSession) then + FOnQueryEndSession(Self); +end; + procedure TJvTrayIcon.DoTimerDblClick; begin StopTimer(DblClickTimer); @@ -1478,14 +1487,17 @@ end; end; end; - {$IFNDEF DELPHI2009_UP} - // Add by Winston Feng 2003-9-28 - // Handle the QueryEndSession and TaskbarCreated message, so trayicon - // will be deleted and restored correctly. - // For D2009 and upper, we must let the default window proc handle it. WM_QUERYENDSESSION: - Result := 1; - {$ENDIF ~DELPHI2009_UP} + begin + doOnQueryEndSession; + // Add by Winston Feng 2003-9-28 + // Handle the QueryEndSession and TaskbarCreated message, so trayicon + // will be deleted and restored correctly. + // For D2009 and above, we must let the default window proc handle it. + {$IFNDEF DELPHI2009_UP} + Result := 1; + {$ENDIF ~DELPHI2009_UP} + end; WM_ENDSESSION: // (rb) Is it really necessairy to respond to WM_ENDSESSION? if TWMEndSession(Mesg).EndSession then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |