//trans.cpp //デスクトップアイコンテキスト透過 //2000/11/02 kito ( kito@kun.ne.jp ) ver1.1 // This is Win32 GUI Program. // (It does't run on Console, but does't have Grafical User Interface, too. :-) // Compile CommandLine: bcc32 -tW trans.cpp #include #include int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR CmdLine, int CmdShow) { HWND hWindow, hDeskTop; RECT DeskTopRect; COLORREF color; int r; //この行でテキストの色を指定 color = RGB(0x00, 0x00, 0x00); hDeskTop = GetDesktopWindow(); hWindow = FindWindow("Progman", "Program Manager"); hWindow = FindWindowEx(hWindow, NULL, "SHELLDLL_DefView", NULL); hWindow = FindWindowEx(hWindow, NULL, "SysListView32", NULL); DeskTopRect.left = 0; DeskTopRect.top = 0; DeskTopRect.right = GetSystemMetrics(SM_CXSCREEN); DeskTopRect.bottom = GetSystemMetrics(SM_CYSCREEN); ListView_SetTextColor(hWindow, color); ListView_SetTextBkColor(hWindow, CLR_NONE); r = RedrawWindow(hDeskTop, &DeskTopRect, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); if(!r) Beep(3000, 300); //エラーの場合、Beep音が鳴る return 0; }