Help Wanted

Trans Parent Window problems – en972

en972

Member

Posts: 562
From: NOT TELLING!
Registered: 08-27-2004
I have been trying to do tansparent windows with C++ builder. I found http://bdn.borland.com/article/0,1410,29579,00.html but it doesn't really say where to put most of the code. And when it does it doesnt work. Why?

------------------
Oh you program? Awsome! I try to get in a little....I spend most of my time debugging.

Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
The code in that article is visual basic not c++. And it seems to assume that you know how to write the rest of the code because it only shows the key parts.

------------------
And whatsoever ye do in word or deed, do all in the name of the Lord Jesus, giving thanks to God and the Father by him. - Col 3:17

Unless the LORD builds the house, they labor in vain who build it; unless the LORD keeps the city, the watchman stays awake in vain. - Psalms 127:1

en972

Member

Posts: 562
From: NOT TELLING!
Registered: 08-27-2004
ohhhhhhhhh....no wonder, lol

------------------
Oh you program? Awsome! I try to get in a little....I spend most of my time debugging.

Seven7
Member

Posts: 50
From: USA
Registered: 03-16-2005

Its actually PASCAL. If you have Borland compiler (or other) then you would
be able to use the sniplet of code.

j.

en972

Member

Posts: 562
From: NOT TELLING!
Registered: 08-27-2004
AWESOME! I'll compile A.S.A.P

------------------
Oh you program? Awsome! I try to get in a little....I spend most of my time debugging.

cwc

Member

Posts: 121
From: USA
Registered: 07-30-2005
This should be all ya need
HWND hwnd = CreateWindowEx(//you file this in);
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);

// Use crKey as the transparency color.
COLORREF crKey = RGB(0, 0, 0);
//SetLayeredWindowAttributes(hwnd, crKey, 0, LWA_COLORKEY);

// Use bAlpha to determine the opacity of the layered window.
// When alpha 0 the window is completely transparent, when it's 255 the window is opaque.
SetLayeredWindowAttributes(hwnd, 0, 128, LWA_ALPHA);

This is the win32 api if you want it in C++ just make a class for this WRAP IT UP


God bless you all!!!

[This message has been edited by cwc (edited August 29, 2005).]