Transparent Dialog but not control..
-
Hello all.. I don't know how to achieve this but i guess that's possible.. I've one dialog box and a picture control on it. I'm using CxImage Class to load and display PNG on that picture box.. Till now everything is good.. Now i've to show that PNG in a way so that it look like it's drawn on desktop screen. So for that i make my dialog transparent.. But making dialog transparent makes my picture control transparent. So no PNG is being shown. How do i overcome this problem...Or is there any way in CxImage Class to show PNG directly on desktop screen by taking DC of desktop screen.. Here is code to make dialog transparent..
SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE)^WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd,RGB(0,0,0),0,LWA_ALPHA);Thanks all...
-
Hello all.. I don't know how to achieve this but i guess that's possible.. I've one dialog box and a picture control on it. I'm using CxImage Class to load and display PNG on that picture box.. Till now everything is good.. Now i've to show that PNG in a way so that it look like it's drawn on desktop screen. So for that i make my dialog transparent.. But making dialog transparent makes my picture control transparent. So no PNG is being shown. How do i overcome this problem...Or is there any way in CxImage Class to show PNG directly on desktop screen by taking DC of desktop screen.. Here is code to make dialog transparent..
SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE)^WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd,RGB(0,0,0),0,LWA_ALPHA);Thanks all...
-
Hello all.. I don't know how to achieve this but i guess that's possible.. I've one dialog box and a picture control on it. I'm using CxImage Class to load and display PNG on that picture box.. Till now everything is good.. Now i've to show that PNG in a way so that it look like it's drawn on desktop screen. So for that i make my dialog transparent.. But making dialog transparent makes my picture control transparent. So no PNG is being shown. How do i overcome this problem...Or is there any way in CxImage Class to show PNG directly on desktop screen by taking DC of desktop screen.. Here is code to make dialog transparent..
SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE)^WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd,RGB(0,0,0),0,LWA_ALPHA);Thanks all...
I think I told you yesterday did you see GetDesktopWindow?
-
I think I told you yesterday did you see GetDesktopWindow?
Yes i did.. And that'll be great if i show my PNG on desktop rather than dialog box.. I did something like this..
BeginPaint (hWnd, &ps) ;
HWND hDesktop = GetDesktopWindow();
HDC hdc = GetDC(hDesktop);
CxImage image("E:\\My_Prog\\FINAL_PNG\\Res\\Test.png", CXIMAGE_FORMAT_PNG);
BOOL iReturn = image.Draw(hdc, 50, 50);EndPaint (hWnd, &ps) ;
I get the handle of desktop and DC also.. But it didn't draw the PNG. What am i doing wrong?
-
Yes i did.. And that'll be great if i show my PNG on desktop rather than dialog box.. I did something like this..
BeginPaint (hWnd, &ps) ;
HWND hDesktop = GetDesktopWindow();
HDC hdc = GetDC(hDesktop);
CxImage image("E:\\My_Prog\\FINAL_PNG\\Res\\Test.png", CXIMAGE_FORMAT_PNG);
BOOL iReturn = image.Draw(hdc, 50, 50);EndPaint (hWnd, &ps) ;
I get the handle of desktop and DC also.. But it didn't draw the PNG. What am i doing wrong?
Its working for me of course like this: HWND hDesktop = ::GetDesktopWindow(); HDC hdc = ::GetDC(hDesktop); CImage image; image.Load("f:\\1.png"); BOOL iReturn = image.BitBlt(hdc, 50, 50);
-
Its working for me of course like this: HWND hDesktop = ::GetDesktopWindow(); HDC hdc = ::GetDC(hDesktop); CImage image; image.Load("f:\\1.png"); BOOL iReturn = image.BitBlt(hdc, 50, 50);
Ok so you're using BitBlt.. But when i use image.BilBlt it says. "error C2039: 'BitBlt' : is not a member of 'CxImage'" Obviously there's no member called BitBlt in CxImage Class.. So do i need to use CImage??? Does BitBlt comes under Cimage??? Or can i use BitBlt on CxImage??
-
Ok so you're using BitBlt.. But when i use image.BilBlt it says. "error C2039: 'BitBlt' : is not a member of 'CxImage'" Obviously there's no member called BitBlt in CxImage Class.. So do i need to use CImage??? Does BitBlt comes under Cimage??? Or can i use BitBlt on CxImage??
Yeah because I use of CImage class not CXImage article.
-
Yeah because I use of CImage class not CXImage article.
Alright.. Anyways i manage to Draw the PNG on desktop screen.. But the problem is that it get erases whenever any window is dragged on it.. Is there any way to refresh it???