News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Win32 API abbreviation from Masm32

Started by Xor Stance, February 20, 2005, 05:52:11 PM

Previous topic - Next topic

Xor Stance

I have a question about the macros Win32 structures. After learning all of it by heart, I could comprehend some without the need of watching
the Win32API.hlp file. What I doubt that before, I even search for the Win32API structures but it doesn't tell you in depths, and the abbreviations
are missing and I can memorize and learn faster in that form.

wc.cbSize = Window Classes . is it care byte? or carry byte
wc.lpfnWndProc = is it last parameter pointer find?
wc.lpszMenuName = idk(I don't know)

I wonder if there're any complete libraries that explains the abbreviation of each one, I had use the Win32API reference but, it only explains
if I know the abbreviation I feel better.

roticv

lpfn = long pointer to function
lpsz = long pointer to null terminating string

Petroizki

Microsoft uses Hungarian Notation in their variable naming: http://www.gregleg.com/oldHome/hungarian.html.
So 'cb' stands for count bytes.

Vortex

Xor Stance,

You can check the topic "Simple Types" in Win32.hlp

MichaelW

AFAIK cb = "count byte", meaning the named object specifies a size or length in bytes.

I was hoping to find a single reference that fully specified the naming conventions used in the API reference, but after a half-hour search these were the best I could do:

MSDN: Variable Names and Hungarian Notation

MSDN: Hungarian Notation
eschew obfuscation

Xor Stance

I appreciate all of your help, I'm more than interested in "Hungarian Notations".

Relvinian

Hungarian Notation when naming variables has both its good and bad points.

Microsoft does use it heavily and you'll notice that in the APIs.

The bad points about Hungarian Notation come to play when the meaning doesn't make sense anymore.

Examples:

1) lpszBuffer   = long pointer string null (Bufer).  This made sense back in the 16-bit days but in 32-bit, the "l" long doesn't have any meaning. Just leftover from previous coding and lost during the years of changes. This style can make it hard to correctly define what variables are or should be.  ;)

2) WPARAM and LPARAM.   WPARAM = word Parameter and LPARAM = long parameter.   Back in the 16-bit days, WPARAM = 16bits and LPARAM = 32bits, now they are both 32bits.

It is a style of programming that a LOT of people have adopted.  Whether or not it is good and you like it or want to use it is *purely* your choice.

Relvinian