Solved

MSDN bug?

Posted on 2001-09-05
14
452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error email attachment VB2010 5 58
How to change the thumbnail from Picture Library of SharePoint 2013? 3 357
Example of WebAPI 7 37
Build VS2015 project in bat command 3 108
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

751 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