X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Editor.pas;h=0673760fa2d26fecabb50de9eadff183c873c1d0;hb=724c6aafc862ebff07b61328a6dba7398af96bde;hp=38d83569bdd0bfed5a9ff018780f6c2f3e18552a;hpb=2151ac70a1447bd040c1f32f322d9ad730ead83a;p=gikonavigoeson%2Fgikonavi.git
diff --git a/Editor.pas b/Editor.pas
index 38d8356..0673760 100644
--- a/Editor.pas
+++ b/Editor.pas
@@ -12,12 +12,12 @@ uses
SHDocVw_TLB,
MSHTML_TLB,
{$IFEND}
- ActiveX, {HTTPApp,} YofUtils, Trip, IniFiles, StrUtils,
+ ActiveX, {HTTPApp,} YofUtils, IniFiles, StrUtils,
GikoSystem, GikoUtil, ImgList, Clipbrd, BoardGroup,
IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP, ActnList, StdActns, IdIntercept,
IdLogBase, IdLogDebug, IdException, DateUtils, bmRegExp,
- Gesture, AppEvnts;
+ Gesture, AppEvnts, SambaTimer;
type
// TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall;
@@ -89,7 +89,6 @@ type
SelectAllAction: TAction;
N2: TMenuItem;
SelectAll1: TMenuItem;
- Timer1: TTimer;
QuotePasteAction: TAction;
QuotePasteMenuItem: TMenuItem;
C1: TMenuItem;
@@ -118,7 +117,7 @@ type
LocalEdit: TMemo;
N6: TMenuItem;
LocalRuleBrowse: TMenuItem;
- ToolButton4: TToolButton;
+ ToolButton4: TToolButton;
ToolButton6: TToolButton;
SaveNameMailAction: TAction;
ToolButton7: TToolButton;
@@ -133,6 +132,8 @@ type
ToolButton8: TToolButton;
ToolButton9: TToolButton;
ShowInputAssistForm: TAction;
+ ReleaseCookieAction: TAction;
+ Cookie1: TMenuItem;
procedure EditorPageChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
@@ -167,7 +168,6 @@ type
AStream: TStream);
procedure SelectAllActionExecute(Sender: TObject);
procedure StatusBarResize(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure QuotePasteActionExecute(Sender: TObject);
@@ -191,6 +191,9 @@ type
procedure ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
procedure ShowInputAssistFormExecute(Sender: TObject);
+ procedure ReleaseCookieActionExecute(Sender: TObject);
+ procedure GetSETTINGTXTActionUpdate(Sender: TObject);
+ procedure GetHeadTXTActionUpdate(Sender: TObject);
private
FThreadItem: TThreadItem;
FBoard: TBoard;
@@ -201,41 +204,20 @@ type
FStatusCode: Integer;
FDebugStrReceive: string;
FDebugStrSend: string;
- FSambaTime: TDateTime;
- FHost: string;
FNow: TDateTime;
FGestures : TMouseGesture;
FInputAssistKey: String; ///< üÍAVXgÌL[
FResistWords: TStringList; ///< üÍAVXgÌ«©çÌõÊ
+ FSambaTimer: TSambaTimer; ///< SambaÎôÌ^C}[
procedure Preview;
- function RepHtml(s: string): string;
function Check: Boolean;
procedure SetNameList(sName, sMail: string);
-// procedure Send(SendType: TGikoSendType; SPID: string; PON: string; FirstWriting: Boolean);
-// procedure Send(SPID: string; PON: string; FirstWriting: Boolean);
- procedure Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
-
+ procedure Send(const ACOOKIE: string; const SPID: string; const PON: string; FirstWriting: Boolean);
function GetActiveControlHandle: THandle;
-// function GetSendData: string;
-// procedure GetSendData(Source: TStringStream);
procedure GetSendData(Source: TStringStream);
procedure SaveSendFile;
procedure SetContent(Content: string; ABrowser: TWebBrowser);
function GetResultType(ResponseText: string): TGikoResultType;
- //SambaÌÔðÇÝÞ
- procedure ReadSambaTime(const AHost: string);
- //SambaÉÔð«Þ
- procedure WriteSambaTime(const AHost: string; ATime: TDateTime);
- //SambaÌÝèlðÇÝÞ
- function ReadSettingTime(const AHost: string): Integer;
- //SambaÉøÁ©©é©¸·é
- function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
- //SambaÌÝèlð«Þ
- procedure SetSamba24(AURL: string);
- //SambaÌÝèlðXV·é
- procedure UpdateSamba(const AHost: String; value: Integer);
- /// øpÌæ¾
- function GetOEIndentChar : string;
/// {¶Ìæ¾
function GetBody : string;
//IdHttpÌú»
@@ -253,13 +235,39 @@ type
//HEAD.TXT©®\¦
procedure ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
//LocalFusianaTrapAlart
- function LFusianaGet(s: String): Boolean;
+ function LFusianaGet(const s: String): Boolean;
// CookieÌæ¾
procedure GetCookie(Rawtext: String; ABoard: TBoard);
//! üÍAVXgÌ|bvAbvj
[ÌNbNCxg
procedure InputAssistMenuClick(Sender: TObject);
//! TMemoÌJ[\Êuɶñ}ü
procedure InsertText(Memo: TMemo; Text: String);
+ //! M~
+ procedure CancelSend(ABoard: TBoard; ASysMenu: HMENU);
+ //! Samba^C}[Cxg
+ procedure SambaTimer(Sender: TObject);
+ //! EBhEÌÊuÆTCYÌÝè
+ procedure SetWindowRect;
+ //! g£^uÝè
+ procedure SetExtraTab;
+ //! Âæ¾
+ function GetBoard : TBoard;
+ //! URLÌf[^ðstreamÉæèÞ
+ procedure GetWebData(const URL: string; const RefURL: string;
+ Modified: TDateTime; stream: TStream);
+ //! GikoFormÉV
bZ[WðÇÁ·é
+ procedure AddFormMessageNew(icon: TGikoMessageIcon);
+ //! [Jfusianagbv
+ function isLocalFusianaTrap: Boolean;
+ //! [Jfusianagbv
+ function isRemoteFusianaTrap: Boolean;
+ //! Header¶ñæ¾
+ function getHeaderStr(const ACOOKIE: string; const SPID : string;
+ const PON : string; Board : TBoard) : string;
+ //! fusianax_CAO
+ function FusianaMsgBox: Integer;
+ //! sent.init@C̶¬
+ function CreateSentIniFile: TMemIniFile;
protected
procedure CreateParams(var Params: TCreateParams); override;
public
@@ -267,6 +275,7 @@ type
procedure SetFont;
procedure SetThreadItem(Item: TThreadItem);
procedure SetBoard(Item: TBoard);
+ procedure UpdateSambaStatus;
property BBSID: string read FBBSID write FBBSID;
end;
@@ -274,7 +283,7 @@ implementation
uses
Giko, ItemDownload, MojuUtils, IdGlobal, GikoMessage, Imm,
- InputAssistDataModule, InputAssist;
+ InputAssistDataModule, InputAssist, HTMLCreate;
const
CAPTION_NAME_NEW: string = 'MRir X§ÄGfB^';
CAPTION_NAME_RES: string = 'MRir XGfB^';
@@ -300,17 +309,6 @@ const
RES2CH_CHECK = '';
RES2CH_COOKIE = '';
-
- BBS2CH_NAME: string = 'Q¿áñËé';
- BBS2CH_LOG_FOLDER: string = '2ch';
- EXTERNAL_LOG_FOLDER: string = 'exboard';
-
- FOLDER_INI_FILENAME: string = 'Folder.ini';
- FOLDER_INDEX_FILENAME: string = 'Folder.idx';
- SUBJECT_FILENAME: string = 'subject.txt';
- PATH_DELIM: string = '\';
-
-
type
TSelection = record
StartPos, EndPos: Integer;
@@ -340,50 +338,17 @@ begin
end;}
procedure TEditorForm.FormCreate(Sender: TObject);
-var
- wp: TWindowPlacement;
- hUser32 : HINST;
- ini: TIniFile;
begin
FWork := False;
+ FSambaTimer := TSambaTimer.Create(Self);
+ FSambaTimer.Interval := 0;
Browser.Navigate('about:blank');
TitlePictureBrowser.Navigate('about:blank');
FBoard := nil;
FThreadItem := nil;
//EBhEÌÊuÝè
- wp.length := sizeof(wp);
- wp.rcNormalPosition.Top := GikoSys.Setting.EditWindowTop;
- wp.rcNormalPosition.Left := GikoSys.Setting.EditWindowLeft;
-
- wp.rcNormalPosition.Bottom := GikoSys.Setting.EditWindowTop + GikoSys.Setting.EditWindowHeight;
- wp.rcNormalPosition.Right := GikoSys.Setting.EditWindowLeft + GikoSys.Setting.EditWindowWidth;
- wp.showCmd := SW_HIDE;
- SetWindowPlacement(Handle, @wp);
-
- if GikoSys.Setting.EditWindowMax then
- WindowState := wsMaximized;
-
- //EBhEªæÊOÈçæÊàÉÚ®·é
- if (Left + Width) > Screen.Width then
-// Left := Screen.Width - Width;
- Left := 0;
- if (Top + Height) > Screen.Height then
-// Top := Screen.Height - Height;
- Top := 0;
- if Left < 0 then
- Left := 0;
- if Top < 0 then
- Top := 0;
-
- //»ÝÌEBhEÌÊuðÛ¶
- GikoSys.Setting.EditWindowTop := Top + WINDOWMOVE_V; // ÉJEBhEÍ
- GikoSys.Setting.EditWindowLeft := Left + WINDOWMOVE_H; // @@@EÎߺɸç·
- //EBhEÌƳª¬³·¬¢êγÉß·
- if GikoSys.Setting.EditWindowHeight < 144 then
- Height := 400;
- if GikoSys.Setting.EditWindowWidth < 144 then
- Width := 640;
+ SetWindowRect;
EditorPage.ActivePage := EditorTab;
FNameComboEdit := GetWindow(NameComboBox.Handle, GW_CHILD);
@@ -391,20 +356,8 @@ begin
NameComboBox.Items.Assign(GikoSys.Setting.NameList);
MailComboBox.Items.Assign(GikoSys.Setting.MailList);
SetFont;
- hUser32 := 0;
- try
- try
- hUser32 := LoadLibrary('User32.dll');
- if hUser32 <> 0 then
- TransAction.Enabled := true
- else
- TransAction.Enabled := false;
- except
- TransAction.Enabled := false;
- end;
- finally
- FreeLibrary(hUser32);
- end;
+ // ¼§¾pÂ\Ýè
+ TransAction.Enabled := GikoSys.CanUser32DLL;
// EBhEÌXeCóÔ
if GikoSys.Setting.EditWindowStay then begin // XeCóÔ
@@ -432,17 +385,9 @@ begin
SpaceToNBSPAction.Checked := GikoSys.Setting.SpaceToNBSP;
AmpToCharRefAction.Checked := GikoSys.Setting.AmpToCharRef;
+ // [J[{ÂgbvæÌ^uÌÝè
+ SetExtraTab;
- ini := TIniFile.Create(GikoSys.Setting.GetFileName);
-
- try
- BoardtopTab.TabVisible := ini.Readbool('EditorForm', 'BoardTopTab', False);
- BoardTop.Checked := BoardtopTab.TabVisible;
- RocalRuleTab.TabVisible := ini.ReadBool('EditorForm', 'LocalRuleTab', False);
- LocalRule.Checked := RocalRuleTab.TabVisible;
- finally
- ini.Free;
- end;
// L[ÝèÌÇÝÝ
GikoSys.LoadKeySetting(ActionList, GikoSys.GetEditorKeyFileName);
// }EXWFX`[ÌCXg[
@@ -460,7 +405,6 @@ begin
end;
SaveNameMailAction.Checked := True;
end;
-
procedure TEditorForm.SetBoard(Item: TBoard);
begin
FBoard := Item;
@@ -469,7 +413,13 @@ begin
MailComboBox.Text := FBoard.KotehanMail;
SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
TitlePanel.Visible := True;
- SetSamba24(FBoard.URL);
+
+ if (FSambaTimer.SetBoard(FBoard) >= 0) then begin
+ UpdateSambaStatus;
+ FNow := Now();
+ FSambaTimer.OnTimer := SambaTimer;
+ end;
+
ShowBoardInformation(FBoard, BoardInformationMemo);
ShowTitlePicture();
end;
@@ -482,7 +432,13 @@ begin
MailComboBox.Text := FThreadItem.ParentBoard.KotehanMail;
SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
TitlePanel.Visible := False;
- SetSamba24(FThreadItem.ParentBoard.URL);
+
+ if (FSambaTimer.SetBoard(FThreadItem.ParentBoard) >= 0) then begin
+ UpdateSambaStatus;
+ FNow := Now();
+ FSambaTimer.OnTimer := SambaTimer;
+ end;
+
ShowBoardInformation(FThreadItem.ParentBoard, BoardInformationMemo);
ShowTitlePicture();
end;
@@ -580,73 +536,38 @@ var
No: string;
Mail: string;
Namae: string;
- DateTime: string;
Body: string;
s: string;
-
- posTrip : Integer;
- tripOrigin : string;
begin
if FThreadItem = nil then begin
No := '1';
- Title := RepHtml(TitleEdit.Text);
+ Title := THTMLCreate.RepHtml(TitleEdit.Text);
end else begin
No := IntToStr(FThreadItem.Count + 1);
- Title := RepHtml(FThreadItem.Title);
+ Title := THTMLCreate.RepHtml(FThreadItem.Title);
end;
- body := GetBody;
- Namae := RepHtml(NameComboBox.Text);
- Mail := RepHtml(MailComboBox.Text);
- Body := RepHtml(body);
- Body := StringReplace(Body, #13#10, '
', [rfReplaceAll]);
- DateTime := FormatDateTime('yyyy/mm/dd(aaa) hh:nn', now);
+ Body := GetBody;
+ Namae := THTMLCreate.RepHtml(NameComboBox.Text);
+ Mail := THTMLCreate.RepHtml(MailComboBox.Text);
+ Body := THTMLCreate.RepHtml(Body);
+ Body := CustomStringReplace(Body, #13#10, '
', False);
+
if Trim(Namae) = '' then
Namae := '¼³µ³ñ';
- s := '
' + #13#10
- + '' + #13#10
- + '' + title + '' + #13#10
-// + '' + #13#10
- + '' + #13#10
- + '' + #13#10
- + '' + title + '' + #13#10
- + '' + #13#10;
- posTrip := AnsiPos( '#', Namae );
- if posTrip > 0 then
- begin
- tripOrigin := Copy( Namae, posTrip + 1, Length( Namae ) );
- Namae :=
- Copy( Namae, 1, posTrip - 1 ) + ' ' +
- get_2ch_trip( PChar( tripOrigin ) ) + '';
- end;
- if Mail = '' then
- s := s + '- ' + No + ' F ' + Namae + ' F ' + DateTime+ '
- ' + Body + '
' + #13#10
- else
- s := s + ' - ' + No + ' F ' + Namae + ' [' + Mail + ']F ' + DateTime+ '
- ' + Body + '
' + #13#10;
- s := s + '';
+ s := THTMLCreate.CreatePreviewHTML(Title, No, Mail, Namae, Body);
+
SetContent(s, Browser);
end;
-function TEditorForm.RepHtml(s: string): string;
-begin
-// s := StringReplace(s, '&', '&', [rfReplaceAll]);
- s := CustomStringReplace(s, '<', '<');
- s := CustomStringReplace(s, '>', '>');
-// s := StringReplace(s, ' ', ' ', [rfReplaceAll]); //dlÏXÉæè gpsÂ
- s := CustomStringReplace(s, '"', '"');
- Result := s;
-end;
-
procedure TEditorForm.EditorPageChange(Sender: TObject);
var
tmpBoard: TBoard;
begin
- if FThreadItem = nil then
- tmpBoard := FBoard
- else
- tmpBoard := FThreadItem.ParentBoard;
+
+ tmpBoard := GetBoard;
if tmpBoard = nil then Exit;
@@ -674,31 +595,32 @@ begin
end;
function TEditorForm.Check: Boolean;
+const
+ REQUIRED: string = 'ªüͳêĢܹñB';
+ ERROR: string = 'G[';
var
Msg: string;
rc: Integer;
Board: TBoard;
begin
Result := True;
- if FThreadItem = nil then
- Board := FBoard
- else
- Board := FThreadItem.ParentBoard;
+
+ Board := GetBoard;
if (not GikoSys.Setting.UseMachineTime) and
((Board.LastGetTime = 0) or
(Board.LastGetTime = ZERO_DATE)) then begin
Msg := 'T[o̪ª©çÈ¢½ßAMoܹñ'#13#10
+ 'XbhðXViæ¾jãA15bÒÁÄ©çMµÄ¾³¢';
- MsgBox(Handle, Msg, 'G[', MB_OK or MB_ICONSTOP);
+ MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
Result := False;
end else if BodyEdit.Text = '' then begin
- Msg := '{¶ªüͳêĢܹñB';
- MsgBox(Handle, Msg, 'G[', MB_OK or MB_ICONSTOP);
+ Msg := '{¶' + REQUIRED;
+ MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
Result := False;
end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
- Msg := '^CgªüͳêĢܹñB';
- MsgBox(Handle, Msg, 'G[', MB_OK or MB_ICONSTOP);
+ Msg := '^Cg' + REQUIRED;
+ MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
Result := False;
end else begin
if (not GikoSys.Dolib.Connected) and (AnsiPos('', NameComboBox.Text) <> 0) then begin
@@ -713,6 +635,7 @@ end;
procedure TEditorForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
+ FSambaTimer.Free;
end;
procedure TEditorForm.FormDestroy(Sender: TObject);
@@ -809,65 +732,43 @@ begin
Indy.Request.UserAgent := GikoSys.GetUserAgent;
Indy.Request.AcceptEncoding := '';
end;
+//! M~̽ßÌj
[퀦
+procedure TEditorForm.CancelSend(ABoard: TBoard; ASysMenu: HMENU);
+begin
+ ABoard.SPID := '';
+ ABoard.PON := '';
+ FWork := false;
+ EnableMenuItem(ASysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
+ DrawMenuBar(Handle);
+end;
-procedure TEditorForm.Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
+procedure TEditorForm.Send( const ACOOKIE: string; const SPID: string;
+ const PON: string; FirstWriting: Boolean);
var
TextStream: TStringStream;
Source: TStringStream;
ResponseText: string;
URL: string;
- RefURL: string;
State: TGikoDownloadState;
ResultType: TGikoResultType;
MsgResult: Integer;
- Cookie: string;
Board: TBoard;
sysMenu : HMENU;
- //fusianasangbv byèúÖ
- Namae : String;
- body : TStringList;
- Remote : String;
- ABoard : TBoard;
- tmpRawheader: string;
{Protocol,Host, Path, Document, Port, Bookmark : String;}
begin
FAbort := False;
State := gdsError;
- Namae := RepHtml(NameComboBox.Text);
- if FThreadItem = nil then
- Board := FBoard
- else
- Board := FThreadItem.ParentBoard;
+ Board := GetBoard;
- tmpRawheader := '';
InitIdHTTP(Indy);
if FThreadItem = nil then begin
URL := FBoard.GetSendURL;
- RefURL := GikoSys.UrlToServer(FBoard.URL) + 'test/bbs.cgi';
+ Indy.Request.Referer := GikoSys.UrlToServer(FBoard.URL) + 'test/bbs.cgi';
end else begin
URL := FThreadItem.GetSendURL;
- RefURL := FThreadItem.URL;
+ Indy.Request.Referer := FThreadItem.URL;
end;
-// Indy.Request.UserAgent := GikoSys.GetUserAgent;
- Indy.Request.Referer := RefURL;
-// Indy.Request.AcceptEncoding := '';
-
- Cookie := '';
- if ACOOKIE <> '' then
- Cookie := ACOOKIE;
- if SPID <> '' then
- Cookie := Cookie + 'SPID=' + SPID + '; ';
- if PON <> '' then
- Cookie := Cookie + 'PON=' + PON + '; ';
-
- //zXgª2chÅABeÉLoginµÄ¢êÎBEÌf[^ðé
- //GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
- //if GikoSys.Is2chHost(Host) and GikoSys.Setting.BeLogin then
- if (Board.Is2ch) and (GikoSys.Setting.BeLogin) then
- Cookie := Cookie + 'MDMD=' + GikoSys.Setting.BeCode + '; '
- + 'DMDM=' + GikoSys.Setting.BeUserID + '; ';
- Cookie := 'Cookie: ' + Cookie + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
sysMenu := GetSystemMenu( Handle, false );
EnableMenuItem( sysMenu, SC_CLOSE, MF_GRAYED );
@@ -881,13 +782,27 @@ begin
Indy.Request.AcceptLanguage := 'ja';
Indy.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
Indy.Request.ContentType := 'application/x-www-form-urlencoded';
- Indy.Request.CustomHeaders.Add(Cookie);
+ Indy.Request.CustomHeaders.Add(getHeaderStr(ACOOKIE, SPID, PON, Board));
TextStream := TStringStream.Create('');
Source := TStringStream.Create('');
try
try
FDebugStrReceive := '';
FDebugStrSend := '';
+
+ if (FirstWriting) then begin
+ //tVAigbvx(LocalMode) by èúÖ
+ if (isLocalFusianaTrap) then begin
+ CancelSend( Board, SysMenu );
+ Exit;
+ end;
+ //tVAigbvx(Remote)
+ if (isRemoteFusianaTrap) then begin
+ CancelSend( Board, SysMenu );
+ Exit;
+ end;
+ end;
+
GetSendData(Source);
IdAntiFreeze.Active := True;
try
@@ -899,177 +814,74 @@ begin
ResultType := GetResultType(ResponseText);
- //MsgResultú»
- MsgResult := IDNO;
- //tVAigbvx(LocalMode) by èúÖ
- if GikoSys.Setting.LocalTrapAtt then begin
- if LFusianaGet(Namae) then begin
- MsgResult := MsgBox(
- Handle,
- '[gzXgð\¦·é@\ªgíêĢܷ' + #13#10 +
- 'àµàÔáÁıÌû@ÅzXgª\¦³ê½ÆµÄàA©ÈÓCÈÌÅíËÉͶܹñB' + #13#10#13#10 +
- 'ÓCð¤±Æð³øµÄ«ÝÜ·©H',
- 'îñ',
- MB_YESNO or MB_ICONQUESTION);
- if MsgResult = IDNO then begin
- Board.SPID := '';
- Board.PON := '';
- FWork := false;
- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
- DrawMenuBar(Handle);
- Exit;
- end;
- end;
- if ((Namae = 'RèÂ') or (Namae = 'fusianasan')) then begin
- MsgResult := MsgBox(
- Handle,
- '[gzXgð\¦·é@\ªgíêĢܷ' + #13#10 +
- 'àµàÔáÁıÌû@ÅzXgª\¦³ê½ÆµÄàA©ÈÓCÈÌÅíËÉͶܹñB' + #13#10#13#10 +
- 'ÓCð¤±Æð³øµÄ«ÝÜ·©H',
- 'îñ',
- MB_YESNO or MB_ICONQUESTION);
- if MsgResult = IDNO then begin
- Board.SPID := '';
- Board.PON := '';
- FWork := false;
- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
- DrawMenuBar(Handle);
- Exit;
- end;
- end;
- end;
-
- if GikoSys.Setting.RemoteTrapAtt then begin
- if FThreadItem = nil then
- ABoard := FBoard
- else
- ABoard := FThreadItem.ParentBoard;
-
- if ABoard = nil then Exit;
-
- if FileExists(ABoard.GetSETTINGTXTFileName) then begin
- body := TStringList.Create;
- try
- body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
- Remote := GetFusianaName(body, ABoard);
- finally
- body.Free;
- end;
- end;
-
- //Setting.txtªÈ©Á½çæ¾
- //IÉת©©è»¤Å|¢EEE
- if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
- //GetSETTINGTXTActionðÄÑo·ÆIndyªú»³êéÌÅA
- //±±ÅCookieðÛ¶µÈÄÍ¢¯È¢
- tmpRawheader := Indy.Response.RawHeaders.Text;
- GetSETTINGTXTAction.Execute;
- body := TStringList.Create;
- try
- if FileExists(ABoard.GetSETTINGTXTFileName) then begin
- body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
- Remote := GetFusianaName(body, ABoard);
- end;
- finally
- body.Free;
- end;
- end;
-
- if Remote = 'fusianasan' then begin
- MsgResult := MsgBox(
- Handle,
- '[gzXgð\¦·é@\ªgíêĢܷ' + #13#10 +
- 'àµàÔáÁıÌû@ÅzXgª\¦³ê½ÆµÄàA©ÈÓCÈÌÅíËÉͶܹñB' + #13#10#13#10 +
- 'ÓCð¤±Æð³øµÄ«ÝÜ·©H',
- 'îñ',
- MB_YESNO or MB_ICONQUESTION);
- if MsgResult = IDNO then begin
- Board.SPID := '';
- Board.PON := '';
- FWork := false;
- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
- DrawMenuBar(Handle);
- Exit;
- end;
- end;
- end;
if ResultType = grtOK then begin
- if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
- WriteSambaTime(FHost, Now());
+ if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
+ begin
+ FSambaTimer.WriteSambaTime(Now());
+ end;
State := gdsComplete;
end else if ResultType = grtCookie then begin
//[vh~
if not FirstWriting then
raise Exception.Create('');
- MsgResult := MsgBox(
- Handle,
- 'Ee³ê½àeÍRs[AÛ¶AøpA]Ú³êéêª èÜ·B' + #13#10 +
- 'EeÉֵĶ·éÓCÍSÄeÒÉAµÜ·B' + #13#10#13#10 +
- 'SÓCð¤±Æð³øµÄ«ÝÜ·©H',
- 'îñ',
- MB_YESNO or MB_ICONQUESTION);
+
+ MsgResult := MsgBox( Handle,
+ 'Ee³ê½àeÍRs[AÛ¶AøpA]Ú³êéêª èÜ·B' + #13#10 +
+ 'EeÉֵĶ·éÓCÍSÄeÒÉAµÜ·B' + #13#10#13#10 +
+ 'SÓCð¤±Æð³øµÄ«ÝÜ·©H',
+ 'îñ',
+ MB_YESNO or MB_ICONQUESTION);
+
if MsgResult = IDYES then begin
- if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
- GetCookie(tmpRawheader, Board);
- end else begin
- GetCookie(Indy.Response.RawHeaders.Text, Board);
- end;
+ GetCookie(Indy.Response.RawHeaders.Text, Board);
+
if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
raise Exception.Create('');
+
//à¤êñ±Ì\bh
Send(Board.Cookie, Board.SPID, Board.PON, False);
Exit;
end else begin
- Board.SPID := '';
- Board.PON := '';
- FWork := false;
- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
- DrawMenuBar(Handle);
+ CancelSend( Board, SysMenu );
Exit;
end;
end else if ResultType = grtCheck then begin
- //
//[vh~
if not FirstWriting then
raise Exception.Create('');
- MsgResult := MsgBox(
- Handle,
- '«ÝÉÖµÄÍlXÈOîñªL^³êĢܷB' + #13#10 +
- 'eÉֵĶ·éÓCÍSÄeÒÉAµÜ·B' + #13#10 +
- 'öÇɽµ½èA¼lÉÀfð©¯é«ÝÍT¦Äº³¢B' + #13#10 +
- 'e³ê½àeÍRs[EÛ¶EøpE]Ú³êéêª èÜ·B' + #13#10 +
- #13#10 +
- 'SÓCð¤±Æð³øµÄ«ÝÜ·©H',
- 'mF',
- MB_YESNO or MB_ICONQUESTION);
+ MsgResult := MsgBox( Handle,
+ '«ÝÉÖµÄÍlXÈOîñªL^³êĢܷB' + #13#10 +
+ 'eÉֵĶ·éÓCÍSÄeÒÉAµÜ·B' + #13#10 +
+ 'öÇɽµ½èA¼lÉÀfð©¯é«ÝÍT¦Äº³¢B' + #13#10 +
+ 'e³ê½àeÍRs[EÛ¶EøpE]Ú³êéêª èÜ·B' + #13#10 +
+ #13#10 +
+ 'SÓCð¤±Æð³øµÄ«ÝÜ·©H',
+ 'mF',
+ MB_YESNO or MB_ICONQUESTION);
if MsgResult = IDYES then begin
- if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
- GetCookie(tmpRawheader, Board);
- end else begin
- GetCookie(Indy.Response.RawHeaders.Text, Board);
- end;
+ GetCookie(Indy.Response.RawHeaders.Text, Board);
+
if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
raise Exception.Create('');
+
Send(Board.Cookie, Board.SPID, Board.PON, False);
Exit;
end else begin
- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
- DrawMenuBar(Handle);
- Board.SPID := '';
- Board.PON := '';
- FWork := false;
+ CancelSend( Board, SysMenu );
Exit;
- end;
- end else begin
- if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
- WriteSambaTime(FHost, Now());
- State := gdsError;
- raise Exception.Create('');
- end;
+ end;
+ end else begin
+ if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
+ begin
+ FSambaTimer.WriteSambaTime(Now());
+ end;
+ State := gdsError;
+ raise Exception.Create('');
+ end;
except
on E: EIdConnectException do begin
State := gdsError;
@@ -1110,39 +922,29 @@ begin
DrawMenuBar(Handle);
end;
FWork := false;
- //ñö®MRirÂÈÇÌXNvgp
- //ResponceCodeª302FoundÅ«Ý®¹
+ //ñö®MRirÂÈÇÌ2chÝ·XNvgp
+ //2chÈOÅ©ÂResponceCodeª302FoundÅ«Ý®¹
+ //if (not Board.Is2ch) and (FStatusCode = 302) then begin
if FStatusCode = 302 then begin
GikoForm.PlaySound('ResEnd');
SaveSendFile;
- if FThreadItem = nil then
- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
- else
- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
+ AddFormMessageNew( gmiOK );
Close;
Exit;
end;
if State = gdsComplete then begin
GikoForm.PlaySound('ResEnd');
SaveSendFile;
- if FThreadItem = nil then
- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
- else
- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
+ AddFormMessageNew( gmiOK );
Close;
end else if State = gdsError then begin
- if FThreadItem = nil then
- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
- else
- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
-
+ AddFormMessageNew( gmiOK );
EditorPage.ActivePage := PreviewTab;
SetContent(ResponseText, Browser);
end else if State = gdsAbort then begin
GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiSAD);
end;
end;
-
function TEditorForm.GetResultType(ResponseText: string): TGikoResultType;
begin
if AnsiPos('«±ÝªIíèܵ½', ResponseText) <> 0 then
@@ -1177,10 +979,7 @@ var
Board: TBoard;
body : string;
begin
- if FThreadItem = nil then
- Board := FBoard
- else
- Board := FThreadItem.ParentBoard;
+ Board := GetBoard;
if GikoSys.Setting.UseMachineTime then begin
if GikoSys.Setting.TimeAdjust then
@@ -1202,12 +1001,13 @@ begin
s := 'sid=' + HttpEncode(SessionID) + '&'
else
s := '';
- s := s + 'subject=&'
- + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
- + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
- + 'MESSAGE=' + HttpEncode(body) + '&'
- + 'bbs=' + Board.BBSID + '&'
- + 'time=' + IntToStr(SendTime) + '&';
+ s := s + 'subject=&'
+ + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
+ + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
+ + 'MESSAGE=' + HttpEncode(body) + '&'
+ + 'bbs=' + Board.BBSID + '&'
+ + 'time=' + IntToStr(SendTime) + '&';
+
if FThreadItem = nil then begin
s := s + 'subject=' + HttpEncode(TitleEdit.Text) + '&';
s := s + 'submit=' + HttpEncode('SÓCð¤±Æð³øµÄ«Þ') + #13#10;
@@ -1223,32 +1023,63 @@ var
sDate: string;
ini: TMemIniFile;
begin
- ini := TMemIniFile.Create(GikoSys.GetSentFileName);
- try
- sDate := IntToStr(GikoSys.DateTimeToInt(Now));
-
- ini.WriteString(sDate, 'Name', NameComboBox.Text);
- ini.WriteString(sDate, 'EMail', MailComboBox.Text);
- ini.WriteString(sDate, 'Body', HttpEncode(BodyEdit.Text));
- ini.WriteInteger(sDate, 'Status', FStatusCode);
- ini.WriteDateTime(sDate, 'Date', Now);
- if FThreadItem = nil then begin
- ini.WriteString(sDate, 'Title', MojuUtils.Sanitize(TitleEdit.Text));
- ini.WriteString(sDate, 'BBS', FBoard.BBSID);
- ini.WriteInteger(sDate, 'NewThread', 1);
- end else begin
- ini.WriteString(sDate, 'Title', FThreadItem.Title);
- ini.WriteString(sDate, 'BBS', FThreadItem.ParentBoard.BBSID);
- ini.WriteString(sDate, 'Key', ChangeFileExt(FThreadItem.FileName, ''));
- end;
-
- ini.UpdateFile;
- finally
- ini.Free;
- end;
+ ini := CreateSentIniFile;
+ if (ini <> nil) then begin
+ try
+ sDate := IntToStr(GikoSys.DateTimeToInt(Now));
+
+ ini.WriteString(sDate, 'Name', NameComboBox.Text);
+ ini.WriteString(sDate, 'EMail', MailComboBox.Text);
+ ini.WriteString(sDate, 'Body', HttpEncode(BodyEdit.Text));
+ ini.WriteInteger(sDate, 'Status', FStatusCode);
+ ini.WriteDateTime(sDate, 'Date', Now);
+ if FThreadItem = nil then begin
+ ini.WriteString(sDate, 'Title', MojuUtils.Sanitize(TitleEdit.Text));
+ //ini.WriteString(sDate, 'BBS', FBoard.BBSID);
+ ini.WriteString(sDate, 'URL', FBoard.URL);
+ ini.WriteInteger(sDate, 'NewThread', 1);
+ end else begin
+ ini.WriteString(sDate, 'Title', FThreadItem.Title);
+ //ini.WriteString(sDate, 'BBS', FThreadItem.ParentBoard.BBSID);
+ ini.WriteString(sDate, 'URL', FThreadItem.URL);
+ ini.WriteString(sDate, 'Key', ChangeFileExt(FThreadItem.FileName, ''));
+ end;
+
+ ini.UpdateFile;
+ finally
+ ini.Free;
+ end;
+ end;
+end;
+function TEditorForm.CreateSentIniFile: TMemIniFile;
+var
+ maxSize, fileSize, i: Integer;
+ newName: String;
+begin
+ Result := nil;
+ // MB -> bytes
+ maxSize := GikoSys.Setting.SentIniFileSize * 1024 * 1024;
+ // t@CTCYª0ÌêÍAsent.iniÉ«ÜÈ¢ÌÅnilðÔ·
+ if (maxSize > 0) then begin
+ fileSize := GikoSys.GetFileSize(GikoSys.Setting.GetSentFileName);
+ // ÅåTCYð´¦Ä¢½êÍl[·é
+ if (fileSize >= maxSize) then begin
+ i := 0;
+ // ¡Ìðt@C¼Ìãëɯé
+ repeat
+ // 10ñÈã¸sµ½ç «çßé
+ if (i > 10) then break;
+ DateTimeToString(newName, 'yyhhnnsszzz', Now());
+ Inc(i);
+ until RenameFile(GikoSys.Setting.GetSentFileName,
+ GikoSys.Setting.GetSentFileName + '.' + newName);
+ end;
+ Result := TMemIniFile.Create(GikoSys.Setting.GetSentFileName);
+ end;
end;
-
procedure TEditorForm.SendActionExecute(Sender: TObject);
+const
+ TITLE_SAMBA : string = 'Samba24x';
var
Board: TBoard;
rc: Integer;
@@ -1264,10 +1095,7 @@ begin
Application.ProcessMessages;
if not Check then Exit;
- if FThreadItem = nil then
- Board := FBoard
- else
- Board := FThreadItem.ParentBoard;
+ Board := GetBoard;
if FThreadItem = nil then begin
rc := GikoUtil.MsgBox(Handle,
@@ -1324,7 +1152,7 @@ begin
end;
end;
end else begin
- if not Timer1.Enabled then begin
+ if not FSambaTimer.Enabled then begin
if CompareDateTime(Board.Expires ,Now) <= 0 then begin
Board.Cookie := '';
Board.SPID := '';
@@ -1332,11 +1160,11 @@ begin
end;
Send(Board.Cookie, Board.SPID, Board.PON, True);
end else begin
- if not CheckSambaTime(FHost, Now()) then begin
+ if not FSambaTimer.CheckSambaTime(Now()) then begin
rc := GikoUtil.MsgBox(Handle,
'Samba24ÌKèl¢Ìbµ©oߵĢܹñB'#13#10
+ 'Mð~µÜ·©H' + #13#10
- + '(u¢¢¦v¾ÆMµÜ·)', 'Samba24x',
+ + '(u¢¢¦v¾ÆMµÜ·)', TITLE_SAMBA,
MB_YESNO or MB_ICONQUESTION);
if rc = IDYES then begin
FWork := false;
@@ -1345,7 +1173,7 @@ begin
if rc = IDNO then begin
rc2 := GikoUtil.MsgBox(Handle,
'{ÉMµÜ·©H',
- 'Sumba24x',
+ TITLE_SAMBA,
MB_YESNO or MB_ICONQUESTION);
if rc2 = IDNO then begin
FWork := False;
@@ -1363,8 +1191,9 @@ begin
end;
finally
FWork := False;
- if Timer1.Enabled then
- ReadSambaTime(FHost);
+ if FSambaTimer.Enabled then begin
+ FNow := FSambaTimer.Update;
+ end;
end;
end;
@@ -1547,85 +1376,13 @@ begin
end;
-procedure TEditorForm.Timer1Timer(Sender: TObject);
-begin
- if FSambaTime = ZERO_DATE then
- StatusBar.Panels[1].Text := ''
- else begin
- FNow := IncMilliSecond(FNow, 500);
- StatusBar.Panels[1].Text := Format('%8.0fboß', [SecondSpan(FNow, FSambaTime)]);
- end;
-
-end;
-//Samba.iniÌ«ÝÔðÇÝÞ
-procedure TEditorForm.ReadSambaTime(const AHost: string);
-var
- ini :TMemIniFile;
- tmp: string;
-begin
- Timer1.Enabled := false; //oßb\¦TimerðOffÉ·éi±êªONÌÆ«Samba24ÎôOnj
- ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
- try
- //¶ñÅÇÝæÁÄAÏ·ÖÅTDateTimeÖ
- tmp := ini.ReadString('Send', AHost, DateTimeToStr(ZERO_DATE));
- FSambaTime := ConvertDateTimeString(tmp);
- finally
- ini.Free;
- end;
- FNow := Now(); //»ÝÔðæ¾iTimer\¦pÅACheck·éÆ«ÍÄÑNow()ðÄÔj
- Timer1.Enabled := true; //oßb\¦TimerðOnÉ·éi±êªONÌÆ«Samba24ÎôOnj
-end;
-//Samba.iniÉÅI«ÝÔð«Þ
-procedure TEditorForm.WriteSambaTime(const AHost: string; ATime: TDateTime);
-var
- ini :TMemIniFile;
-begin
- ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
- try
- ini.WriteDateTime('Send', AHost, ATime);
- ini.UpdateFile;
- finally
- ini.Free;
- end;
-end;
-//ÅI«ÝÔÆ»Ýðär·éi^FKèlÈã@UFKèl¢j
-function TEditorForm.CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
-var
- pastsec: double;
- SettingTime: Integer;
-begin
- SettingTime := ReadSettingTime(AHost);
- ReadSambaTime(AHost);
- pastsec := SecondSpan(ATime, FSambaTime);
- if pastsec > SettingTime then
- Result := true
- else
- Result := false;
-end;
-//AHostiI¼jÌSambaÌKèlðÇÝÞ
-function TEditorForm.ReadSettingTime(const AHost: string): Integer;
-var
- ini :TMemIniFile;
-begin
- ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
- try
- Result := ini.ReadInteger('Setting', AHost, 0);
- //KèlªOÌÆ«AàµÍÝè³êĢȢƫÍAt@CÉ«½·B
- if Result = 0 then begin
- ini.WriteInteger('Setting', AHost, 0);
- ini.UpdateFile;
- end;
- //StatusBarɱÌIÌKèlð\¦·é
- StatusBar.Panels[2].Text := 'Samba24Kèl' + IntToStr(Result);
- finally
- ini.Free;
- end;
-end;
//FormªActiveÉÈÁ½çÅI«ÝÔðÇÝÞ
procedure TEditorForm.FormActivate(Sender: TObject);
begin
- if ( Timer1.Enabled ) and ( FThreadItem <> nil )then
- ReadSambaTime(FHost);
+ if ( FSambaTimer.Enabled ) and ( FThreadItem <> nil ) then
+ begin
+ FNow := FSambaTimer.Update;
+ end;
if GikoSys.Setting.GestureEnabled then begin
GikoSys.Setting.Gestures.ClearGesture;
GikoSys.Setting.Gestures.LoadGesture(
@@ -1637,63 +1394,12 @@ begin
MouseGesture.SetHook( Handle );
end;
end;
-//Samba24Îôðg¤©Ç¤©ßéÖ
-//ReadSambaTime ðÄÑo·ÆTimerªOnÉÈé
-procedure TEditorForm.SetSamba24(AURL: string);
-var
- Protocol, Host, Path, Document, Port, Bookmark : string;
-begin
- //Samba24ÎôðµÈ¢ÈçI¹
- if not GikoSys.Setting.UseSamba then
- Exit;
- //HostÌURLÉ'.2ch.'©'.bbspink.'ªÜÜêÄ¢½çSamba24Îôð·é
- GikoSys.ParseURI( AURL, Protocol,Host, Path, Document, Port, Bookmark );
- if GikoSys.Is2chHost(Host) then begin
- Host := Copy(Host, 1, AnsiPos('.', Host) - 1);
- FHost := Host; //FHost=I¼
- ReadSambaTime(FHost); //ÈOÌ«ÝÔðÇÝÞ
- ReadSettingTime(FHost); //SambaÌÝèðÇÝÞ
- end;
-end;
procedure TEditorForm.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose := not FWork;
end;
-function TEditorForm.GetOEIndentChar : string;
-var
- regKey : TRegistry;
- Identities : string;
- IndentChar : DWORD;
-const
- DEFAULT_CHAR = '> ';
- OE_MAIL_PATH = '\Software\Microsoft\Outlook Express\5.0\Mail';
- INDENT_CHAR = 'Indent Char';
-begin
-
- Result := DEFAULT_CHAR;
- regKey := TRegistry.Create;
- try
- try
- regKey.RootKey := HKEY_CURRENT_USER;
- if not regKey.OpenKey( 'Identities', False ) then
- Exit;
- Identities := regKey.ReadString( 'Default User ID' );
- if Identities = '' then
- Exit;
- if not regKey.OpenKey( Identities + OE_MAIL_PATH, False ) then
- Exit;
- IndentChar := regKey.ReadInteger( INDENT_CHAR );
- Result := Char( IndentChar ) + ' ';
- except
- end;
- finally
- regKey.Free;
- end;
-
-end;
-
procedure TEditorForm.QuotePasteActionExecute(Sender: TObject);
var
s : TStringList;
@@ -1701,7 +1407,7 @@ var
quote : string;
begin
- quote := GetOEIndentChar;
+ quote := GikoSys.GetOEIndentChar;
s := TStringList.Create;
try
s.Text := Clipboard.AsText;
@@ -1746,60 +1452,59 @@ end;
procedure TEditorForm.GetSETTINGTXTActionExecute(Sender: TObject);
var
+ memStream: TMemoryStream;
URL, RefURL: string;
settingBody: TStringList;
tmpBoard: TBoard;
begin
-
- InitIdHTTP(Indy);
- if FThreadItem = nil then
- tmpBoard := FBoard
- else
- tmpBoard := FThreadItem.ParentBoard;
-
- if tmpBoard = nil then Exit;
-
- RefURL := tmpBoard.URL;
- if RefURL[Length(RefURL)] <> '/' then
- URL := RefURL + '/' + 'SETTING.TXT'
- else
- URL := RefURL + 'SETTING.TXT';
-
- Indy.Request.LastModified := tmpBoard.SETTINGTXTTime;
- Indy.Request.Referer := RefURL;
- Screen.Cursor := crHourGlass;
- settingBody := TStringList.Create;
- try
- StatusBar.Panels[0].Text := 'SETTING.TXT_E[h';
- try
- IdAntiFreeze.Active := True;
- try
- settingBody.Text := Indy.Get(URL);
- finally
- IdAntiFreeze.Active := False;
- end;
- if( Indy.ResponseCode = 200 ) then begin
- settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName);
- tmpBoard.SETTINGTXTTime := Indy.Response.LastModified;
- tmpBoard.IsSETTINGTXT := true;
- tmpBoard.TitlePictureURL := GetTitlePictureURL(settingBody, tmpBoard);
- tmpBoard.Modified := true;
- StatusBar.Panels[0].Text := 'SETTING.TXTæ¾®¹(' + IntToStr(Indy.ResponseCode) + ')';
- end;
- except
- on E: EIdException do begin
- if( AnsiPos('304', E.Message) > 0 ) then
- StatusBar.Panels[0].Text := 'SETTING.TXTXV³µ(' + IntToStr(Indy.ResponseCode) + ')'
- else
- StatusBar.Panels[0].Text := 'SETTING.TXTæ¾G[(' + IntToStr(Indy.ResponseCode) + ')';
- end;
- end;
- finally
- settingBody.Free;
- Screen.Cursor := crDefault;
- end;
- ShowBoardInformation(tmpBoard, BoardInformationMemo);
-
+ if not FWork then begin
+ FWork := True;
+
+ tmpBoard := GetBoard;
+ if tmpBoard <> nil then begin
+
+ RefURL := tmpBoard.URL;
+ if RefURL[Length(RefURL)] <> '/' then
+ URL := RefURL + '/' + 'SETTING.TXT'
+ else
+ URL := RefURL + 'SETTING.TXT';
+ Screen.Cursor := crHourGlass;
+ memStream := TMemoryStream.Create;
+ try
+ try
+ StatusBar.Panels[0].Text := 'SETTING.TXT_E[h';
+ GetWebData(URL, RefURL, tmpBoard.SETTINGTXTTime, memStream);
+ if( Indy.ResponseCode = 200 ) then begin
+ settingBody := TStringList.Create;
+ try
+ memStream.Seek(0, soFromBeginning);
+ settingBody.LoadFromStream(memStream);
+ settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName);
+ tmpBoard.SETTINGTXTTime := Indy.Response.LastModified;
+ tmpBoard.IsSETTINGTXT := true;
+ tmpBoard.TitlePictureURL := GetTitlePictureURL(settingBody, tmpBoard);
+ tmpBoard.Modified := true;
+ finally
+ settingBody.Free;
+ end;
+ StatusBar.Panels[0].Text := 'SETTING.TXTæ¾®¹(' + IntToStr(Indy.ResponseCode) + ')';
+ end;
+ except
+ on E: EIdException do begin
+ if( AnsiPos('304', E.Message) > 0 ) then
+ StatusBar.Panels[0].Text := 'SETTING.TXTXV³µ(' + IntToStr(Indy.ResponseCode) + ')'
+ else
+ StatusBar.Panels[0].Text := 'SETTING.TXTæ¾G[(' + IntToStr(Indy.ResponseCode) + ')';
+ end;
+ end;
+ finally
+ memStream.Free;
+ Screen.Cursor := crDefault;
+ end;
+ ShowBoardInformation(tmpBoard, BoardInformationMemo);
+ end;
+ FWork := False;
+ end;
end;
procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
@@ -1858,6 +1563,10 @@ begin
else
GetTitlePictureAction.Enabled := FThreadItem.ParentBoard.IsSETTINGTXT;
+ if GetTitlePictureAction.Enabled Then begin
+ // ÀsÍÀssÂ
+ GetTitlePictureAction.Enabled := not FWork;
+ end;
end;
procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
@@ -1865,54 +1574,64 @@ var
memStream: TMemoryStream;
tmpBoard: TBoard;
begin
- if FWork then
+ if FWork then
Exit;
- FWork := True;
- InitIdHTTP(Indy);
+ FWork := True;
memStream := TMemoryStream.Create;
try
- if FThreadItem = nil then
- tmpBoard := FBoard
- else
- tmpBoard := FThreadItem.ParentBoard;
+ tmpBoard := GetBoard;
- Indy.Request.Referer := tmpBoard.URL;
- if tmpBoard.TitlePictureURL <> '' then begin
+ if (tmpBoard <> nil) and (tmpBoard.TitlePictureURL <> '') then begin
StatusBar.Panels[0].Text := 'Âgbvæ_E[h';
Screen.Cursor := crHourGlass;
try
- IdAntiFreeze.Active := True;
- try
- Indy.Get(tmpBoard.TitlePictureURL, memStream);
- finally
- IdAntiFreeze.Active := False;
- end;
+ // URLðwèµÄÉÇÝÞ
+ GetWebData(tmpBoard.TitlePictureURL, tmpBoard.URL,
+ ZERO_DATE, memStream);
if Indy.ResponseCode = 200 then begin
memStream.SaveToFile(tmpBoard.GetTitlePictureFileName);
ShowTitlePicture();
tmpBoard.Modified := true;
end;
+ StatusBar.Panels[0].Text := 'Âgbvæ (' + IntToStr(Indy.ResponseCode) + ')';
except
end;
end;
finally
- Screen.Cursor := crDefault;
- StatusBar.Panels[0].Text := 'Âgbvæ (' + IntToStr(Indy.ResponseCode) + ')';
memStream.Free;
+ FWork := False;
+ Screen.Cursor := crDefault;
end;
+end;
+{
+\brief URLÌf[^ðstreamÉÇÝÞ
+\param URL ÇÝÞæ
+\param RefURL refererÉÝè·é
+\param Modified ModifiedÉÝè·é
+\param stream ÇÝñ¾f[^ÌÛ¶æ
+}
+procedure TEditorForm.GetWebData(const URL: string; const RefURL: string;
+ Modified: TDateTime; stream: TStream);
+begin
+ InitIdHTTP(Indy);
+ Indy.Request.Referer := RefURL;
+ Indy.Request.LastModified := Modified;
+
+ IdAntiFreeze.Active := True;
+ try
+ Indy.Get(URL, stream);
+ finally
+ IdAntiFreeze.Active := False;
+ end;
- FWork := False;
end;
procedure TEditorForm.ShowTitlePicture();
var
tmpBoard: TBoard;
s: String;
begin
- if FThreadItem = nil then
- tmpBoard := FBoard
- else
- tmpBoard := FThreadItem.ParentBoard;
+ tmpBoard := GetBoard;
if FileExists(tmpBoard.GetTitlePictureFileName) then begin
TitlePictureBrowser.Navigate(tmpBoard.GetTitlePictureFileName);
@@ -1942,71 +1661,64 @@ var
URL, RefURL: string;
settingBody: TStringList;
tmpBoard: TBoard;
+ memStream: TMemoryStream;
begin
- if FWork then
- Exit;
+ if not FWork then begin
FWork := True;
- InitIdHTTP(Indy);
- if FThreadItem = nil then
- tmpBoard := FBoard
- else
- tmpBoard := FThreadItem.ParentBoard;
-
- if tmpBoard = nil then Exit;
-
- RefURL := tmpBoard.URL;
- if RefURL[Length(RefURL)] <> '/' then
- URL := RefURL + '/' + 'head.txt'
- else
- URL := RefURL + 'head.txt';
-
- if FileExists(tmpBoard.GETHEADTXTFileName) then
- Indy.Request.LastModified := tmpBoard.HEADTXTTime
- else
- Indy.Request.LastModified := ZERO_DATE;
-
- Indy.Request.Referer := RefURL;
- Screen.Cursor := crHourGlass;
- settingBody := TStringList.Create;
- try
- StatusBar.Panels[0].Text := '[J[(head.txt)_E[h';
- try
- IdAntiFreeze.Active := True;
- try
- settingBody.Text := Indy.Get(URL);
- finally
- IdAntiFreeze.Active := False;
- end;
- if( Indy.ResponseCode = 200 ) then begin
- settingBody.Insert(0, '');
- settingBody.Insert(1, '');
- settingBody.Insert(2, '' + tmpBoard.Title + '');
- settingBody.Insert(3, '');
- settingBody.Add('');
- settingBody.SaveToFile(tmpBoard.GETHEADTXTFileName);
- tmpBoard.HEADTXTTime := Indy.Response.LastModified;
- tmpBoard.IsHEADTXT := true;
- tmpBoard.Modified := true;
- StatusBar.Panels[0].Text := '[J[æ¾®¹(' + IntToStr(Indy.ResponseCode) + ')';
- end;
- except
- on E: EIdException do begin
- if( AnsiPos('304', E.Message) > 0 ) then
- StatusBar.Panels[0].Text := '[J[XV³µ(' + IntToStr(Indy.ResponseCode) + ')'
- else
- StatusBar.Panels[0].Text := '[J[æ¾G[(' + IntToStr(Indy.ResponseCode) + ')';
- end;
- end;
- finally
- settingBody.Free;
- Screen.Cursor := crDefault;
- end;
- if tmpBoard.IsHEADTXT then begin
+ tmpBoard := GetBoard;
+ if (tmpBoard <> nil) then begin
+
+ RefURL := tmpBoard.URL;
+ if RefURL[Length(RefURL)] <> '/' then
+ URL := RefURL + '/' + 'head.txt'
+ else
+ URL := RefURL + 'head.txt';
+
+ Screen.Cursor := crHourGlass;
+ memStream := TMemoryStream.Create;
+ try
+ StatusBar.Panels[0].Text := '[J[(head.txt)_E[h';
+ try
+ GetWebData(URL, RefURL, tmpBoard.HEADTXTTime, memStream);
+ if( Indy.ResponseCode = 200 ) then begin
+ settingBody := TStringList.Create;
+ try
+ memStream.Seek(0, soFromBeginning);
+ settingBody.LoadFromStream(memStream);
+ settingBody.Insert(0, '');
+ settingBody.Insert(1, '');
+ settingBody.Insert(2, '' + tmpBoard.Title + '');
+ settingBody.Insert(3, '');
+ settingBody.Add('');
+ settingBody.SaveToFile(tmpBoard.GETHEADTXTFileName);
+ tmpBoard.HEADTXTTime := Indy.Response.LastModified;
+ tmpBoard.IsHEADTXT := true;
+ tmpBoard.Modified := true;
+ finally
+ settingBody.Free;
+ end;
+ StatusBar.Panels[0].Text := '[J[æ¾®¹(' + IntToStr(Indy.ResponseCode) + ')';
+ end;
+ except
+ on E: EIdException do begin
+ if( AnsiPos('304', E.Message) > 0 ) then
+ StatusBar.Panels[0].Text := '[J[XV³µ(' + IntToStr(Indy.ResponseCode) + ')'
+ else
+ StatusBar.Panels[0].Text := '[J[æ¾G[(' + IntToStr(Indy.ResponseCode) + ')';
+ end;
+ end;
+ finally
+ memStream.Free;
+ Screen.Cursor := crDefault;
+ end;
+ if tmpBoard.IsHEADTXT then begin
ShowBoardHead(tmpboard, LocalEdit);
- end;
-
+ end;
+ end;
FWork := False;
+ end;
+
end;
procedure TEditorForm.CalcCapacityActionExecute(Sender: TObject);
@@ -2016,10 +1728,7 @@ var
begin
body := GetBody;
//ǤàAüsª¸êĽÁÛ¢¯ÇA{©æª©çÈ¢B
- if FThreadItem = nil then
- Board := FBoard
- else
- Board := FThreadItem.ParentBoard;
+ Board := GetBoard;
if Board.BoardPlugIn <> nil then
body := CustomStringReplace(body, #13#10, '
')
@@ -2030,12 +1739,13 @@ end;
procedure TEditorForm.LocalRuleClick(Sender: TObject);
var
- ini: TIniFile;
+ ini: TMemIniFile;
begin
- ini := TIniFile.Create(GikoSys.Setting.GetFileName);
+ ini := TMemIniFile.Create(GikoSys.Setting.GetFileName);
try
RocalRuleTab.TabVisible := LocalRule.Checked;
ini.WriteBool('EditorForm', 'LocalRuleTab', RocalRuleTab.TabVisible);
+ ini.UpdateFile;
finally
ini.Free;
end;
@@ -2076,6 +1786,7 @@ var
Action: TAction;
begin
s := MouseGesture.GetGestureStr;
+ MouseGesture.Clear;
Action := GikoSys.Setting.Gestures.GetGestureAction(s);
if Action <> nil then
Action.Execute;
@@ -2106,10 +1817,7 @@ var
URL: String;
ABoard: TBoard;
begin
- if FThreadItem = nil then
- ABoard := FBoard
- else
- ABoard := FThreadItem.ParentBoard;
+ ABoard := GetBoard;
if ABoard = nil then Exit;
@@ -2123,12 +1831,14 @@ begin
KotehanCheckBox.Enabled := SaveNameMailAction.Checked;
end;
-function TEditorForm.LFusianaGet(s: String): Boolean;
+function TEditorForm.LFusianaGet(const s: String): Boolean;
+const
+ FUSIANA = 'fusianasan';
var
i: Integer;
begin
- i := AnsiPos('fusianasan', s);
- if (i > 0) then Result := True else Result := False;
+ i := AnsiPos(FUSIANA, s);
+ Result := (i > 0);
end;
procedure TEditorForm.BeLogInOutEActionExecute(Sender: TObject);
@@ -2170,7 +1880,7 @@ begin
end else if( AnsiPos(VAL_PON, val) > 0 ) then begin
ABoard.PON := Copy(val, AnsiPos(VAL_PON, val) + Length(VAL_PON), Length(val));
end else begin
- ABoard.Cookie := val + '; ';
+ ABoard.Cookie := ABoard.Cookie + val + '; ';
end;
//expiresðØèo·
val := Trim(GikoSys.GetTokenIndex(tmp, ';', 1));
@@ -2181,24 +1891,11 @@ begin
end;
end;
-//! SambaÌÝèlðXV·é
-procedure TEditorForm.UpdateSamba(const AHost: String; value: Integer);
-var
- ini :TMemIniFile;
-begin
- ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
- try
- ini.WriteInteger('Setting', AHost, value);
- ini.UpdateFile;
- finally
- ini.Free;
- end;
-end;
//! ToXVÌANVÌUpdateCxg@ÈP̽ß^C}[Ư¶ÉµÄ¨
procedure TEditorForm.UpdateSambaActionUpdate(Sender: TObject);
begin
- UpdateSambaAction.Enabled := Timer1.Enabled;
+ UpdateSambaAction.Enabled := FSambaTimer.Enabled;
end;
//! ToXVANV
@@ -2210,14 +1907,14 @@ begin
if InputQuery('Samba24ÝèlXV', 'Vµ¢Ýèlðü͵ľ³¢', input) then begin
input := ZenToHan(input);
if GikoSys.IsNumeric(input) then begin
- UpdateSamba(FHost, StrToInt(input));
- //SÄÌtH[©çA¯¶zXgÌGfB^ÉÇÝÝw¦
+ FSambaTimer.UpdateSambaSetting(StrToInt(input));
+ UpdateSambaStatus;
+ //SÄÌtH[©çASamba^C}[ðXV·é
for i := 0 to Screen.FormCount - 1 do begin
if Screen.Forms[i] is TEditorForm then begin
- if FHost = TEditorForm(Screen.Forms[i]).FHost then begin
- TEditorForm(Screen.Forms[i]).ReadSettingTime(FHost);
- end;
- end;
+ TEditorForm(Screen.Forms[i]).FSambaTimer.Update;
+ TEditorForm(Screen.Forms[i]).UpdateSambaStatus;
+ end;
end;
end else begin
ShowMessage('lðü͵ľ³¢');
@@ -2226,6 +1923,14 @@ begin
end;
end;
+procedure TEditorForm.UpdateSambaStatus;
+begin
+ if (FSambaTimer.Enabled) then begin
+ StatusBar.Panels[2].Text
+ := 'Samba24Kèl' + IntToStr(FSambaTimer.SambaInterval);
+ end;
+end;
+
procedure TEditorForm.InputAssistActionExecute(Sender: TObject);
var
count, i : Integer;
@@ -2404,5 +2109,248 @@ begin
form.Release;
end;
end;
+//! Cookieîñí
+procedure TEditorForm.ReleaseCookieActionExecute(Sender: TObject);
+var
+ Board : TBoard;
+begin
+ // Xbhª³¢@X§ÄÌÆ«ÍFBoardð¼Úg¤
+ Board := GetBoard;
+
+ // NbL[ÌîñðÌÄé
+ Board.Cookie := '';
+ Board.SPID := '';
+ Board.PON := '';
+ // 0ɪ«ß·
+ Board.Expires := 0;
+end;
+//! Âîñæ¾UpdateCxg
+procedure TEditorForm.GetSETTINGTXTActionUpdate(Sender: TObject);
+begin
+ // ÀsÍÀssÂ
+ GetSETTINGTXTAction.Enabled := not FWork;
+end;
+//! [J[æ¾UpdateCxg
+procedure TEditorForm.GetHeadTXTActionUpdate(Sender: TObject);
+begin
+ // ÀsÍÀssÂ
+ GetSETTINGTXTAction.Enabled := not FWork;
+end;
+
+//! Samba^C}[Cxg
+procedure TEditorForm.SambaTimer(Sender: TObject);
+begin
+
+ if FSambaTimer.WriteDeta = ZERO_DATE then
+ StatusBar.Panels[1].Text := ''
+ else begin
+ FNow := IncMilliSecond(FNow, 500);
+ StatusBar.Panels[1].Text :=
+ Format('%8.0fboß', [SecondSpan(FNow, FSambaTimer.WriteDeta)]);
+ end;
+end;
+{
+\brief EBhEÌÊuÆTCYÌÝè
+}
+procedure TEditorForm.SetWindowRect;
+var
+ wp: TWindowPlacement;
+begin
+ //EBhEÌÊuÝè
+ wp.length := sizeof(wp);
+ wp.rcNormalPosition.Top := GikoSys.Setting.EditWindowTop;
+ wp.rcNormalPosition.Left := GikoSys.Setting.EditWindowLeft;
+
+ wp.rcNormalPosition.Bottom := GikoSys.Setting.EditWindowTop + GikoSys.Setting.EditWindowHeight;
+ wp.rcNormalPosition.Right := GikoSys.Setting.EditWindowLeft + GikoSys.Setting.EditWindowWidth;
+ wp.showCmd := SW_HIDE;
+ SetWindowPlacement(Handle, @wp);
+
+ if GikoSys.Setting.EditWindowMax then begin
+ WindowState := wsMaximized;
+ end;
+
+ //EBhEªæÊOÈçæÊàÉÚ®·é
+ if (Left + Width) > Screen.Width then begin
+ Left := 0;
+ end;
+ if (Top + Height) > Screen.Height then begin
+ Top := 0;
+ end;
+ if Left < 0 then begin
+ Left := 0;
+ end;
+ if Top < 0 then begin
+ Top := 0;
+ end;
+
+ //»ÝÌEBhEÌÊuðÛ¶
+ GikoSys.Setting.EditWindowTop := Top + WINDOWMOVE_V; // ÉJEBhEÍ
+ GikoSys.Setting.EditWindowLeft := Left + WINDOWMOVE_H; // @@@EÎߺɸç·
+ //EBhEÌƳª¬³·¬¢êγÉß·
+ if GikoSys.Setting.EditWindowHeight < 144 then begin
+ Height := 400;
+ end;
+ if GikoSys.Setting.EditWindowWidth < 144 then begin
+ Width := 640;
+ end;
+end;
+{
+\brief g£^uÝè
+}
+procedure TEditorForm.SetExtraTab;
+const
+ SECTION = 'EditorForm';
+var
+ ini: TMemIniFile;
+begin
+ ini := TMemIniFile.Create(GikoSys.Setting.GetFileName);
+ try
+ BoardtopTab.TabVisible := ini.Readbool(SECTION, 'BoardTopTab', False);
+ BoardTop.Checked := BoardtopTab.TabVisible;
+ RocalRuleTab.TabVisible := ini.ReadBool(SECTION, 'LocalRuleTab', False);
+ LocalRule.Checked := RocalRuleTab.TabVisible;
+ finally
+ ini.Free;
+ end;
+end;
+{
+\brief Âæ¾
+\return XGfB^ªeµæ¤ÆµÄ¢éÂ
+}
+function TEditorForm.GetBoard : TBoard;
+begin
+ // XbhACeªnullÌÍFBoard
+ if FThreadItem = nil then begin
+ Result := FBoard;
+ end else begin
+ Result := FThreadItem.ParentBoard;
+ end;
+end;
+{
+\brief GikoFormÉbZ[WðÇÁ·é
+\param icon bZ[WÉÂACR
+}
+procedure TEditorForm.AddFormMessageNew(icon: TGikoMessageIcon);
+begin
+ if FThreadItem = nil then begin
+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, icon)
+ end else begin
+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, icon);
+ end;
+
+end;
+{
+\brief [Jfusianagbv
+\return true:M~ false:M
+}
+function TEditorForm.isLocalFusianaTrap: Boolean;
+var
+ Namae : string;
+begin
+ Result := False;
+ if GikoSys.Setting.LocalTrapAtt then begin
+ Namae := THTMLCreate.RepHtml(NameComboBox.Text);
+ if (LFusianaGet(Namae)) or (Namae = 'RèÂ') then begin
+ if FusianaMsgBox = IDNO then begin
+ Result := True;
+ end;
+ end;
+ end;
+end;
+{
+\brief [gfusianagbv
+\return true:M~ false:M
+}
+function TEditorForm.isRemoteFusianaTrap: Boolean;
+var
+ Namae : string;
+ Board : TBoard;
+ Remote: string;
+ body : TStringList;
+begin
+ Result := False;
+ Namae := THTMLCreate.RepHtml(NameComboBox.Text);
+ if (GikoSys.Setting.RemoteTrapAtt) and (Length(Namae) = 0) then begin
+ Board := GetBoard;
+
+ if Board = nil then Exit;
+
+ if not FileExists(Board.GetSETTINGTXTFileName) then begin
+ //Setting.txtªÈ©Á½çæ¾
+ //IÉת©©è»¤...
+ try
+ GetSETTINGTXTAction.Execute;
+ except
+ end;
+ end;
+
+ Remote := '';
+ if FileExists(Board.GetSETTINGTXTFileName) then begin
+ body := TStringList.Create;
+ try
+ body.LoadFromFile(Board.GetSETTINGTXTFileName);
+ Remote := GetFusianaName(body, Board);
+ finally
+ body.Free;
+ end;
+ end;
+
+ if LFusianaGet(Remote) then begin
+ if FusianaMsgBox = IDNO then begin
+ Result := True;
+ end;
+ end;
+ end;
+end;
+{
+\brief Header¶ñæ¾
+\param ACOOKIE Cookie
+\param SPID SPID
+\param PON PON
+\param Board Â
+\return Header¶ñ
+}
+function TEditorForm.getHeaderStr(const ACOOKIE: string; const SPID : string;
+ const PON : string; Board : TBoard) : string;
+begin
+ Result := ACOOKIE;
+ if SPID <> '' then
+ Result := Result + 'SPID=' + SPID + '; ';
+ if PON <> '' then
+ Result := Result + 'PON=' + PON + '; ';
+
+ //zXgª2chÅABeÉLoginµÄ¢êÎBEÌf[^ðé
+ //GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
+ //if GikoSys.Is2chHost(Host) and GikoSys.Setting.BeLogin then
+ if (Board.Is2ch) then begin
+ // ÅèÌNbL[ª êÎHí¹é
+ if Length(GikoSys.Setting.FixedCookie) > 0 then begin
+ // zXgª2chÌêCÅèÌNbL[ðHí¹é
+ Result := Result + GikoSys.Setting.FixedCookie + '; ';
+ end;
+ if (GikoSys.Setting.BeLogin) then begin
+ Result := Result + 'MDMD=' + GikoSys.Setting.BeCode + '; '
+ + 'DMDM=' + GikoSys.Setting.BeUserID + '; ';
+ end;
+
+ end;
+
+ Result := 'Cookie: ' + Result + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
+
+end;
+{
+\brief fusianax_CAO
+\return IDYES «Þ IDNO ~
+}
+function TEditorForm.FusianaMsgBox: Integer;
+const
+ MSG_FUSIANA : string = '[gzXgð\¦·é@\ªgíêĢܷ'#13#10 +
+ 'àµàÔáÁıÌû@ÅzXgª\¦³ê½ÆµÄàA©ÈÓCÈÌÅíËÉͶܹñB' +
+ #13#10#13#10'ÓCð¤±Æð³øµÄ«ÝÜ·©H';
+begin
+ Result := MsgBox(Handle, MSG_FUSIANA, 'îñ',
+ MB_YESNO or MB_ICONQUESTION);
+end;
end.