hi i want to know how to make windows transparent . and whatever the text scrolling in that window it appear like only text scrolling.window should not appear. i tried with WS_EX_TRANSPARENT,but it is not working the way i want ,is their any other way to do.please help me out to do this.
Just having the property will not help and you need to handle the WM_PAINT to do the transparent drawing.
I will try. You need to paint the Dialog in such a manner that it becomes transparent by using the API's like TransparentBlt
Maybe I do not know what you are talking about exactly... But check out the results of this snippet on Windows NT (or XP) Code: int translevel = 100; /* 0 - 255 */ SetWindowLong(hwnd,GWL_EXSTYLE,GetWindowLong(h,GWL_EXSTYLE)|WS_EX_LAYERED); SetLayeredWindowAttributes(hwnd,RGB(0,0,0),translevel, 0x02);
thanks for the help,i tried the above code but it is giving error like this: error C2065: 'SetLayeredWindowAttributes' : undeclared identifier error C2065: 'WS_EX_LAYERED' : undeclared identifier. i included both winuser.h and windows.h. how to come out of this error.
ummm.... ummm... let me think.... When I say that it only works in windows NT or later, I mean it -- it won't work in win9x In the Dev-cpp developing environment, there are certain #define s that you have to put before you #include <windows.h> . For example I would have to put #define _WIN32_WINNT 0x500 before i include. It is definitely supposed to be in the winuser header... hmmm... See, I don't know much about VC so I don't know how it handles those defines like that. The only thing I can come up with that could possible help is to tell you this. Open up winuser.h Search for SetLayeredWindowAttributes If you find it, find out what #ifdef s are preventing it from being defined If you don't find it, add it in. The declaration should look like this WINUSERAPI BOOL WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD); And the same thing for WS_EX_LAYERED\ if you can't find it -- add it in #define WS_EX_LAYERED 0x80000 Hope this helps
Thanks for help.i followed what u said,like i searched for setLayeredWindowAttributes in winuser.h that function was not their. just i added the code in winuser.h like this typedef BOOL (CALLBACK* SetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); and executed my program.then i got the error like this error C2564: 'int (__stdcall *)(struct HWND__ *,unsigned long,unsigned char,unsigned long)' : function-style conversion to builtin type takes only one argument Error executing cl.exe. i think it is the problem with the declaration of the function in winuser.h. can you please tell me how to come out of this error.
Well... I really meant for you to copy the declaration letter for letter. So at the bottom of winuser.h COPY AND PASTE this Code: #define WS_EX_LAYERED 0x80000 BOOL WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD); ------------------------------- I'm pretty sure that this will NOT work, and the error you get is concurrent. "typedef BOOL (CALLBACK* SetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);" Sorry for any misunderstanding