关于透明桌面图标(45分)

  • 主题发起人 主题发起人 太阳火
  • 开始时间 开始时间

太阳火

Unregistered / Unconfirmed
GUEST, unregistred user!
//Currently I am using the following codes:
//uses commctrl;
var Wnd: HWND;
ItemCount: integer;
begin
Wnd := FindWindow('ProgMan', nil);
Wnd := GetWindow(Wnd, GW_CHILD);
Wnd := GetWindow(Wnd, GW_CHILD);
{ OR:
Wnd := FindWindow('Progman', 'Program Manager');
Wnd := FindWindowEx(Wnd, 0, PChar('SHELLDLL_DefView'), nil);
Wnd := FindWindowEx(Wnd, 0, PChar('SysListView32'), nil);
}
SendMessage(Wnd, LVM_SETTEXTBKCOLOR, 0, CLR_NONE);
//OR ListView_SetTextBkColor(wnd, clr_none);
ItemCount := SendMessage(Wnd, LVM_GETITEMCOUNT, 0, 0);
SendMessage(Wnd, LVM_REDRAWITEMS, 0, ItemCount - 1);
//OR ListView_RedrawItems(wnd, 0, Pred(ListView_GetItemCount(wnd)));
UpdateWindow(Wnd);
end;

//It works when the Active Desktop is off, but if you turn on active desktop, it doesn't work.

//Anyone can provide me the workable code?

//Thanks a lot.
 
这是我的一段类似的代码:
SendMessage(Wnd2,WM_SETTEXT, 0, LPARAM(MPGName));
Wnd2:=FindWindowEx(Wnd1,HWND1,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
i:=SendMessage(Wnd2,BM_GETCHECK,0,0);
if i=BST_UNCHECKED then begin
SendMessage(Wnd2,WM_LBUTTONDOWN, 0,0);
SendMessage(Wnd2,WM_LBUTTONUP, 0,0);
end;
Wnd2:=FindWindowEx(Wnd1,HWND1,'Button',nil);
SendMessage(Wnd2,WM_LBUTTONDOWN, 0,0);
SendMessage(Wnd2,WM_LBUTTONUP, 0,0);
end
 
这是我一段类似的代码:
Wnd1:=FindWindow('#32770','avi2vcd - AVI 到 VCD MPEG-1 编码器 1.4.2');
if Wnd1>0 then begin
Hwnd1:=0;
Wnd2:=FindWindowEx(Wnd1,HWND1,'Edit',nil);
SendMessage(Wnd2,WM_SETTEXT, 0, LPARAM(AVIName));
MPGName:=FIniFile.ReadString('VideoProperty','VCDPath','C:/');
MPGName:=MPGName+'/'+DEdit2.Text;
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Edit',nil);
SendMessage(Wnd2,WM_SETTEXT, 0, LPARAM(MPGName));
Wnd2:=FindWindowEx(Wnd1,HWND1,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
Wnd2:=FindWindowEx(Wnd1,Wnd2,'Button',nil);
i:=SendMessage(Wnd2,BM_GETCHECK,0,0);
if i=BST_UNCHECKED then begin
SendMessage(Wnd2,WM_LBUTTONDOWN, 0,0);
SendMessage(Wnd2,WM_LBUTTONUP, 0,0);
end;
Wnd2:=FindWindowEx(Wnd1,HWND1,'Button',nil);
SendMessage(Wnd2,WM_LBUTTONDOWN, 0,0);
SendMessage(Wnd2,WM_LBUTTONUP, 0,0);
end
 
我的问题不是如何找HANDLE呀。我的意思是如果开了WEB方式显示桌面,就无效了。
 
这类问题 不值得纠缠太多 本身就是MS OS的一个BUG 而且是已淘汰操作系统 当然实在需要就搜MSDN
 
多人接受答案了。
 
后退
顶部