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->HandleNeeded 6 、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中窗体的初始化有两种情况,动态创建, ...
随机推荐
- Java 实现模板方法(TemplateMethod)模式
类图 /** * 业务流程模板.提供基本框架 * @author stone * */ public abstract class BaseTemplate { public abstract voi ...
- SQLiteDatabase中query、insert、update、delete方法参数说明
1.SQLiteDataBase对象的query()接口: public Cursor query (String table, String[] columns, String selection, ...
- java Map根据value排序
通用方法 public class MapUtil { public static <K, V extends Comparable<? super V>> Map<K, ...
- cpu、内存、磁盘
例一:内存使用率 #!/bin/bash total=$(free -m|grep Mem|awk '{print $2}') used=$(free -m|grep Mem|awk '{print ...
- 【Java】各种软件安装与环境配置的失败
又来到了java的世界,看了一段时间的视频.感觉太空虚,便从网上找到一个教程.想做几个demo试试,少不了的前期准备:Java开发环境配置,Eclipse JSP/Servlet 环境搭建等. ...
- search-a-2d-matrix——二维矩阵找数
题目描述 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the ...
- 未能从程序集“Oracle.ManagedDataAccess”加载 “OracleInternal.Common.ConfigBaseClass”
使用VS2015做项目的过程中一直使用的服务器上的oracle数据库,后来想学习一下oracle,就在本机安装了oracle.可没想到本来运行好好的项目,现在不能运行了.项目是使用的Abp框架,当运行 ...
- spring异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet
spring异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet 情况 ...
- String、StringBuffer、StringBuilder区别并验证
© 版权声明:本文为博主原创文章,转载请注明出处 String.StringBuffer.StringBuilder的区别 1.String是一个常量,其对象一旦创建完毕就无法改变,当使用“+”拼接字 ...
- android开发系列之aidl
aidl在android开发中的主要作用就是跨进程通讯来着,说到进程相比很多人都是非常熟悉了,但是为什么会有跨进程通讯这个概念呢?原来在android系统中,有这么一套安全机制,为了各个Apk数据的独 ...