Win32Api Tutorial

Hello everyone.
I've been studying C++ for almost a year and it's been really interesting process due to some good tutorials. But unfortunately there's no good tutorial available on Win32Api programming. I've been searching through google thoroughly in vain. The ones i've found are not satisfactory. They are short and sketchy.
If you can provide me with a reference or just advise me a book which covers the topic fully it is greatly appreciated.
check out:
<<programming windows>>
by charles Petzold

It's quite thick, though.
Is #1 tutorial http://www.winprog.org/tutorial/ not good enough? I have heard good things about it and I glanced at it really quick and seems quite decent. Plus, it is the first Google result when searching for "win32api programming tutorial".
I thought the same thing webjose. That looks like a decent tutorial to me. Of course you realize I'm not as 'hard core' on the TCHAR thing as you and disch are, so their use of char's for everything doesn't bother me a bit. I guess you missed that.

Anyway, the way to go if one is serious about it is Charles Petzold.
Is #1 tutorial http://www.winprog.org/tutorial/ not good enough?

I've heard a lot about that site but unfortunately it doesn't work. is that material available somewhere else?
oh ... now it works... thank you, guys
@freddie1: I did not see the code much. I saw the topics covered. I saw the basics of window classes, the window procedure, resources, etc. I did not check that the code actually made good use of the Win API, but if you say it uses char's when it should have used TCHAR's then this is the last time I ever recommend it!!! hehe.
closed account (DSLq5Di1)
MSDN is a great resource for the Windows API:-
http://msdn.microsoft.com/en-us/library/ee663300.aspx
i have a confusion about WNDCLASSEX's style member:

1
2
3
WNDCLASSEX WindowClass;
//...
WindowClass.style = CS_HREDRAW | CS_VREDRAW;


how come it defined with OR operator? i read the explanation, it said:

each of the possible options for the winrs style is defined by a unique bit in a 32-bit word being set to 1


i don't understand that. and what's word? is it 16 bit integer?
Last edited on
A word is 2 bytes, yes; a dword, or double word is 4, and a qword or quad word is 8.

The quote you show is not correct. Each style may be a word, yes, but only one could ever be set to 1, otherwise all styles would have the same value. Each style probably has just one BIT set to 1.

As for the OR operator, look up bitmasked values. One works with bitmasked values using bitwise operations, like the bitwise OR operator you see there.
Each style probably has just one BIT set to 1.

webJose is right. Each style does have one bit set to 1.

The easy way to check it out, if you use visual studio, is that you move your cursor to the style macro, say, CS_HREDRAW, right click and choose "go to definition". You'll see the actual value for the style macro defined in some system header file. Convert it to binary number, and you'll see that webJose is correct.

"go to definition" can be useful in other cases as well, when you have no idea about some weird symbol.
what bitmasked means? is it means like bit-converting like the OR operations?
Topic archived. No new replies allowed.