api 常用 缩写 有些什么

m912795583 2011-09-18 09:00:28
api 常用 缩写 有些什么

类似于这些的:

message-msg

windows -wnd

windowsmessage-wm

left-l

right-r

Virtual Key-vk


各位大虾使劲贴出来阿

如果有现成的文档也可以直接qiangren912795583@163.com

...全文
390 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
Gloveing 2011-09-19
  • 打赏
  • 举报
回复
Google:
匈牙利命名法
AndyZhang 2011-09-19
  • 打赏
  • 举报
回复
看看C++常用规范吧,dw n m等等
AndyZhang 2011-09-19
  • 打赏
  • 举报
回复
MFC、句柄、控件及结构的命名规范 Windows类型 样本变量 MFC类 样本变量
  HWND hWnd; CWnd* pWnd;
  HDLG hDlg; CDialog* pDlg;
  HDC hDC; CDC* pDC;
  HGDIOBJ hGdiObj; CGdiObject* pGdiObj;
  HPEN hPen; CPen* pPen;
  HBRUSH hBrush; CBrush* pBrush;
  HFONT hFont; CFont* pFont;
  HBITMAP hBitmap; CBitmap* pBitmap;
  HPALETTE hPaltte; CPalette* pPalette;
  HRGN hRgn; CRgn* pRgn;
  HMENU hMenu; CMenu* pMenu;
  HWND hCtl; CState* pState;
  HWND hCtl; CButton* pButton;
  HWND hCtl; CEdit* pEdit;
  HWND hCtl; CListBox* pListBox;
  HWND hCtl; CComboBox* pComboBox;
  HWND hCtl; CScrollBar* pScrollBar;
  HSZ hszStr; CString pStr;
  POINT pt; CPoint pt;
  SIZE size; CSize size;
  RECT rect; CRect rect;
  一般前缀命名规范 前缀 类型 实例
  C 类或结构 CDocument,CPrintInfo
  m_ 成员变量 m_pDoc,m_nCustomers
  变量命名规范 前缀 类型 描述 实例
  ch char 8位字符 chGrade
  ch TCHAR 如果_UNICODE定义,则为16位字符 chName
  b BOOL 布尔值 bEnable
  n int 整型(其大小依赖于操作系统) nLength
  n UINT 无符号值(其大小依赖于操作系统) nHeight
  w WORD 16位无符号值 wPos
  l LONG 32位有符号整型 lOffset
  dw DWORD 32位无符号整型 dwRange
  p * 指针 pDoc
  lp FAR* 远指针 lpszName
  lpsz LPSTR 32位字符串指针 lpszName
  lpsz LPCSTR 32位常量字符串指针 lpszName
  lpsz LPCTSTR 如果_UNICODE定义,则为32位常量字符串指针 lpszName
  h handle Windows对象句柄 hWnd
  lpfn callback 指向CALLBACK函数的远指针
  前缀 符号类型 实例 范围
  IDR_ 不同类型的多个资源共享标识 IDR_MAIINFRAME 1~0x6FFF
  IDD_ 对话框资源 IDD_SPELL_CHECK 1~0x6FFF
  HIDD_ 对话框资源的Help上下文 HIDD_SPELL_CHECK 0x20001~0x26FF
  IDB_ 位图资源 IDB_COMPANY_LOGO 1~0x6FFF
  IDC_ 光标资源 IDC_PENCIL 1~0x6FFF
  IDI_ 图标资源 IDI_NOTEPAD 1~0x6FFF
  ID_ 来自菜单项或工具栏的命令 ID_TOOLS_SPELLING 0x8000~0xDFFF
  HID_ 命令Help上下文 HID_TOOLS_SPELLING 0x18000~0x1DFFF
  IDP_ 消息框提示 IDP_INVALID_PARTNO 8~0xDEEF
  HIDP_ 消息框Help上下文 HIDP_INVALID_PARTNO 0x30008~0x3DEFF
  IDS_ 串资源 IDS_COPYRIGHT 1~0x7EEF
  IDC_ 对话框内的控件 IDC_RECALC 8~0xDEEF
  Microsoft MFC宏命名规范 名称 类型
  _AFXDLL 唯一的动态连接库(Dynamic Link Library,DLL)版本
  _ALPHA 仅编译DEC Alpha处理器
  _DEBUG 包括诊断的调试版本
  _MBCS 编译多字节字符集
  _UNICODE 在一个应用程序中打开Unicode
  AFXAPI MFC提供的函数
  CALLBACK 通过指针回调的函数
  库标识符命名法 标识符 值和含义
  u ANSI(N)或Unicode(U)
  d 调试或发行:D = 调试;忽略标识符为发行。
  静态库版本命名规范 库 描述
  NAFXCWD.LIB 调试版本:MFC静态连接库
  NAFXCW.LIB 发行版本:MFC静态连接库
  UAFXCWD.LIB 调试版本:具有Unicode支持的MFC静态连接库
  UAFXCW.LIB 发行版本:具有Unicode支持的MFC静态连接库
  动态连接库命名规范 名称 类型
  _AFXDLL 唯一的动态连接库(DLL)版本
  WINAPI Windows所提供的函数
  Windows.h中新的命名规范 类型 定义描述
  WINAPI 使用在API声明中的FAR PASCAL位置,如果正在编写一个具有导出API人口点的DLL,则可以在自己的API中使用该类型
  CALLBACK 使用在应用程序回叫例程,如窗口和对话框过程中的FAR PASCAL的位置
  LPCSTR 与LPSTR相同,只是LPCSTR用于只读串指针,其定义类似(const char FAR*)
  UINT 可移植的无符号整型类型,其大小由主机环境决定(对于Windows NT和Windows 9x为32位);它是unsigned int的同义词
  LRESULT 窗口程序返回值的类型
  LPARAM 声明lParam所使用的类型,lParam是窗口程序的第四个参数
  WPARAM 声明wParam所使用的类型,wParam是窗口程序的第三个参数
  LPVOID 一般指针类型,与(void *)相同,可以用来代替LPSTR
AndyZhang 2011-09-19
  • 打赏
  • 举报
回复
全局变量
  g_ 常量
  m_ c++类成员变量
  s_ 静态变量
  类型部分:
  指针 p
  函数 fn
  无效 v
  句柄 h
  长整型 l
  布尔 b
  浮点型(有时也指文件) f
  双字 dw
  字符串 sz
  短整型 n
  双精度浮点 d
  计数 c(通常用cnt)
  字符 ch(通常用c)
  整型 i(通常用n)
  字节 by
  字 w
  实型 r
  无符号 u
  描述部分:
  最大 Max
  最小 Min
  初始化 Init
  临时变量 T(或Temp)
  源对象 Src
  目的对象 Dest
赵4老师 2011-09-19
  • 打赏
  • 举报
回复
查MSDN是Windows程序员必须掌握的技能之一。

Prefix Object Type Example
ani Animation button aniMailBox
bed Pen Bedit bedFirstName
cbo Combo box and drop down list box cboEnglish
chk Checkbox chkReadOnly
clp Picture clip clpToolbar
cmd (3d) Command button (3D) cmdOk (cmd3dOk)
com Communications comFax
ctr Control (when specific type unknown) ctrCurrent
dat Data control datBiblio
dir Directory list box dirSource
dlg Common dialog control dlgFileOpen
drv Drive list box drvTarget
fil File list box filSource
frm Form frmEntry
fra (3d) Frame (3d) fraStyle (fra3dStyle)
gau Gauge gauStatus
gpb Group push button gpbChannel
gra Graph graRevenue
grd Grid grdPrices
hed Pen Hedit hedSignature
hsb Horizontal scroll bar hsbVolume
img Image imgIcon
ink Pen Ink inkMap
key Keyboard key status keyCaps
lbl Label lblHelpMessage
lin Line linVertical
lst List box lstPolicyCodes
mdi MDI child form mdiNote
mpm MAPI message mpmSentMessage
mps MAPI session mpsSession
mci MCI mciVideo
mnu Menu mnuFileOpen
opt (3d) Option Button (3d) optRed (opt3dRed)
ole OLE control oleWorksheet
out Outline control outOrgChart
pic Picture picVGA
pnl3d 3d Panel pnl3d
rpt Report control rptQtr1Earnings
shp Shape controls shpCircle
spn Spin control spnPages
txt Text Box txtLastName
tmr Timer tmrAlarm
vsb Vertical scroll bar vsbRate


Prefix Variable or Object
i integer index (type Integer or Long)
h handle
ord ordinal (a numeric identification code used when the specific value is unimportant except to distinguish the variable from others)
x, y x and y coordinates of points
dx, dy delta (or distance) in terms of x and y coordinates (dx is width, dy is height)
f Boolean
af bit flag (an array of Booleans represented by bits)
r real number (either Single or Double)
b Byte
v Variant
cur Currency
time time
date Date
dt Date and time combined
s String
p pointer (Long variable from or for an API function)
cmd button
chk check box
txt text box
pb picture box
pic picture
lst list box
cbo combo box
lbl label
mnu menu
tmr timer
opt option button (radio button)
c count
A array
N collection
FrankHB1989 2011-09-18
  • 打赏
  • 举报
回复
WinAPI?
知道结尾的A是ANSI,W是wide-character(Unicode: UCS2-LE)就行了。
m912795583 2011-09-18
  • 打赏
  • 举报
回复
刚开始学这东西,知道点这些 对学习理解都轻松点呀
[Quote=引用 1 楼 zjw6861982 的回复:]
别纠结这些东西啊,某些中国大公司的api还有中文拼音呢
[/Quote]
m912795583 2011-09-18
  • 打赏
  • 举报
回复

[Quote=引用 5 楼 fry693175708 的回复:]
这个无所谓的。。
[/Quote]
这样便于学习嘛
ANT2AUNTH 2011-09-18
  • 打赏
  • 举报
回复
这个无所谓的。。
就想叫yoko 2011-09-18
  • 打赏
  • 举报
回复
首先你对api的概念理解就有问题
建议你搜索一下api的概念

QT的api前面喜欢加个Q
羽飞 2011-09-18
  • 打赏
  • 举报
回复
这个,有些还看习惯吧
Button 有些写Btn,有些写Bn
Control 有些写Ctl,有些写Ct
btloveet 2011-09-18
  • 打赏
  • 举报
回复
- -:这个太多了!
zjw6861982 2011-09-18
  • 打赏
  • 举报
回复
别纠结这些东西啊,某些中国大公司的api还有中文拼音呢

65,186

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧