Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MSDN bug?

Posted on 2001-09-05
14
Medium Priority
?
462 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
11 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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 100 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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 article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
Integration Management Part 2

783 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