随笔分类 - Delphi
摘要:DELPHI XE6 FMX 附件:http://files.cnblogs.com/xe2011/IDHttp_fmx.7z 1 unit Unit1; 2 3 interface 4 5 uses 6 //引用 Vcl.ExtActns 7 Vcl.ExtActns, 8 9 System.Sy
阅读全文
摘要:程序:http://files.cnblogs.com/xe2011/EXE_iWeb2014-4-9-185315.7z源码:http://files.cnblogs.com/xe2011/Pascal_iWeb2014-4-9-185315.7z 1 function CaptureScreenRect(ARect: TRect): TBitmap; 2 var 3 ScreenDC: HDC; // 设备描述表的句柄 4 begin 5 result := TBitmap.Create; 6 with result, ARect do 7 begin 8 Widt...
阅读全文
摘要:procedure CloseGameSver();var H1, h2: HWND;begin H1 := FindWindow('TForm1', nil); h2 := FindWindowEx(H1, 0, 'ConsoleWindowClass', nil); // ShowMessage(Inttostr(h2)); SendMessage(h2, WM_CLOSE, 0, 0);end;
阅读全文
摘要:uses ShellApi;procedure TForm1.Button1Click(Sender: TObject);var filename, Path: string;begin filename := 'D:\WmgjServer146\server\start.bat'; Path := ExtractFilePath(filename); SetCurrentDir(Path); ShellExecute(Handle, 'open', PWideChar(filename), 'run', nil, SW_SHOWNORMAL);
阅读全文
摘要:附件:http://files.cnblogs.com/xe2011/OnMinsize.rarunit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls;type TForm1 = class(TForm) TrayIcon1: TTrayIcon; procedure TrayIcon1Click(Sender: TObject); private procedure OnMinsize(v...
阅读全文
摘要://判断文件是否正在被使用 function FileINUse(filename:String):boolean;var usein:file;begin result:=false; assignfile(usein,FileName); try reset(Usein); except on E:EInOutError do begin if e.ErrorCode=32 then begin result:=true; exit; end; end; end; closefile(usein...
阅读全文
摘要:WINDOWS发送消息This function sends the specified message to a window or windows. SendMessage calls the window procedure for the specified window and does not return until the window procedure has processed the message. The PostMessage function, in contrast, posts a message to a thread's message queu
阅读全文
摘要:获取一个文件夹下的所有文件 //不包括文件夹里面的文件 获取一个文件夹下的所有文件 //包括文件夹里面的文件
阅读全文
摘要:方法1procedure TForm2.Button1Click(Sender: TObject);var Pt: TPoint;begin GetCursorPos(Pt); PopupMenu1.Popup(Pt.X, Pt.Y);end;方法2设置控件的DropDownMenu 为右键单击(可手动设置) 这个功能只对ToolBar的 Button有效PopMenu为右键单击procedure TForm1.Button1Click(Sender: TObject);begin ToolButton1.DropdownMenu := PopupMenu1;end;
阅读全文
摘要:选中第5行//转到指定行并选中这行的文本procedure SelectLine(Memo1: TMemo; ln: Integer);begin Memo1.SelStart := SendMessage(Memo1.Handle, EM_LINEINDEX, ln - 1, 0); Memo1.SelLength := Length(Memo1.Lines[ln - 1]);end;http://bbs.csdn.net/topics/110143548//将滚动条定位到指定行procedure ScrollToLine(Memo1: TMemo; ln: Integer);begin..
阅读全文
摘要:EXE:http://files.cnblogs.com/xe2011/Text_EditorRelease2013-12-20-185320.rarDelphi XE5 PAS:http://files.cnblogs.com/xe2011/Text_Editor_Pascal2013-12-20-185320.rar字符处理单元 1 // 字符串处理功能 2 3 unit StringFunctions; 4 5 interface 6 7 uses 8 Windows, Messages, SysUtils, Variants, Classes, Forms, ...
阅读全文
摘要:EXE: http://files.cnblogs.com/xe2011/FamousWord-Release-2013-12-22-113350.rarPASCAL: http://files.cnblogs.com/xe2011/FamousWord-Pascal-2013-12-22-113350.rarDELPHI XE5【2013年12月21日 19:10:12】【2013-12-20 23:01:37】【2013-12-20 18:01:37】 1 unit Unit2; 2 3 interface 4 5 uses 6 Winapi.Windows, Win...
阅读全文
摘要:http://files.cnblogs.com/xe2011/ScreenLight_pas.rar窗体文件object Form1: TForm1 Left = 0 Top = 0 Caption = 'Form1' ClientHeight = 220 ClientWidth = 447 Color = clBtnFace TransparentColor = True TransparentColorValue = clPurple Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Heig...
阅读全文
摘要://光标在控件不同位置时的样式 //改变控件的大小 使用
阅读全文
摘要:下面这2种方法都能实现对控件和窗体的拖拽 方法1
阅读全文
摘要:http://files.cnblogs.com/xe2011/StringToColor.rarunit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Butt...
阅读全文
摘要:附件 http://download.csdn.net/detail/teststudio/6575241主窗体UNITunit MainForm;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls;type TFormMain = class(TForm) Button2: TButton; Button1: TButton; Panel1: TPanel; p...
阅读全文
摘要:uses CommCtrl, httpApp, ShellApi;{GetWebPath(WebBrowser1);}function GetWebPath(web: TWebBrowser): string;var item: TLvItem; clsName: array [0 .. MAX_PATH] of char; hwndLv: HWND; selCount, fileCount, selMark: Integer; fileName: array [0 .. MAX_PATH] of char;begin hwndLv := GetWindow(web.Handle, GW_CH
阅读全文
摘要:繁体与简体之间的转换DELPHI XE5测试通过 http://download.csdn.net/detail/teststudio/6464553 类unit SimpleConvert;interfaceuses Classes, Windows;type TTraditional = class(TObject) public function ConvertComplex(Text: String): AnsiString; function ConvertSimple(Text: String): AnsiString; end;implementation{ ...
阅读全文
摘要:http://files.cnblogs.com/xe2011/VCL_TColorPB12.rar在DELPHI7中可以正常使用 在DELPHI XE5中 下面会有些问题安装方法 打开 DELPHI 新建 - Package选中Package.BPL,右键 ADD找到本并添加.PAS源文件选中Package.BPL,右键 Compile选中Package.BPL,右键 Instal 卸载这个组件的时候,找到这个安装包 选中Package.BPL,右键 UnInstal 说明TColorPickerButton is a special speed button which can be us
阅读全文