Solved

MSDN bug?

Posted on 2001-09-05
14
434 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
Comment Utility
What version of Windows are you using. It's only available for Win2000 and beyond
0
 

Author Comment

by:lutfcn
Comment Utility
Win2000 professional + Visual C++ 6.0
0
 

Expert Comment

by:chandas
Comment Utility
MSDN says,

Windows NT/2000 or later: Requires Whistler.

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

Regards

Senkwe
0
 
LVL 7

Expert Comment

by:peterchen092700
Comment Utility
Whister == XP.
0
 

Expert Comment

by:chandas
Comment Utility
hehe, got me Peter
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:robpitt
Comment Utility
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
Comment Utility
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
Comment Utility
SetlayeredWindowAttributes is implemented on Win2000 and WinXP (=Whistler).

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

Expert Comment

by:chandas
Comment Utility
Then I did read it wrong.

Thanks
0
 
LVL 7

Expert Comment

by:peterchen092700
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
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…
This video discusses moving either the default database or any database to a new volume.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now