您的位置:首页 > 其它

使桌面文字透明

2005-04-25 17:33 162 查看
#include "stdafx.h"
#include "DeskH.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifCWinApp theApp;using namespace std;int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
 HWND hWnd;
 hWnd = ::FindWindow("Progman", "Program Manager");
 hWnd=FindWindowEx(hWnd,NULL, "SHELLDLL_DefView",NULL);
 HWND hDesktop; hDesktop=::GetDlgItem(hWnd,1);
 ListView_SetTextBkColor(hDesktop,CLR_NONE);
 ListView_SetTextColor(hDesktop,CLR_DEFAULT);
 ::InvalidateRect(hDesktop,NULL,TRUE);
 return 0;
}
说明:
1)整个windows桌面就是一个窗体(名为Program Manager),而这个窗体里有一个ListView控件,所有的桌面菜单就是显示在这个ListView中。
2)ListView_SetTextBkColor是系统一个预定义的宏,此宏在COMMCTRL.H中定义。
3)得到ListView句柄,用ListView_SetTextBkColor完成功能。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息