Delphi窗体研究,留个爪,以后回来研究
Delphi - 窗体创建过程
来自大富翁.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
1、TCustomForm.Create 在 TCustomForm.Create 中调用 TCustomForm.CreateNew;2、TCustomForm.CreateNew; 调用 FCanvas := TControlCanvas.Create; 触发 TControlCanvas.Create; 触发 TControlCanvas.CreateHandle;3、TControlCanvas.CreateHandle; 调用 FControl.GetDeviceContext(FWindowHandle); 即 TWinControl.GetDeviceContext(FWindowHandle);4、TWinControl.GetDeviceContext(FWindowHandle); 调用 TWinControl.GetDC(Handle);此处说明一下: 对 TWinControl 的 Handle 属性的读取会触发 TWinControl.GetHandle;可以察看 Property Handle; 的声明。5、第四步中对 Handle 进行读取,触发下述序列:(TWinControl) Handle->GetHandle->HandleNeeded6、TWinControl.HandleNeeded 检查 FHandle 的值: if FHandle = 0 then begin if Parent <> nil then Parent.HandleNeeded; CreateHandle; // 调用 CreateHandle; end;7、TWinControl.CreateHandle 调用 CreateWnd; if FHandle = 0 then // 此时 FHandle 仍然为零 begin CreateWnd; ... end;8、TWinControl.CreateWnd 调用 CreateParams(Params); // 让用户有机会加入新的特征参数 CreateParams(Params); with Params do begin ... // 标准的 API 使用,注册窗口类,CreateWindowEx ... if Windows.RegisterClass(WindowClass) = 0 then RaiseLastWin32Error; ... CreateWindowHandle(Params); ... end;9、CreateWindowHandle(Params); FHandle := CreateWindowEx(ExStyle, WinClassName, Caption, Style, X, Y, Width, Height, WndParent, 0, WindowClass.hInstance, Param); 完成真正的窗口创建,并赋予 FHandle 窗口句柄。10、回到第一步 CreateNew 之后调用 DoCreate try CreateNew(AOwner); ... if OldCreateOrder then DoCreate; finally ... end;11、DoCreate 调用用户的 OnCreate 事件: if Assigned(FOnCreate) then try FOnCreate(Self); // 调用 OnCreate; except Application.HandleException(Self); end; if fsVisible in FFormState then Visible := True; |
我们OnCreate事件最后才触发的.
http://www.cnblogs.com/huangjacky/archive/2010/01/08/1642413.html
Delphi窗体研究,留个爪,以后回来研究的更多相关文章
- delphi 窗体透明
TransparentColor:=true; TransparentColorValue:=clFuchsia; Color:= TransparentColorValue; ...
- Delphi窗体创建释放过程及单元文件小结(转)
Delphi窗体创建释放过程及单元文件小结 Delphi中的窗体,有模式窗体与非模式窗体两种.两种窗体的调用方式不同,模式窗体使用ShowModal显示,非模式窗体使用Show显示.当显示模式窗体的时 ...
- delphi 窗体自适应屏幕分辨率
delphi 窗体自适应屏幕分辨率 这是个困惑我很长时间的问题,到今天终于得到解决了. 话说Delphi有个很强的窗体设计器,这一点让VC粉丝垂涎三尺而不可得.但是,Delphi里设计的窗体并没有自动 ...
- 解决Delphi窗体缩放の疑难杂症
http://anony3721.blog.163.com/blog/static/511974201082235754423/ 解决Delphi窗体缩放の疑难杂症 2010-09-22 15:57: ...
- Delphi 窗体函数GetWindow
Delphi 窗体函数GetWindowGetWindow是计算机的函数,该函数返回与指定窗口有特定关系(如Z序或所有者)的窗口句柄,函数原型是HWND GetWindow(HWND hWnd,UIN ...
- delphi 窗体的位置和高宽度-TForm:Letf、Top、Width、Height、ClientWidth、ClientHeight
delphi 窗体的位置和高宽度-TForm:Letf.Top.Width.Height.ClientWidth.ClientHeight [窗体的高度和宽度]: [客户区的高度和宽度]: [窗体在屏 ...
- 绘制delphi窗体的标题栏
绘制delphi窗体的标题栏 按照设计,Delphi窗体的“标题”属性是由Windows负责绘制,标题栏在系统菜单旁边.如果你不想改变窗体的标题属性又想在窗体的标题栏添加一些自己的内容,你需要处理一个 ...
- switch留个爪,之后还需要再研究下
public class SwitchDemo { public static void main (String [] args) { for(int i = 0; i < 10; i++) ...
- delphi 窗体的创建和释放
Delphi中的窗体分为模式窗体和无模式窗体.二者的区别在于,用户可以在无模式窗体和其他窗体之间切换.这样,用户就可以同时工作于一个应用程序的几个部分.Delphi中窗体的初始化有两种情况,动态创建, ...
随机推荐
- 一步一步学习Unity3d学习笔记系1.3 英雄联盟服务器集群架构猜想
说到了网游那就涉及到服务器了,时下最火的属英雄联盟了,我也是它的粉丝,每周必撸一把,都说小撸怡情,大撸伤身,强撸灰飞烟灭,也告诫一下同仁们,注意身体,那么他的服务器架构是什么呢,给大家分享一下, 具体 ...
- iOS uitableivewCell 下划线顶格
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath ...
- MySQL的四种变量类型
一.全局变量在系统运行期间动态更改其参数,重启后失效.SET GLOABL var=XXX;SET @@global.var=XXX;以上两种方式等效 查看系统的全局变量show global var ...
- ACM-百度之星资格赛之Labyrinth——hdu4826
Labyrinth Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- JavaWeb Session详解
代码地址如下:http://www.demodashi.com/demo/12756.html 记得把这几点描述好咯:代码实现过程 + 项目文件结构截图 + ## Session的由来 上一篇博文介绍 ...
- 把数据库里面的stu表中的数据,导出到excel中
# 2.写代码实现,把我的数据库里面的stu表中的数据,导出到excel中 #编号 名字 性别 # 需求分析:# 1.连接好数据库,写好SQL,查到数据 [[1,'name1','男'],[1,'na ...
- Storm/Cassandra集成错误:NoSuchMethodError: concurrent.Futures.withFallback
本文原文出处: http://blog.csdn.net/bluishglc/article/details/50443205 严禁不论什么形式的转载.否则将托付CSDN官方维护权益. 2015年的最 ...
- elasticsearch 单节点实现
一.安装java环境,这么不说了,一般用源码安装,配置好环境变量 二.新建es用户和组,es不能用root启动 三.下载需要的稳定版es 四.解压安装es .zip /opt/app/ es / 五. ...
- appium 学习和环境搭建
官方网站: http://appium.io/ 1.安装各大开发环境:Nodejs. python .java 和 android 环境,并且配置环境变量. ✔ The Node.js binary ...
- Selenium3.X 与 Javascript (Nodejs)
传送门 # 官网网站 http://docs.seleniumhq.org/download/ # API DOC http://goo.gl/hohAut # 慕课网教程http://www.imo ...