Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
r57zone committed Apr 30, 2016
1 parent 034078f commit 762cb68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ object Form1: TForm1
Font.Style = []
OldCreateOrder = False
OnClick = FormClick
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 13
object WebBrowser1: TWebBrowser
Expand Down
28 changes: 14 additions & 14 deletions Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ interface
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant; var Cancel: WordBool);
procedure WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
procedure FormClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA;
protected
Expand Down Expand Up @@ -80,9 +80,9 @@ procedure TForm1.IconMouse(var msg: TMessage);
begin
SetForegroundWindow(Application.Handle);
case MessageBox(Handle,'Çàêðûòü ïðèëîæåíèå',PChar(Application.Title),35) of
6: close;
end;
end;
6: close;
end;
end;
end;
end;

Expand All @@ -108,15 +108,6 @@ procedure TForm1.FormCreate(Sender: TObject);
ExcludeList.LoadFromFile(ExtractFilePath(ParamStr(0))+'Exclude.txt');
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Notifications.Text:=WebBrowser1.OleObject.Document.getElementById('items').innerHTML;
Notifications.SaveToFile(ExtractFilePath(ParamStr(0))+'Notifications.txt');
Notifications.Free;
ExcludeList.Free;
tray(2);
end;

procedure TForm1.WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant; var Cancel: WordBool);
Expand Down Expand Up @@ -198,6 +189,8 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData);
end; end else a_color:='gray';

WebBrowser1.OleObject.Document.getElementById('items').innerHTML:='<div id="item"><div id="icon" style="background-color:'+a_color+';"><img src="'+p_img+'" /></div><div id="context"><div id="title">'+a_title+'</div><div id="clear"></div><div id="description">'+a_desc+'</div></div><div id="time">'+copy(TimeToStr(Time),1,5)+'</div></div>'+WebBrowser1.OleObject.Document.getElementById('items').innerHTML;
Notifications.Text:=WebBrowser1.OleObject.Document.getElementById('items').innerHTML;
Notifications.SaveToFile(ExtractFilePath(ParamStr(0))+'Notifications.txt');
end;
Msg.Result:=Integer(True);
end;
Expand All @@ -209,7 +202,14 @@ procedure TForm1.FormClick(Sender: TObject);

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);
begin
Notifications.Free;
ExcludeList.Free;
tray(2);
end;

end.

0 comments on commit 762cb68

Please sign in to comment.