Solved

MSDN bug?

Posted on 2001-09-05
14
456 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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…
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

635 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