Board index » Visual Studio » Transparent window

Transparent window

Visual Studio316
Hello,



How can I create a transparent window with a caption bar and border.And its

client is transparent,I can see the picture under the client even if the

transparent window is moving.



Thanks!


-
 

Re:Transparent window

You must have made the window transparent my overridding erasebackground and

did nothing, Actually that is not transparent its simply you are not erasing

the background of ur window and redrawing it that makes see the desktop or

what ever is behind the window.

If you want a different shaped window, then checkout SetWindowRgn api.



"msg_du" <dch1237@msn.com>wrote in message

Quote
Hello,



How can I create a transparent window with a caption bar and border.And

its

client is transparent,I can see the picture under the client even if the

transparent window is moving.



Thanks!









-

Re:Transparent window

I'm little confused with what you are saying.Could you descript it clearly?I

want the final effect of transparent which like a piece of glass in spite of

what theory to implement it.If I can get this piece of glass,all kind of

methods are welcome.Thanks!



"Mr.Prakash" <prakash8086@yahoo.com>дÈëÏûÏ¢ÐÂÎÅ

:eh#3EK6$DHA.2292@TK2MSFTNGP12.phx.gbl...

Quote
You must have made the window transparent my overridding erasebackground

and

did nothing, Actually that is not transparent its simply you are not

erasing

the background of ur window and redrawing it that makes see the desktop or

what ever is behind the window.

If you want a different shaped window, then checkout SetWindowRgn api.



"msg_du" <dch1237@msn.com>wrote in message

news:uxMWM24$DHA.2336@TK2MSFTNGP11.phx.gbl...

>Hello,

>

>How can I create a transparent window with a caption bar and border.And

its

>client is transparent,I can see the picture under the client even if the

>transparent window is moving.

>

>Thanks!

>

>









-

Re:Transparent window

www.codeguru.com/Cpp/misc/misc/graphics/article.php/c391">www.codeguru.com/Cpp/misc/misc/graphics/article.php/c391

See this URL.









"msg_du" <dch1237@msn.com>wrote in message

Quote
Hello,



How can I create a transparent window with a caption bar and border.And

its

client is transparent,I can see the picture under the client even if the

transparent window is moving.



Thanks!









-

Re:Transparent window

This really works



///////////////////////

typedef BOOL (FAR PASCAL* SET_LAYERED_WINDOW_ATTRIBUTES) (HWND, COLORREF, BYTE, DWORD)



HMODULE hmodule = GetModuleHandle ("User32.dll")

SET_LAYERED_WINDOW_ATTRIBUTES pSetLayeredWindowAttributes



long lExStyle = GetWindowLong (hwnd, GWL_EXSTYLE)

lExStyle = lExStyle | WS_EX_LAYERED & ~WS_EX_CONTEXTHELP & ~WS_EX_RIGHT

SetWindowLong (hwnd, GWL_EXSTYLE, lExStyle)



if (hmodule != 0

pSetLayeredWindowAttributes = reinterpret_cast <SET_LAYERED_WINDOW_ATTRIBUTES>(GetProcAddress (hmodule, "SetLayeredWindowAttributes"))



//Change the value of this variable to preferred transparency level

int l_iOpacity = 50

if (pSetLayeredWindowAttributes != 0

pSetLayeredWindowAttributes (hwnd, 0, l_iOpacity, LWA_ALPHA)

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

-