博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
windows变量前缀总结(转载)
阅读量:4231 次
发布时间:2019-05-26

本文共 1527 字,大约阅读时间需要 5 分钟。

转载来源: 

1.
匈牙利表示法
Windows
变量的常用前缀

前缀
变量定义
变量
b
或f
布尔型(非0
为true
,0
为false
bool
,f
代表旗标
c
字符变量(char
)一个字节  
char
,WCHAR,TCHAR
dw
32
为无符号长整型整数,无正负号长整数
DWORD
f
用16
位整数表示的一种位标记
旗标
h
16
位句柄
句柄
l
32
位长整型
LONG
lp
32
位长指针
long *
n
16
位短整型
short
p
16
位短指针
指针
pt
坐标量(x
,y
),放在32
位无符号整数中
 
rgb
RGB
颜色值,放在32
位整数中
 
by
无正负号字符
BYTE
i
整型
int
fn
函数
function
s
字符串
string
sz
以字节0
结尾的字符串
String Zero

 
 
 
 
 
 
 
 
 
 
 
 
2.
基本数据类型
Windows
基本数据类型

数据类型
对应的基本数据类型
说明
BOOL
int
布尔值
BSTR
Unsigned short*
32
位字符指针
BYTE
Unsigned char
8
位无符号字节变量
COLORREF
Unsigned long
用作颜色的32
位值
DWORD
Unsigned long
32
位无符号整数,段地址和相关的偏移地址
LONG
long
32
位带符合整数
LPARAM
long
作为参数传递给窗口过程或回调函数的32
位值
LPCSTR
Const char*
指向字符串常量的32
位指针
LPSTR
Char*
指向字符串的32
位指针
LPCTSTR
Const char*
(注1
指向可移植为Unicode
和DBCS
字符串常量的32
位指针
LPTSTR
Char*
(注1
指向可移植为Unicode
和DBCS
字符串的32
位指针
LPVOID
Void*
指向未定义类型的32
位指针
LRESULT
long
来自窗口过程或回调函数的32
位返回值
UINT
Unsigned int
32
位无符号整数
WNDPROC
Long
(__stdcall*
)(void*,unsigned int,long)
注2
指向窗口过程的32
位指针
WORD
Unsigned short
16
位无符号浮点型
WPARAM
Unsigned int
当作参数传递给窗口过程或回调函数的32
位整数

1
:这是
DBCS
版本下的情况,在
Unicode
版本下 
LPCTSTR
LPTSTR
将代表其他的数据类型
2
:事实上,
WNDPROC
被定义为
LRESULT(CALLBACK*)(HWND,UINT,WPARAM,LPARAM),
这个定义最终被编译器解释位
long
__void*,unsigned int,long
 

                                3.句柄

Windows常见公用句柄类型

句柄类型
说明
HBITMAP
保存位图信息的内存区域的句柄
HBRUSH
画刷句柄
HCTR
字窗口控件句柄
HCURSOR
鼠标光标句柄
HDC
设备描述表句柄
HDLG
对话框句柄
HFONT
字体句柄
HICON
图标句柄
HINSTANCE
应用程序的实例句柄
HMENU
菜单句柄
HMODULE
模块句柄
HPALETTE
颜色调色板句柄
HPEN
在设备上画图时用于指明线性的笔的句柄
HRGN
剪贴区域句柄
HTASK
独立于已执行任务的句柄
HWND
窗口句柄

4.
结构

结构
含义
MSG
消息结构
WNDCLASS
窗口类别结构
PAINTSTRUCT
绘图结构
RECT
矩形结构

 
你可能感兴趣的文章
Pattern-Oriented Software Architecture, Volume 1: A System of Patterns
查看>>
Database Programming with Visual Basic® .NET and ADO.NET: Tips, Tutorials, and Code
查看>>
ISO 9001: 2000 For Small Businesses
查看>>
Microsoft Visual Studio 2005 Unleashed
查看>>
Windows Server 2003 Security Infrastructures: Core Security Features
查看>>
Configuring ISA Server 2000
查看>>
Microsoft Money 2006 For Dummies
查看>>
Vision with Direction: A Systematic Introduction to Image Processing and Computer Vision
查看>>
Oracle Internals: Tips, Tricks, and Techniques for DBAs
查看>>
Programming Wcf Services
查看>>
AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Second Edition
查看>>
Pro Open Source Mail: Building an Enterprise Mail Solution
查看>>
Visual SourceSafe 2005 Software Configuration Management in Practice
查看>>
Beginning EJB 3 Application Development: From Novice to Professional
查看>>
Breakthrough Windows Vista(TM): Find Your Favorite Features and Discover the Possibilities
查看>>
Windows Powershell in Action
查看>>
Functional And Object Oriented Analysis And Design: An Integrated Methodology
查看>>
Using Samba
查看>>
XML Security
查看>>
Rails Cookbook
查看>>