From 293ec4c7431e8c8a26a353e1a024bc4cf2927479 Mon Sep 17 00:00:00 2001 From: r57zone Date: Sun, 1 May 2016 17:40:49 +0400 Subject: [PATCH] update --- Unit1.dfm | 6 +++--- Unit1.pas | 24 ++++++++++++------------ main.htm | 12 +++++------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Unit1.dfm b/Unit1.dfm index c95c30b..581b4a9 100644 --- a/Unit1.dfm +++ b/Unit1.dfm @@ -4,7 +4,7 @@ object Form1: TForm1 BorderStyle = bsSingle Caption = 'Notification center' ClientHeight = 322 - ClientWidth = 380 + ClientWidth = 390 Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -20,13 +20,13 @@ object Form1: TForm1 object WebBrowser1: TWebBrowser Left = 0 Top = 0 - Width = 380 + Width = 390 Height = 306 TabOrder = 0 OnBeforeNavigate2 = WebBrowser1BeforeNavigate2 OnDocumentComplete = WebBrowser1DocumentComplete ControlData = { - 4C00000046270000A01F00000000000000000000000000000000000000000000 + 4C0000004F280000A01F00000000000000000000000000000000000000000000 000000004C000000000000000000000001000000E0D057007335CF11AE690800 2B2E126208000000000000004C0000000114020000000000C000000000000046 8000000000000000000000000000000000000000000000000000000000000000 diff --git a/Unit1.pas b/Unit1.pas index 7c38654..219725f 100644 --- a/Unit1.pas +++ b/Unit1.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, OleCtrls, SHDocVw, MSHTML, ShellAPI, StdCtrls; + Dialogs, OleCtrls, SHDocVw, MSHTML, ShellAPI, StdCtrls, ExtCtrls; type TForm1 = class(TForm) @@ -21,8 +21,8 @@ TForm1 = class(TForm) procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA; protected procedure CreateParams(var Params: TCreateParams); override; - procedure IconMouse(var msg:TMessage); message WM_USER+1; - procedure WMActivate(var msg:TMessage); message WM_ACTIVATE; + procedure IconMouse(var Msg:TMessage); message WM_USER+1; + procedure WMActivate(var Msg:TMessage); message WM_ACTIVATE; { Private declarations } public { Public declarations } @@ -71,12 +71,12 @@ procedure Tray(n:integer); end; end; -procedure TForm1.IconMouse(var msg: TMessage); +procedure TForm1.IconMouse(var Msg: TMessage); begin - case msg.lparam of - wm_lbuttonup: if (Left=Screen.Width+Width) and (Top=Screen.Height+Height) then MyShow else MyHide; + case Msg.lparam of + WM_LButtonDown: if (Left=Screen.Width+Width) and (Top=Screen.Height+Height) then MyShow else MyHide; - wm_rbuttonup: + WM_RButtonDown: begin SetForegroundWindow(Application.Handle); case MessageBox(Handle,' ',PChar(Application.Title),35) of @@ -170,7 +170,7 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData); if (p_img='null') and (p_img2<>'null') then p_img:=p_img2; if (p_img='null') and (p_img2='null') then p_img:='sys.png'; - if (a_desc<>'null') and (a_desc_sub<>'null') then a_desc:=a_desc+' '+a_desc_sub; + if (a_desc<>'null') and (a_desc_sub<>'null') then a_desc:=a_desc+' - '+a_desc_sub; if (a_desc<>'null') and (a_desc_sub='null') then a_desc:=a_desc; if (a_desc='null') and (a_desc_sub<>'null') then a_desc:=a_desc_sub; if (a_desc='null') and (a_desc_sub='null') then a_desc:=''; @@ -188,7 +188,7 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData); '6': a_color:='#222222'; end; end else a_color:='gray'; - WebBrowser1.OleObject.Document.getElementById('items').innerHTML:='
'+a_title+'
'+a_desc+'
'+copy(TimeToStr(Time),1,5)+'
'+WebBrowser1.OleObject.Document.getElementById('items').innerHTML; + WebBrowser1.OleObject.Document.getElementById('items').innerHTML:='
'+a_title+'
'+a_desc+'
'+copy(TimeToStr(Time),1,5)+'
'+DateToStr(Date)+'
'+WebBrowser1.OleObject.Document.getElementById('items').innerHTML; Notifications.Text:=WebBrowser1.OleObject.Document.getElementById('items').innerHTML; Notifications.SaveToFile(ExtractFilePath(ParamStr(0))+'Notifications.txt'); end; @@ -197,12 +197,12 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData); procedure TForm1.FormClick(Sender: TObject); begin -Application.MessageBox(' 0.3'+#13#10+'https://github.com/r57zone'+#13#10+' : 28.04.2016',' ...',0); + Application.MessageBox(' 0.4'+#13#10+'https://github.com/r57zone'+#13#10+' : 01.05.2016',' ...',0); end; -procedure TForm1.WMActivate(var msg: TMessage); +procedure TForm1.WMActivate(var Msg: TMessage); begin -if Msg.WParam=WA_INACTIVE then MyHide; + if Msg.WParam=WA_INACTIVE then MyHide; end; procedure TForm1.FormDestroy(Sender: TObject); diff --git a/main.htm b/main.htm index 0d8277c..3c0a783 100644 --- a/main.htm +++ b/main.htm @@ -2,14 +2,12 @@ - Центр уведомлений (стиль) - +