Solved

MSDN bug?

Posted on 2001-09-05
14
442 Views
Last Modified: 2013-12-03
i find the sample codes in MSDN, but fail to compile them, especially compiler tell me it can't find WS_EX_LAYERED) and SetlayeredWindowAttributes(), so who can help me?

// Set WS_EX_LAYERED on this window
SetWindowLong(hDlg, GWL_EXSTYLE, GetWindowLong(hDlg, GWL_EXSTYLE)|WS_EX_LAYERED);
// Make this window 70% alpha
SetLayeredWindowAttributes(hDlg, 0, (255 * 70) / 100, LWA_ALPHA);
0
Comment
Question by:lutfcn
  • 5
  • 3
  • 2
  • +1
14 Comments
 

Expert Comment

by:chandas
ID: 6459878
What version of Windows are you using. It's only available for Win2000 and beyond
0
 

Author Comment

by:lutfcn
ID: 6459953
Win2000 professional + Visual C++ 6.0
0
 

Expert Comment

by:chandas
ID: 6459987
MSDN says,

Windows NT/2000 or later: Requires Whistler.

If Whistler = XP then you're out of luck for the moment :-)

Regards

Senkwe
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 7

Expert Comment

by:peterchen092700
ID: 6460154
Whister == XP.
0
 

Expert Comment

by:chandas
ID: 6460159
hehe, got me Peter
0
 
LVL 5

Expert Comment

by:robpitt
ID: 6462019
To enable use the WS_EX_LAYERED and other Win2000 specific features you need to _WIN32_WINNT to be >= 0x0500

See http://msdn.microsoft.com/library/en-us/sdkintro/hh/sdkintro/usage_8xgz.asp

You can do this from your project options (C++/preprocessor) or you could just stick a
#define _WIN32_WINNT 0x0500
at the top of the file in question.
0
 

Expert Comment

by:chandas
ID: 6463205
I'm confused Rob, apparently the feature in question is Whistler specific according to MSDN. Not Win2000. Perhaps I read it wrong.
0
 
LVL 5

Expert Comment

by:robpitt
ID: 6463266
SetlayeredWindowAttributes is implemented on Win2000 and WinXP (=Whistler).

Where does it say it needs Whistler (XP) ???
0
 

Expert Comment

by:chandas
ID: 6463330
Then I did read it wrong.

Thanks
0
 
LVL 7

Expert Comment

by:peterchen092700
ID: 6463357
I remember an MSDN edition (or was it that newletter?) that stated "Layered windows are available with Whistler" - so maybe we tapped the same trap...

Peter
0
 
LVL 5

Accepted Solution

by:
robpitt earned 25 total points
ID: 6463958
PS
Also for the layered windowed stuff you need a copy of the "Platform SDK" in order to get the latest H/lib files.

VC6 ships with only the basic (3yr old) files.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question