I am just now moving from DOS 16 bit MASM to Windows programming via MASM32. I have a question about Windows API calls.
I am following Pirogov's book, "The Assembly Programming Master Book" as a tutorial. Early in the book, he makes a statement about the naming convention for calling Windows API functions from assembly. Specifically, some API function names contain an "A" before the byte length of the parameters and some don't. For example:
SendMessageA@16 has the A
UpdateWindow@4 does not
I'm sure that I'm missing something that's obvious to everyone else, but so far, I haven't figured out when to add the A and when not to. What are the rules?
Hi, Dubhe!
the "A" means ANSI Character set
the "W" Unicode Character Set
wich means that SendMessageA is API function from ANSI Character set processing type
and SendMessageW is API function from Unicode Character Set processing type.
So,if your Application is not going to use Unicode, the answer of your question is "to A" :)
Quote from: Dubhe on December 21, 2005, 03:41:31 PM
I am just now moving from DOS 16 bit MASM to Windows programming via MASM32. I have a question about Windows API calls.
I am following Pirogov's book, "The Assembly Programming Master Book" as a tutorial.
If I were you I would start with Iczelion's tutorials instead of that book. That book may be good as a reference but it isn't what I was looking for as a tutorial. Most people (at least in here) use different coding style than Pirogov. And I mean "different". Take it into account.
Thanks for the heads-up! :U
I'll take a look at it.
One other thing.
UpdateWindow NEVER has string data passed to it, directly or indirectly (through structures). So there is no need for two versions (A vs. W).
Furthermore, when you use MASM32 and the provided include files, most (if not all) APIs which would require the "A" or "W" suffix default to the "A" suffix when no suffix is specified.
Raymond