-
September 3rd, 2001, 03:42 AM
#1
Transparent Icons
Hi
Any idea how to make the text background for icons appear transparent ? I want to remove the block colour that appears behind the text.
Thanks
Jase
<no witty trailer supplied>
Jase
www.slideshowdesktop.com
View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows....
-
September 3rd, 2001, 08:59 AM
#2
Re: Transparent Icons
Assuming you're asking about desktop icons, give this little app a try. It will also allow you to change the text color (via command line switches):
#include <windows.h>
#include <commctrl.h>
#include <stdio.h>
WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
HWND hWnd;
COLORREF crTextColor;
crTextColor = RGB(0, 0, 0);
if( *lpCmdLine ) {
char cC=0;
int iR=0, iG=0, iB=0, iA=0;
sscanf(lpCmdLine, "%d %d %d %d %c", &iR, &iG, &iB, &iA, &cC);
crTextColor = RGB(max(0, min(255, iR+iA)), max(0, min(255, iG+iA)), max(0, min(255, iB+iA)));
if( cC )
crTextColor = ~crTextColor;
} else {
crTextColor = ~GetSysColor(COLOR_BACKGROUND);
}
if( hWnd = FindWindowEx(NULL, NULL, "Progman", NULL) ) {
if( hWnd = FindWindowEx(hWnd, NULL, "SHELLDLL_DefView", NULL) ) {
if( hWnd = FindWindowEx(hWnd, NULL, "SysListView32", NULL) ) {
ListView_SetBkColor (hWnd, CLR_NONE);
ListView_SetTextBkColor(hWnd, CLR_NONE);
ListView_SetTextColor (hWnd, crTextColor);
ListView_RedrawItems (hWnd, 0, ListView_GetItemCount(hWnd) - 1);
}
}
}
return 0;
}
-
September 3rd, 2001, 09:58 AM
#3
Re: Transparent Icons
good man, this does the trick nicely ...
i had actually found some VB code that does this shortly before you posted and had rewritten it in c++ so the technique here comes as no surprise now, however i had no idea that those ListView_ functions existed - thanks for posting those. I'd been using
::PostMessage(hwnd, LVM_SETTEXTCOLOR, 0, clrText);
// Add a rectangle to the listview's update region. This is the portion of
// the window's client area that must be redrawn. The 0 parameters tells
// it to redraw the entire client area.
::InvalidateRect(hwnd, NULL, TRUE);
I prefer your method so i'm using that now.
Thanks
jase
<no witty trailer supplied>
Jase
www.slideshowdesktop.com
View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows....
-
September 3rd, 2001, 03:45 PM
#4
Re: Transparent Icons
I've noticed in my testing that using CLR_NONE as the text background color only works in classic desktop mode, and NOT on an active desktop (view as web page). oddly enough, it works fine setting it to any other color - just not to CLR_NONE.
any ideas?
Jase
<no witty trailer supplied>
Jase
www.slideshowdesktop.com
View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|