C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 12th, 2004, 11:00 PM
DllFreak112 DllFreak112 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: FL
Posts: 1 DllFreak112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to DllFreak112
Question Getting SetLayeredWindowAttributes Working

I can't get the "SetLayeredWindowAttributes" API working in visual c++ 6.

When i compile it says:
"error C2065: 'SetLayeredWindowAttributes' : undeclared identifier".

My Code:
Code:
#include <windows.h>
#include <Winuser.h>
#define export extern "C" __declspec (dllexport)
#pragma comment(lib,"User32.lib")
 
export double Transparent (double hwnd,double alpha,double key)
{
DWORD flags;
return (double)(DWORD)SetLayeredWindowAttributes(hwnd,key  ,Alpha,&flags);
}


Can anyone help me get it working without buying vc++ 7?

Reply With Quote
  #2  
Old July 20th, 2005, 12:23 AM
Fred77 Fred77 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 Fred77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 9 sec
Reputation Power: 0
'SetLayeredWindowAttributes' only available under Win2000 abd later

Hi,
if the problem is not solved already: Since this API is not available under earlier Windows Systems, you must tell the compiler somewhere, that it shall compile specifically for Win 2000 and later. This works by putting:
#define WINVER 0x0500
BEFORE the include of the windows headers, or as a project setting.
By the way: I came over this while searching for a solution of a performance problem with this API - display of a layered window takes about 2s on an older notebook. Anyone knows this problem and possibly how to speed up display of layered windows?

Quote:
Originally Posted by DllFreak112
I can't get the "SetLayeredWindowAttributes" API working in visual c++ 6.

When i compile it says:
"error C2065: 'SetLayeredWindowAttributes' : undeclared identifier".

My Code:
Code:
#include <windows.h>
#include <Winuser.h>
#define export extern "C" __declspec (dllexport)
#pragma comment(lib,"User32.lib")
 
export double Transparent (double hwnd,double alpha,double key)
{
DWORD flags;
return (double)(DWORD)SetLayeredWindowAttributes(hwnd,key  ,Alpha,&flags);
}


Can anyone help me get it working without buying vc++ 7?

Reply With Quote
  #3  
Old July 20th, 2005, 12:56 AM
B-Con's Avatar
B-Con B-Con is offline
:bcon: moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Location: int main()
Posts: 351 B-Con User rank is Private First Class (20 - 50 Reputation Level)B-Con User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 23 h 1 m 43 sec
Reputation Power: 4
We appreciate your willingness to contribute to the forums, but what do you think the odds are of that guy still being here 1 year later having logged only that post?
__________________
Officially a member of the Itsacon fan club. Beer blasts are every friday at Viper_SB's house. I bring the chips.



Reply With Quote
Closed Thread

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Getting SetLayeredWindowAttributes Working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT