Windows Programming必须了解的naming-convention,下面解释每个前缀/缩略词的含义,如果含义的解释一行放不下的,就把解释放在一个引用框里

Prefix
Meaning
CS

Class style option

ps
eg: psText; a pointer to the character string,
DC

device context, The device context is really just a data structure maintained internally by GDI. A device context is associated with a particular display device, such as a video display or a printer. For a video display, a device context is usually associated with a particular window on the display.

rc
eg: rcPaint; a structure of type RECT, the RECT structure defines a rectangle with four fields named left , top , right , and bottom
MM
eg: MM_TEXT;

Windows has a variety of "mapping modes" that govern how the logical coordinates specified in GDI drawing functions are translated to the physical pixel coordinates of the display. The mapping mode is defined in the device context.

DT
Options related to DrawText function

SW
show window option

CW

Create window option

DT

Draw text option

IDI

ID number for an icon

IDC

ID number for a cursor

MB

Message box options

SND

Sound option

WM

Window message

SND
sound option

 

WS

Window style

UINT

unsigned int

PSTR

a pointer to a nonwide character string, that is, a char *

WPARAM/LPARAM

The origin of these names requires a bit of history. When Windows was a 16-bit system, thethird parameter to WndProc was defined as a WORD, which

WINAPI/CALLBACK

Both these identifiers are defined as __stdcall , which refers to a special calling
sequence for function calls that occur between Windows itself and your application.

MSG

Message structure

WNDCLASS
Window class structure
PAINTSTRUCT
Paint structure
RECT
Rectangle structure

HINSTANCE
Handle to an "instance"—the program itself
HWND
Handle to a window
HDC

Handle to a device context. A device context refers to a physical output device (such as a video display) and its device driver. 

sz, eg: szCmdLine

i, eg: iCmdShow
i stands for integer

ui, eg: uiParam

ui stands for unsigned integer

c
char or WCHAR or TCHAR
by
BYTE (unsigned char)
n
short
i
int
x , y
int used as x-coordinate or y-coordinate
cx , cy
int used as x or y length; c stands for "count"
b or f
BOOL (int); f stands for "flag"
w
WORD (unsigned short)
l
LONG (long)
dw
DWORD (unsigned long)
fn
function
s
string
sz
string terminated by 0 character
h
handle
p
pointer

lpfn

long pointer to a function, Recall that in the Win32 API there is no distinction between long pointers and near pointers. This is a remnant of 16-bit Windows.

near pointer, also a remnant of 16-bit windows

lpcwstr

long poiner to const wide character string (const wchar_t *)

相关文章:

  • 2021-05-11
  • 2021-06-27
  • 2021-06-17
  • 2021-04-21
  • 2021-07-20
  • 2021-05-17
  • 2021-12-19
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2022-01-30
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-11-28
相关资源
相似解决方案