答案是:在线程中出现没处理的异常时,线程会自动终止。以前刚看到别人的代码时候,十分惊讶,try catch几乎成了最主要的语句了,还以为是因为代码风格,或者更严谨一些的原因。到今天才明白,原来还不是这个原因,是因为线程出现异常,满盘出错(线程的一个执行步骤分为整整28步,有些步骤甚至还包含一些小的步... Read More
posted @ 2015-12-02 06:43 findumars Views(932) Comments(0) Diggs(0)
procedure TForm1.pnl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin ReleaseCapture;SendMessage(pnl1.Handl... Read More
posted @ 2015-12-02 06:41 findumars Views(581) Comments(0) Diggs(0)
判断头几个字节:function IsJpegFile(FileName: string): Boolean;constRightBuf : array[0..3] of Byte = ($FF,$D8,$FF,$D9);varBuf: array[0..3] of Byte;beginFillCh... Read More
posted @ 2015-12-02 06:34 findumars Views(792) Comments(0) Diggs(0)
unit Unit1;interfaceusesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;typeTForm1 = class(TForm)private{ Private declaration... Read More
posted @ 2015-12-02 06:30 findumars Views(617) Comments(0) Diggs(0)
最近帮朋友做一个软件,其中要自动化某网页中的操作,最简的操作是调用自己写的代码。代码如下:procedure TForm1.Button2Click(Sender: TObject);var i:integer; h:IHTMLHeaderElement; o:OleVariant;begin o:... Read More
posted @ 2015-12-02 06:26 findumars Views(647) Comments(0) Diggs(0)