11 2008 档案
学点 C 语言(28): 数据类型 - 联合(union)
摘要:在结构中, 每个字段的数据类型是唯一的; 使用联合可以在一个字段中储存不同的数据类型. 不同的数据类型共享一块内存. 当然其内存大小应依着大的来. 联合中的数据, 非此即彼, 只有一个有效; 应该有说明在某个数据中此时有用的是什么类型. 除了共享内存以外, 联合与结构一样. 1. union 的大小是其中最大数据成员的大小: #include int main(void) { ... 阅读全文
posted @ 2008-11-28 22:17 万一 阅读(2189) 评论(0) 推荐(0) 编辑
学点 C 语言(27): 数据类型 - 结构中的 "位字段"
摘要:所有基础的数据类型, 最大的也不过 10 个字节; 我们可以自定义的数据类型 -- "结构", 通过把若干类型组合在一起, 让一种类型可以大很多. 我们知道, 一个字节有八个 Bit 组成; 能否把一种类型缩小、缩小到 Bit 级? 结构中的 "位字段" 是以 Bit 为单位的, 这已经是计算机的最小单位, 大小是 char 类型的 1/8. 下面的例子中定义的位字段, 分别有 1-4 B... 阅读全文
posted @ 2008-11-28 21:40 万一 阅读(2534) 评论(3) 推荐(0) 编辑
学点 C 语言(26): 数据类型 - 结构的更多可能
摘要:1. 包含数组的结构: #include int main(void) { struct Rec { int x[3]; int y; } r1; r1.x[0] = 11; r1.x[1] = 22; r1.x[2] = 33; r1.y = 99; printf("%d,%d,%d,%d", r1.x[0], r... 阅读全文
posted @ 2008-11-28 17:23 万一 阅读(1350) 评论(0) 推荐(0) 编辑
学点 C 语言(25): 数据类型 - 结构数组与结构指针
摘要:1. 结构数组: #include int main(void) { struct Rec {int x,y;}; struct Rec rs[10]; size_t i; for (i = 0; i #include int main(void) { struct Rec { char name[12]; ... 阅读全文
posted @ 2008-11-28 14:35 万一 阅读(1985) 评论(0) 推荐(0) 编辑
学点 C 语言(24): 数据类型 - 结构(struct)
摘要:1. 结构就是多个变量的集合: #include int main(void) { struct Rec { int x; int y; }; struct Rec r1; r1.x = 111; r1.y = 222; printf("%d, %d", r1.x, r1.y); getc... 阅读全文
posted @ 2008-11-28 13:45 万一 阅读(2514) 评论(2) 推荐(0) 编辑
学点 C 语言(23): 数据类型 - 给指针分配内存
摘要:C 语言的内存分配很简单: malloc、calloc、realloc、free malloc(字节数); 返回内存段的首地址, void 的. calloc(个数, 类型大小); 和 malloc 的区别就是它会初始化内存为空. realloc(原指针, 字节数); 重新分配由 malloc、calloc 分配的内存; 这里有太多注意事项: 1、如果缩小了, 会截掉一块, 会保留前面的内... 阅读全文
posted @ 2008-11-28 11:09 万一 阅读(1892) 评论(0) 推荐(0) 编辑
学点 C 语言(22): 数据类型 - 多维数组与指针
摘要:1. 关于数组的首地址: #include int main(void) { char cs[2][3] = { {'A','B','C'}, {'D','E','F'} }; char *p1,*p2,*p3,*p4; p1 = p2 =... 阅读全文
posted @ 2008-11-28 07:52 万一 阅读(1777) 评论(0) 推荐(0) 编辑
学点 C 语言(21): 数据类型 - 数组与指针
摘要:1. 获取数组的地址无须 &, 因为数组名本身就是个地址 #include int main(void) { char c = 'A'; char cs[] = "ABC"; printf("%c, %s\n", c, cs); /* 获取字符及字符数组的内容 */ printf("%p, %p, %p\n", &c, cs, &cs);... 阅读全文
posted @ 2008-11-27 22:10 万一 阅读(1646) 评论(0) 推荐(0) 编辑
重写一个字符串分割函数 - 回复 "tomzw" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/27/967440.html#1384363 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;... 阅读全文
posted @ 2008-11-27 21:11 万一 阅读(6138) 评论(13) 推荐(0) 编辑
学点 C 语言(20): 数据类型 - 指针
摘要:1. 通过 &变量 可以获取变量地址: #include int main(void) { int num = 10; printf("变量值: %d\n", num); printf("变量址: %d\n", &num); getchar(); return 0; } 2. 表示变量地址的变量就是指针: #include int ma... 阅读全文
posted @ 2008-11-27 19:44 万一 阅读(1871) 评论(0) 推荐(0) 编辑
学点 C 语言(19): 数据类型 - 数组
摘要:1. 数组的标志是 []: #include int main(void) { int nums[3]; nums[0] = 11; nums[1] = 22; nums[2] = 33; printf("%d, %d, %d", nums[0], nums[1], nums[2]); getchar(); return ... 阅读全文
posted @ 2008-11-27 18:32 万一 阅读(1740) 评论(0) 推荐(0) 编辑
学点 C 语言(18): 数据类型 - 枚举类型(enum)
摘要:1. printf 枚举可显示枚举的序号: #include int main(void) { enum ABC{AAA,BBB,CCC}; enum ABC e1,e2,e3; e1 = AAA; e2 = BBB; e3 = CCC; printf("%d, %d, %d\n", e1, e2, e3); getcha... 阅读全文
posted @ 2008-11-27 14:00 万一 阅读(1862) 评论(0) 推荐(0) 编辑
学点 C 语言(17): 数据类型 - 因类型引发的问题或错误
摘要:1. 运算结果超出类型大小: #include #include int main(void) { short s1 = SHRT_MAX; short s2 = SHRT_MAX; short num1; int num2; /* 不会是期望的值 */ num1 = s1 + s2; printf("%d\n", num1); ... 阅读全文
posted @ 2008-11-27 13:38 万一 阅读(1468) 评论(0) 推荐(0) 编辑
学点 C 语言(16): 数据类型 - 关于常量的前缀、后缀
摘要:曾经对 float num = 3.14f; 这样的赋值非常疑惑, 其实现在也不明白. 既然说明了是 float 类型, 又何必在 3.14 后面挂个 f 呢? 书上说: int num = 100; 一个整数常量将默认为 int 类型(除非常数有后缀或超出了 int 的范围) double num = 3.14; 一个浮点数常量将默认为 double 类型 并要求: long ... 阅读全文
posted @ 2008-11-27 12:18 万一 阅读(3599) 评论(2) 推荐(0) 编辑
学点 C 语言(15): 数据类型 - sizeof(检测类型大小)
摘要:获取类型大小的变量最好不是 int 类型, 而是 size_t 类型; size_t 在 stdio.h、stddef.h 都有定义. 1. 获取已知类型的大小: #include #include int main(void) { char n = 2; size_t size; size = sizeof(char); printf("%*u: ... 阅读全文
posted @ 2008-11-27 10:47 万一 阅读(2693) 评论(0) 推荐(0) 编辑
学点 C 语言(14): 数据类型 - 双字节字符类型 wchar_t
摘要:在 C 语言中, char 类型永远都是一个字节, 双字节字符类型是 wchar_t; 但它不是内置类型, 定义在 stddef.h. 给 wchar_t 类型的字符或字符数组(也就是字符串)赋值要冠以 L; 格式化输出(如 printf) wchar_t 类型的字符串, 要用 %S(而非 %s) 标识. #include #include int main(void) { ... 阅读全文
posted @ 2008-11-27 10:22 万一 阅读(2789) 评论(0) 推荐(0) 编辑
学点 C 语言(13): 数据类型 - 整型、字符型和浮点型的扩展
摘要:整型 int 可添加 short 和 long: short int: 简为 short; long int: 简为 long; long long int: 简为 long long 它们都可以再添加 unsigned: unsigned int: 简为 unsigned unsigned short int: 简为 unsigned shor... 阅读全文
posted @ 2008-11-27 09:52 万一 阅读(1993) 评论(0) 推荐(0) 编辑
学点 C 语言(12): 数据类型 - 整型(int)、字符(char)、浮点(float、double)
摘要:C 语言数据类型: 基本类型、构造类型、指针类型、空类型. 基本类型又包括: 整型、字符、浮点(单精度、双精度)、枚举. 构造类型又包括: 数组、结构体、公用体. 1. 显示整型(int)的最小、最大值: #include #include int main(void) { int n1,n2; n1 = INT_MIN; n2 = INT_MAX; ... 阅读全文
posted @ 2008-11-27 09:07 万一 阅读(3850) 评论(0) 推荐(0) 编辑
学点 C 语言(11): goto 语句
摘要:例1: #include #include int main(void) { char str[256]; scanf("%s", str); if (strlen(str) 例2: #include int main(void) { int i = 0; while (1) { i++; printf... 阅读全文
posted @ 2008-11-26 21:59 万一 阅读(2184) 评论(0) 推荐(0) 编辑
学点 C 语言(10): switch 语句
摘要:1. 常规: #include int main(void) { int i; for (i = 0; i 2. 省略 default: #include int main(void) { int i; for (i = 0; i 3. 相同结果: #include int main(void) { int i; for... 阅读全文
posted @ 2008-11-26 18:10 万一 阅读(3306) 评论(0) 推荐(0) 编辑
两个结构体可以直接赋值吗? - 回复 "JohnsonAnother" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/26/1031787.html#1382525 两个结构体可以直接赋值!, 测试如下: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,... 阅读全文
posted @ 2008-11-26 15:46 万一 阅读(5157) 评论(8) 推荐(1) 编辑
学点 C 语言(9): if 语句
摘要:1. 常规: #include int main(void) { int i; for (i = 0; i #include int main(void) { int i; for (i = 0; i 4) printf("%d\n", i); else printf("*\n")... 阅读全文
posted @ 2008-11-26 13:04 万一 阅读(3070) 评论(3) 推荐(0) 编辑
学点 C 语言(8): while 与 do while 循环
摘要:1. while 循环: #include int main(void) { int i=0; while (i 2. do while 循环: #include int main(void) { int i=0; do { i++; printf("%d\n", i); ... 阅读全文
posted @ 2008-11-26 12:11 万一 阅读(2370) 评论(7) 推荐(0) 编辑
学点 C 语言(7): for 循环
摘要:1. for 循环的基本形式: #include int main(void) { int i; for (i = 0; i 2. 步长: #include int main(void) { int i; for (i = 0; i 3. 递减: #include int main(void) { int i; for ... 阅读全文
posted @ 2008-11-26 10:29 万一 阅读(3645) 评论(26) 推荐(0) 编辑
学点 C 语言(3): 转义字符
摘要:\n //换行 \r //回车 \b //退格 \f //换页 \t //水平制表符 \v //垂直制表符 \a //响声 \" //双引号 \' //单引号 \x?? //用小写 x 和两位数字(十六进制数)表示一个字符 \??? //用三位数字(八进制)表示一个字符 例1: #include int main(void)... 阅读全文
posted @ 2008-11-26 10:21 万一 阅读(3006) 评论(5) 推荐(0) 编辑
如何实现一张图片覆盖窗体 - 回复 "客栈老人" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/25/1339604.html#1381839 方法1: 用 TImage unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dia... 阅读全文
posted @ 2008-11-25 21:42 万一 阅读(1791) 评论(1) 推荐(0) 编辑
Byte 数组转字符串 - 回复 "不知道" 问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/23/1339323.html#1379150 var bs: array[0..25] of Byte; s: string; i: Integer; begin for i := 0 to Length(bs) - 1 do bs[i] := 65+i; s := strin... 阅读全文
posted @ 2008-11-23 22:57 万一 阅读(5050) 评论(22) 推荐(0) 编辑
汉字与多字节编码的转换 - 回复 "不知道" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/22/1284923.html#1378410 Delphi 2009 默认的编码是多字节编码(MBCS), Delphi 这样表示它: TEncoding.Default. 下面是多字节编码与汉字之间转换的例子: unit Unit1; interface uses Windows, ... 阅读全文
posted @ 2008-11-23 12:31 万一 阅读(6220) 评论(19) 推荐(0) 编辑
设置屏幕分辨率的函数 - 回复 "董勇" 的问题
摘要:{函数} function SetScreen(x,y: Word): Boolean; var DevMode: TDeviceMode; begin Result := EnumDisplaySettings(nil, 0, DevMode); if Result then begin DevMode.dmFields := DM_PELSWIDTH or DM_P... 阅读全文
posted @ 2008-11-19 17:14 万一 阅读(2976) 评论(24) 推荐(0) 编辑
获取各种编码的识别符
摘要:下面是常用编码的识别符, 在 Delphi(2009) 中如何获取呢? Unicode: FF FE; BigEndianUnicode: FE FF; UTF8: EF BB BF var bs: TBytes; b: Byte; str: string; begin {只有 Unicode、BigEndianUnicode、UTF8 编码有识别符} bs := TEnc... 阅读全文
posted @ 2008-11-19 16:42 万一 阅读(8511) 评论(5) 推荐(0) 编辑
汉字与区位码(2) - 分析
摘要:在没有 Uncode 的时代, 用 256 个 ACSII 只是方便了英文, 其他文字怎么办? 那时是各自为政的, 譬如中文就有: GB2312-80(国内简体)、Big5(台湾繁体)、HKSCS(香港繁体), 但它们互不兼容. GB2312(1980年) 后来升级到 GBK(1995年), 现在电脑上使用的是 GB18030(2000年), 这个系列是向后兼容的. 区位码的概念是在 GB... 阅读全文
posted @ 2008-11-19 10:41 万一 阅读(6910) 评论(1) 推荐(0) 编辑
汉字与区位码(1) - 转换函数
摘要:先上转换函数: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2... 阅读全文
posted @ 2008-11-19 10:14 万一 阅读(7664) 评论(4) 推荐(1) 编辑
一个可以显示多边形的 TMyShape 类 - 回复 "董勇" 的问题
摘要:测试效果图: 自定义的 MyShape 单元: unit MyShape; interface uses Windows, Classes, Graphics, Controls; type TMyShapeType = (stRectangle, stSquare, stRoundRect, stRoundSquare, stEllipse, stCircle, st... 阅读全文
posted @ 2008-11-18 13:13 万一 阅读(1881) 评论(0) 推荐(0) 编辑
Delphi 的内存操作函数(6): 跨进程的内存分配
摘要:Delphi 为我们提供了三个方便的函数: GlobalAllocPtr {简化自 API 的 GlobalAlloc} GlobalReAllocPtr {简化自 API 的 GlobalReAlloc} GlobalFreePtr {简化自 API 的 GlobalFree} 读写本程序以外的数据时可以使用它们, 很方便, 譬如: p := GlobalAllocPtr(0... 阅读全文
posted @ 2008-11-15 18:50 万一 阅读(8451) 评论(4) 推荐(1) 编辑
Delphi 中的 IfThen 函数 - 回复 "深挖洞、广积粮" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/14/1120015.html#1370413 StrUtils 单元和 Math 单元 分别有一个 IfThen 函数, 举例: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Grap... 阅读全文
posted @ 2008-11-14 15:23 万一 阅读(9793) 评论(4) 推荐(0) 编辑
Delphi 的内存操作函数(5): 复制内存
摘要:MoveMemory、CopyMemory 的功能类似, 都是复制内存, 都是调用 Move 过程;MoveMemory、CopyMemory 操作指针; Move 操作实体.还要注意, 它们的参数位置不一样!举例:{例1}var buf1,buf2: array[0..9] of AnsiChar;begin buf1 := '0123456789'; buf2 := 'abcdefghij'; Move(buf2[2], buf1[4], 5); ShowMessage(buf1); {0123cdefg9} ShowMessage(buf2); {abcd 阅读全文
posted @ 2008-11-14 12:59 万一 阅读(20806) 评论(9) 推荐(0) 编辑
Delphi 的内存操作函数(4): 清空与填充内存
摘要:FillMemory、ZeroMemory 一目了然的两个函数, 但其实它们都是调用了 FillChar; 清空不过就是填充空字符(#0: 编号为 0 的字符), 说来说去是一回事. 为了下面的测试, 先写一个以十六进制方式查看内存的函数: function GetMemBytes(var X; size: Integer): string; var pb: PByte; i: I... 阅读全文
posted @ 2008-11-14 11:44 万一 阅读(15883) 评论(5) 推荐(0) 编辑
在 Delphi 2009 中, for in 循环都能用在什么地方?
摘要:一、遍历 TStrings var List: TStrings; s: string; begin List := TStringList.Create; List.CommaText := 'aaa,bbb,ccc'; for s in List do ShowMessage(s); List.Free; end; 二、遍历数组 var A... 阅读全文
posted @ 2008-11-12 13:43 万一 阅读(11285) 评论(9) 推荐(0) 编辑
写在博客一周年
摘要:去年的今天 - 2007 年 11 月 12 日, 发现并来到博客园, 从此 --- 一点点零零碎碎的时间得以积累; 博客园首页上眼花缭乱的新文章展示着技术的进步和大家的追求, 让我感觉是生活在跑道上; 也有朋友说从博客上有所受益, 这是在 2007 年 11 月 12 日 没有想到的, 所以深感欣慰. 在今天这个对我来讲值得纪念的日子里, 让我真诚地 --- 感谢 dudu 的博客园给我提供的... 阅读全文
posted @ 2008-11-12 10:02 万一 阅读(2029) 评论(20) 推荐(0) 编辑
Delphi 的内存操作函数(3): 给结构体指针分配内存
摘要:使用结构或结构数组, 一般是不需要主动分配内存的, 譬如: var pts: TPoint; begin pts.X := 1; pts.Y := 2; ShowMessageFmt('%d,%d', [pts.X, pts.Y]); {1,2} end; //结构数组: var Arr: array[0..2] of TPoint; i: Integer; begin... 阅读全文
posted @ 2008-11-10 14:50 万一 阅读(10693) 评论(6) 推荐(0) 编辑
Delphi 的内存操作函数(2): 给数组指针分配内存
摘要:静态数组, 在声明时就分配好内存了, 譬如: var arr1: array[0..255] of Char; arr2: array[0..255] of Integer; begin ShowMessageFmt('数组大小分别是: %d、%d', [SizeOf(arr1), SizeOf(arr2)]); {数组大小分别是: 512、1024} end; 对静态... 阅读全文
posted @ 2008-11-10 11:04 万一 阅读(13947) 评论(15) 推荐(1) 编辑
Delphi 的内存操作函数(1): 给字符指针分配内存
摘要:马上能想到的函数有: GetMem AllocMem ReallocMem FreeMem GetMemory ReallocMemory FreeMemory New Dispose NewStr DisposeStr StrNew StrAlloc StrDispose GlobalAllocPtr GlobalFreePtr WideStrAlloc AnsiStrAlloc ... 阅读全文
posted @ 2008-11-08 12:14 万一 阅读(21898) 评论(12) 推荐(2) 编辑
SysErrorMessage 函数和系统错误信息表
摘要:在看 API 文档时, 我们经常见到 GetLastError; 它可以返回操作后系统给的提示. 但 GetLastError 返回的只是一个信息代码, 如何返回对应的具体信息呢? FormatMessage 可以, 但这个函数太复杂了; 可以用 SysErrorMessage 代替它. 举例: var err: string; begin err := SysErrorMessa... 阅读全文
posted @ 2008-11-07 12:27 万一 阅读(13853) 评论(9) 推荐(0) 编辑
WinAPI 字符及字符串函数(15): CharNext、CharPrev
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-06 20:26 万一 阅读(4539) 评论(1) 推荐(0) 编辑
WinAPI 字符及字符串函数(14): CharToOem、OemToChar
摘要:CharToOemBuff、OemToCharBuff 与 CharToOem、OemToChar 的区别只是前者可以指定要转换的字符数. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; t... 阅读全文
posted @ 2008-11-06 19:51 万一 阅读(3586) 评论(3) 推荐(0) 编辑
WinAPI 字符及字符串函数(13): lstrcmp、lstrcmpi - 对比串
摘要:lstrcmp 区分大小写; lstrcmpi 不区分大小写. 返回值: -1、0、1, 其中 0 表示相同. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 =... 阅读全文
posted @ 2008-11-06 18:46 万一 阅读(5909) 评论(0) 推荐(1) 编辑
获取汉字编码的几种方法 - 回复"外来天客"的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/06/1327312.html#1362524 var n1,n2,n3,n4,n5: Word; begin n1 := Ord('万'); n2 := Cardinal('万'); n3 := Integer('万'); n4 := Word('万'); n5 := L... 阅读全文
posted @ 2008-11-06 16:35 万一 阅读(2273) 评论(4) 推荐(0) 编辑
WinAPI 字符及字符串函数(12): lstrlen - 串长度
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 21:49 万一 阅读(3235) 评论(6) 推荐(0) 编辑
WinAPI 字符及字符串函数(11): lstrcpyn - 复制字符串, 同时指定要复制的长度
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button... 阅读全文
posted @ 2008-11-05 21:39 万一 阅读(3394) 评论(2) 推荐(0) 编辑
WinAPI 字符及字符串函数(10): lstrcpy - 复制字符串
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 21:18 万一 阅读(4361) 评论(4) 推荐(0) 编辑
WinAPI 字符及字符串函数(9): lstrcat - 合并字符串
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 20:38 万一 阅读(3592) 评论(5) 推荐(0) 编辑
WinAPI 字符及字符串函数(8): IsCharUpper - 是否是个大写字母
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 14:37 万一 阅读(2044) 评论(2) 推荐(0) 编辑
WinAPI 字符及字符串函数(7): IsCharLower - 是否是个小写字母
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 14:36 万一 阅读(2071) 评论(0) 推荐(0) 编辑
WinAPI 字符及字符串函数(6): IsCharAlphaNumeric - 是否是个文字(字母或数字)
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 14:32 万一 阅读(3253) 评论(3) 推荐(1) 编辑
WinAPI 字符及字符串函数(5): IsCharAlpha - 是否是个字母
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 14:19 万一 阅读(2280) 评论(0) 推荐(0) 编辑
WinAPI 字符及字符串函数(4): CharUpperBuff - 把缓冲区中指定数目的字符转大写
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 14:03 万一 阅读(2626) 评论(2) 推荐(0) 编辑
WinAPI 字符及字符串函数(3): CharUpper - 字符或字符串转大写
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 14:00 万一 阅读(2054) 评论(0) 推荐(0) 编辑
WinAPI 字符及字符串函数(2): CharLowerBuff - 把缓冲区中指定数目的字符转小写
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 13:10 万一 阅读(2414) 评论(0) 推荐(0) 编辑
WinAPI 字符及字符串函数(1): CharLower - 字符或字符串转小写
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-11-05 11:36 万一 阅读(4265) 评论(0) 推荐(0) 编辑
多媒体函数简介
摘要:函数名称说明 auxGetDevCaps查询指定的辅助输出设备以确定其性能 auxGetNumDevs检取系统中存在的辅助输出设备的数量 auxGetVolume返回指定的辅助输出设备的当前卷设备 auxOutMessage向指定的辅助输出设备发送一条消息 auxSetVolume在指定的辅助输出设备中设置卷 CloseDirver关闭指定的可安装驱动器 DefDriverProc为任何不由可安... 阅读全文
posted @ 2008-11-04 22:17 万一 阅读(6105) 评论(0) 推荐(0) 编辑
WinAPI: 输入光标相关的函数[4]
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormMouseDown(Sender: T... 阅读全文
posted @ 2008-11-04 16:28 万一 阅读(2770) 评论(9) 推荐(0) 编辑
WinAPI: 输入光标相关的函数[3]
摘要:本例测试修改光标的形色, 效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Ra... 阅读全文
posted @ 2008-11-04 15:25 万一 阅读(2119) 评论(0) 推荐(0) 编辑
WinAPI: 输入光标相关的函数[2]
摘要:本例测试修改光标的设置闪烁速度, 注意这会影响到其他程序, 退出时应恢复到系统默认的 530 毫秒. 本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtr... 阅读全文
posted @ 2008-11-04 14:56 万一 阅读(2046) 评论(0) 推荐(0) 编辑
WinAPI: 输入光标相关的函数[1]
摘要:CreateCaret {建立} DestroyCaret {释放} ShowCaret {显示} HideCaret {隐藏} SetCaretPos {设置位置} GetCaretPos {获取位置} SetCaretBlinkTime {设置间隔时间} GetCaretBlinkT... 阅读全文
posted @ 2008-11-04 14:09 万一 阅读(3060) 评论(0) 推荐(1) 编辑
一个字符串到数组的例子 - 回复"成红"的问题, 对其他朋友参考价值不大
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/04/1209070.html#1360634 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, St... 阅读全文
posted @ 2008-11-04 13:23 万一 阅读(1633) 评论(0) 推荐(0) 编辑
WinApi: SystemParametersInfo
摘要:举例: 更换桌面壁纸 var BmpPath: PChar; begin BmpPath := 'C:\Temp\Test.bmp'; SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, BmpPath, SPIF_UPDATEINIFILE); end; SystemParametersInfo 的参数实在太多了... SPI_GET... 阅读全文
posted @ 2008-11-04 11:03 万一 阅读(4331) 评论(3) 推荐(0) 编辑