transparent windows - SetLayeredWindowAttributes

This is a discussion on transparent windows - SetLayeredWindowAttributes within the C++ Programming forums, part of the General Programming Boards category; I'm attempting to try and learn how to use the new alphablended/layered window techniques introduced into Windows 2000 and later ...

I thought I'd try this to begin with but I then recieved the error "Undeclared identifier SetLayeredWindowAttributes" and a few others when it came to compile.

In MSDN it says it is declared in Winuser.h; Include Windows.h which I have done. I opened up \platformsdk\include\Winuser.h in notepad and also found it in there.

I use Microsoft Visual Studio .NET Enterprise Arhitect and it says at the bottom of the MSDN collection "Platform SDK Release Auguest 2001" which I think should include these functions especially since SetLayeredWindowAttributes is documented within it.

Any help with this problem would be greatly appreciated. Also, if anyone has used the layered window functions for 2k/xp then any tips regarding that would also be helpful.

Originally posted by Sorensen This should be in the Windows forum. Try placing

#define _WIN32_WINNT 0x0500

in the file, before you include windows.h.

thanks, i think that might have something to do with it. When looking through the winuser.h file i did see that the declaration of the SetLayeredWindowAttributes API Call was contained in some preprocessor if statements to do with _WIN32_WINNT

would this have anything to do with me using Windows XP (NT 5.1) rather than 2k (5.0)?

I'm a "he" btw

just going to go away and play around with the suggestions and thanks rob ford for making such a helpful and long post, much appreciated

Thanks a lot, I went away and tried adding that #define preprocessor directive and it worked perfectly, would seem that August 2001 edition of the SDK is ok as I thought it would be but thanks for the help anyway Rob.

If possible could you explain why i had to put that directive in my code so I can understand why I have done it, it would be very helpful.

Thanks again,

Daniel

PS - I'll remember to post in the Windows Forum next time, sorry about that