본문 바로가기

분류 전체보기

(88)
[일반/컴포넌트] 파일의 변경/생성/사용한 날짜 바꾸기 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure SetModifyDate(fName, fDate: string); var Age, FHand..
[윈도우즈 API] window의 maximize, minimize 알아내기 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } procedure wmWindowposchanging( var msg: TWMWindowposchanging ); message wm_windowposchanging; public { Public declarations } end; var Form1: TForm1; imple..
[시스템] drive의 일련번호 바꾸기 >How can I change floppy serial number (e.g. 1111-2222) in Delphi 4? [1] Borland TI 475D, Getting and setting a disks serial number http://www.borland.com/devsupport/delphi/ti_list/TI475D.html [2] The volume serial number is stored in bytes 39-42 of the boot sector on the disk. So, the basic approach looks like this: type TSector = array[0..511] of Byte; procedure ChangeVolumeSerialNumber(Drive:..
[윈도우즈 API] 작업관리자의 task switching 금지시키기 // Alt+Tab 으로 프로그램 전환을 금지하는 예제입니다 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; OldValue: Longint; i..
[일반/컴포넌트] 파일에서 특정 Byte 모두 찾기 // AFilename : 파일명 // AByte: 검색할 Byte // AList: 찾은 위치 리스트 // 리턴값: 찾은 갯수 function FindByteInFile(AFilename: string; AByte: byte; AList: TList): Integer; var contents: string; curPos: PChar; p: integer; theByte: char; theFile: TFileStream; begin theFile := TFileStream.Create(AFileName, fmOpenRead); try if theFile.Size > 0 then begin theByte := char(AByte); SetLength(contents, theFile.Size); theFil..
[윈도우즈 API] 정의되지 않은 Alt+키 입력시 Beep음 제거 // 아래 예제는 Alt+C 에 버튼이 반응하는 간단한 예제인데 // Alt+C 이외의 단른 조합이 입력되면 beep 음이 발생하는데 // 이를 제거하는 소스입니다 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } Proced..
[일반/컴포넌트] RichEdit에서 HTML 태그를 다른색으로 표시하기 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, Richedit; type TForm1 = class(TForm) RichEdit1: TRichEdit; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure RichEditHTMLTagPickUp(RichEdit: TRi..
[윈도우즈 API] 윈도우즈 "시작" 메뉴 표시하기/감추기 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} // 윈도우즈 "시작" 메뉴 표시하기 procedu..