procedure TWinControl.DefaultHandler(var Message); begin if FHandle <> 0 then begin with TMessage(Message) do begin if (Msg = WM_CONTEXTMENU) and (Par Read More
posted @ 2016-02-25 23:39 findumars Views(912) Comments(0) Diggs(0)
定义和创建: TWinControl = class(TControl) private FBrush: TBrush; end; constructor TWinControl.Create(AOwner: TComponent); begin inherited Create(AOwner); Read More
posted @ 2016-02-25 22:47 findumars Views(398) Comments(0) Diggs(0)
先擦除背景: procedure TCustomForm.WMEraseBkgnd(var Message: TWMEraseBkgnd); begin if not IsIconic(Handle) then inherited else begin Message.Msg := WM_ICONE Read More
posted @ 2016-02-25 22:32 findumars Views(593) Comments(0) Diggs(0)
声明如下: TCustomPanel = class(TCustomControl) private FFullRepaint: Boolean; FParentBackgroundSet: Boolean; procedure CMCtl3DChanged(var Message: TMessag Read More
posted @ 2016-02-25 22:14 findumars Views(518) Comments(0) Diggs(0)
我忽然发现:TButton既没有处理WM_PAINT,又没有Paint()或者PaintWindow(),那么它是什么时候被绘制的? Form1上放2个TButton,然后设置代码: 在Form1第一次显示时,应该会让这两个Button显示。这两个Button应该会处理WM_PAINT并显示。可是完 Read More
posted @ 2016-02-25 21:06 findumars Views(661) Comments(0) Diggs(0)
GetCursorPos/WindowFromPoint/SendMessage (用API函数向Edit框发送字符) GetCursorPos(mPoint); DTWND:=WindowFromPoint(mPoint); SendMessage(dtwnd, WM_IME_CHAR,ord(' Read More
posted @ 2016-02-25 19:17 findumars Views(904) Comments(0) Diggs(0)
SetWindowLong函数介绍 收藏 SetWindowLong函数介绍 SetWindowLong Unicode 函数原型 LONG SetWindowLong(hwnd,nIndex,lNewLong) HWND hwnd; /* handle of window */ int nInde Read More
posted @ 2016-02-25 19:12 findumars Views(2369) Comments(0) Diggs(0)
句柄概念在WINDOWS编程中是一个很重要的概念,在许多地方都扮演着重要的角色。但由此而产生的句柄概念也大同小异,比如:<<Microsoft Windows 3 Developer's Workshop>>(Microsoft Press,by Richard Wilton)一书中句柄的概念是:在 Read More
posted @ 2016-02-25 19:10 findumars Views(2390) Comments(0) Diggs(0)
unit uThreadPool;{ aPool.AddRequest(TMyRequest.Create(RequestParam1, RequestParam2, ...)); }interfaceuses Windows, Classes;// 是否记录日志// {$DEFINE NOLOGS Read More
posted @ 2016-02-25 19:09 findumars Views(1069) Comments(0) Diggs(0)
DELPHI 通過窗口句柄或窗口标题得到进程句柄2009年05月08日 星期五 10:15procedure TForm1.Button1Click(Sender: TObject);varhWindow: HWND; { 窗体句柄 }dwProcessID: DWORD; { 进程 ID }hPr Read More
posted @ 2016-02-25 19:06 findumars Views(620) Comments(0) Diggs(0)
TObject = class //创建 constructor Create; //释放 procedure Free; //初始化实列 class function InitInstance(Instance: Pointer): TObject; //清除实列 procedure Cleanu Read More
posted @ 2016-02-25 19:04 findumars Views(607) Comments(0) Diggs(0)
delphi指针简单入门: 看一个指针用法的例子: 1 var 2 X, Y: Integer; // X and Y 整数类型 3 P: ^Integer; // P 指向整数类型的指针 4 begin 5 X :=17; // 给 X 赋值 6 P := @X; // 把 x的地址赋给p 7 Y Read More
posted @ 2016-02-25 19:03 findumars Views(6001) Comments(0) Diggs(0)
我发现了一篇发表在1999.11.29 b13版的 《令win32应用程序跳入系统层》东南大学 卢威 luwei@126.com 是用vc++嵌汇编做的, 很接近了,可试试 BCB或DELPHI进入Ring0 东南大学卢威1999.12发表在<<计算机世界>>报上的一篇 <<WIN32跳入系统0层> Read More
posted @ 2016-02-25 19:02 findumars Views(599) Comments(0) Diggs(0)
设置PageControl的owndraw属性为TRUE. procedure TForm1.pgc1DrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); var cc: Read More
posted @ 2016-02-25 18:59 findumars Views(510) Comments(0) Diggs(0)
Navigation: 数据类型相关 > Delphi 的字符及字符串 > [3] - String 中的秘密 //String 的指针地址及实际的内存地址 var str: string; pstr: PString; pc: PChar; begin {在没有给 str 赋值以前, 既然声明了, Read More
posted @ 2016-02-25 18:54 findumars Views(468) Comments(0) Diggs(0)
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,TypInfo,ObjAuto; type TForm1 = Read More
posted @ 2016-02-25 18:50 findumars Views(1221) Comments(0) Diggs(0)
去年我花了很多时间尝试用DELPHI进行基于XML的WEB应用开发。起初的设想是很美好的,但结果做出来的东西很简陋。一部分原因就在于XML到Object之间的数据绑定实现太麻烦(另一部分是因为对XSLT不熟,学习它花了很多时间)。 之前我一直是用DELPHI提供的XML Data binding来做 Read More
posted @ 2016-02-25 18:48 findumars Views(1051) Comments(1) Diggs(0)
通过崩溃地址找错误行数之Delphi版2009-5-11 17:42:35 来源: 转载 作者:网络 访问:360 次 被顶:2 次 字号:【大 中 小】核心提示:什么是 MAP 文件?简单地讲, MAP 文件是程序的全局符号、源文件和代码行号信息的唯一的文本表示方法,它可以在任何地方、任何时候使用 Read More
posted @ 2016-02-25 18:47 findumars Views(606) Comments(0) Diggs(0)
在delphi中,数据集是最常用数据存取方式。因此,必须建立JSON与TDataSet之间的互转关系,实现数据之间通讯与转换。值得注意的是,这只是普通的TDataset与JSON之间转换,由于CDS包含了Delta数据包,其数据格式远比普通的TDataset更复杂。数据集字段信息,是一个完整的字典信 Read More
posted @ 2016-02-25 18:45 findumars Views(1234) Comments(0) Diggs(0)
在delphi中,数据集是最常用数据存取方式。因此,必须建立JSON与TDataSet之间的互转关系,实现数据之间通讯与转换。值得注意的是,这只是普通的TDataset与JSON之间转换,由于CDS包含了Delta数据包,其数据格式远比普通的TDataset更复杂。 数据集字段信息,是一个完整的字典 Read More
posted @ 2016-02-25 18:44 findumars Views(10151) Comments(0) Diggs(0)
Delphi是基于PASCAL语言的Windows编程工具,功能十分强大。然而在Delphi的帮助文件中,对Windows API函数的说明沿袭了 VC 的格式,和VC一样,对很多API函数的用法没有举例子详细说明,对一些深入系统内部的API函数更是语焉不详,给编程者带来不便。笔者仅就在Window Read More
posted @ 2016-02-25 18:43 findumars Views(3242) Comments(0) Diggs(0)
在《强大的DELPHI RTTI--兼谈需要了解多种开发语言》一文中,我说了一下我用DELPHI的RTTI实现了数据集的简单对象化。本文将详细介绍一下我的实现方法。 首先从一个简单的例子说起:假设有一个ADODataSet控件,连接罗斯文数据库,SQL为: select * from Employe Read More
posted @ 2016-02-25 18:42 findumars Views(1951) Comments(0) Diggs(0)
unit Unit1; interface usesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, shellapi, StdCtrls; type TForm1 = class(TForm) Mem Read More
posted @ 2016-02-25 18:39 findumars Views(1462) Comments(0) Diggs(0)
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, mmsystem; type TForm1 = class Read More
posted @ 2016-02-25 18:38 findumars Views(2080) Comments(0) Diggs(0)
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin ReleaseCapture; Perform(WM_SYSCOMMAND,$ Read More
posted @ 2016-02-25 18:37 findumars Views(424) Comments(0) Diggs(0)
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Pr Read More
posted @ 2016-02-25 18:36 findumars Views(583) Comments(0) Diggs(0)
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private decl Read More
posted @ 2016-02-25 18:34 findumars Views(284) Comments(0) Diggs(0)
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLab Read More
posted @ 2016-02-25 18:33 findumars Views(533) Comments(0) Diggs(0)
我一直认为Delphi功能与C++相比毫不逊色,提供了丰富的控件和类、全部API以及嵌入的汇编。最近小弟在把C版的Huffman压缩改用Delphi写时,顺便“研究”了一下Delphi的位操作和嵌入式汇编,利用嵌入汇编我们可以得到高效的程序代码,完成一些Delphi没有提供的底层功能。借贵报一方宝地 Read More
posted @ 2016-02-25 18:32 findumars Views(1304) Comments(0) Diggs(0)
服务程序增加系统托盘 用Delphi创建服务程序 作者:未知 文章来源:岁月联盟 Windows 2000/XP和2003等支持一种叫做"服务程序"的东西.程序作为服务启动有以下几个好处: (1)不用登陆进系统即可运行. (2)具有SYSTEM特权.所以你在进程管理器里面是无法结束它的. 笔者在20 Read More
posted @ 2016-02-25 18:31 findumars Views(806) Comments(0) Diggs(0)
正文:很多木马生成器就是用的内存流和文件流生成客户端的,废话不多说了,代码如下: unit Main;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, Std Read More
posted @ 2016-02-25 18:30 findumars Views(1094) Comments(0) Diggs(0)
Windows 2000/XP和2003等支持一种叫做"服务程序"的东西.程序作为服务启动有以下几个好处:(1)不用登陆进系统即可运行.(2)具有SYSTEM特权.所以你在进程管理器里面是无法结束它的.笔者在2003年为一公司开发机顶盒项目的时候,曾经写过课件上传和媒体服务,下面就介绍一下如何用De Read More
posted @ 2016-02-25 18:28 findumars Views(3793) Comments(0) Diggs(0)
最近在写一个框架,需要用到反射,与C# java这些原生支持反射的语言不同,delphi对反射的支持相对要弱一些,但也够用了,其实C#的大部分的思想还是从 delphi而来,毕竟都是安德鲁斯的杰作。 这是只谈想法,不谈实现。Delphi7里其实就有对反射的支持了,typInfo,objAuto。基本 Read More
posted @ 2016-02-25 18:27 findumars Views(1098) Comments(0) Diggs(0)
虽然用delphi也有7,8年了,但大部分时间还是用在系统的架构上,对delphi底层还是一知半解,今天在网上看到一篇文章写得很好,虽然是07年的,但仍有借鉴的价值。 现摘录如下: Delphi程序设计之--经验技巧 这些日子太忙了,今天把剩下的部分贴完,希望对大家有用。看过前一篇的都知道此文的作者 Read More
posted @ 2016-02-25 18:25 findumars Views(1718) Comments(0) Diggs(0)
function TForm1.ShowMethodAddress(aObj: TDerived; const sData: String) : Pointer;var aPtr : Pointer; sResult : String;begin try aPtr := aObj.MethodAdd Read More
posted @ 2016-02-25 18:24 findumars Views(578) Comments(0) Diggs(0)
procedure TForm1.pnl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin ReleaseCapture;SendMessage(pnl1.Handle, Read More
posted @ 2016-02-25 18:22 findumars Views(856) Comments(0) Diggs(0)
前言 COM已经成为一个必需的东西了。在我们周围,可以说处处充满了COM – 如果你是在使用WINDOWS,并在其下面编写程序的话。然而,无论你是用VC,还是使用DELPHI进行COM编程时,在大多数情况下,编程工具的 IDE已经向你隐藏了COM的大部分实现过程,使得程序员根本不需要了解COM,只专 Read More
posted @ 2016-02-25 18:21 findumars Views(4888) Comments(0) Diggs(0)
program PMyWindowClass; uses Windows, Messages, SysUtils; type TMyWindow = class(TObject) private { Private declarations } WindowClass: WndClass; hWin Read More
posted @ 2016-02-25 18:20 findumars Views(405) Comments(0) Diggs(0)
class function TObject.MethodAddress(const Name: ShortString): Pointer;asm { -> EAX Pointer to class } { EDX Pointer to name } PUSH EBX PUSH ESI PUSH Read More
posted @ 2016-02-25 18:19 findumars Views(471) Comments(0) Diggs(0)
使用以CreateOleObjects方式调用Word 实际上还是Ole,但是这种方式能够真正做到完全控制Word文件,能够使用Word的所有属性,包括自己编写的VBA宏代码。----------------------------------------- Word宏编辑器Word能够真正地进行V Read More
posted @ 2016-02-25 18:16 findumars Views(7854) Comments(0) Diggs(0)
unit uMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, RzTabs, Menus; type TFrmMain = class(TF Read More
posted @ 2016-02-25 18:12 findumars Views(1998) Comments(0) Diggs(0)
自从Delphi2010后,Delphi中的Rtti功能得到了增强。我们终于可以不用先RegisterClass,再GetClass获取类的信息了。而只是简单的通过TRttiContext.GetType或FindType来获取类,进而创建对象。虽然跟C#中的Rtti相比,还有些差距,不过这已经算是 Read More
posted @ 2016-02-25 18:10 findumars Views(524) Comments(0) Diggs(0)
1.MouseMove事件中加入: // ReleaseCapture;// Perform(WM_SYSCOMMAND, $F017 , 0); 2.MouseDown事件中加入: // POSTMESSAGE(Self.Handle,WM_LBUTTONUP,0,0);// POSTMESSAG Read More
posted @ 2016-02-25 18:00 findumars Views(4853) Comments(0) Diggs(0)