关于任务栏(50分)

  • 主题发起人 主题发起人 jan96
  • 开始时间 开始时间
J

jan96

Unregistered / Unconfirmed
GUEST, unregistred user!
请问怎样在程序里修改WINDOWS任务栏的属性<br>比如修改“总在罪前”、“自动隐藏”等?<br>继续要调用哪个API函数?<br>请教
 
似乎直接改注册表配置要好些? 可惜键值我不知道, 关注<br>帮你顶
 
不用改注册表吧?<br>应该有API直接修改
 
ft...建议下载Hubdog葵花宝典,就算记不住,查起来也方便...<br><br>procedure hideTaskbar; //隐藏<br>var <br>wndHandle : THandle; <br>wndClass : array[0..50] of Char;<br>begin <br>StrPCopy(@wndClass[0], 'Shell_TrayWnd'); <br>wndHandle := FindWindow(@wndClass[0], nil); <br>ShowWindow(wndHandle, SW_HIDE); <br>End;<br><br>procedure showTaskbar;<br>var <br>wndHandle : THandle; <br>wndClass : array[0..50] of Char; <br>begin <br>StrPCopy(@wndClass[0], 'Shell_TrayWnd'); <br>wndHandle := FindWindow(@wndClass[0], nil); <br>ShowWindow(wndHandle, SW_RESTORE); <br>end; <br>
 
多人接受答案了。
 
或许对你有用!<br>procedure TPhoenixForm.FormCreate(Sender: TObject);<br>var<br>&nbsp; Sav:LongInt;<br>&nbsp; wndHandle:THandle;<br>&nbsp; wndClass:array[0..50] of Char;<br>begin<br>&nbsp; //隐藏任务栏<br>&nbsp; StrCopy(@wndClass[0],'Shell_Tray Wnd');<br>&nbsp; wndHandle:=FindWindow(@wndClass[0],nil);<br>&nbsp; ShowWindow(wndHandle,SW_HIDE);<br>&nbsp; //隐藏标题栏<br>&nbsp; if BorderStyle=bsNone then<br>&nbsp; begin<br>&nbsp; &nbsp; Exit;<br>&nbsp; end;<br>&nbsp; Sav:=GetWindowLong(Handle,GWL_STYLE);<br>&nbsp; if (Sav and WS_CAPTION)=WS_CAPTION then<br>&nbsp; begin<br>&nbsp; &nbsp; case BorderStyle of<br>&nbsp; &nbsp; &nbsp; bsSingle,<br>&nbsp; &nbsp; &nbsp; bsSizeable:SetWindowLong(Handle,GWL_STYLE,Sav and (Not(WS_CAPTION)) or WS_BORDER) ;<br>&nbsp; &nbsp; &nbsp; bsDialog:SetWindowLong(Handle,GWL_STYLE,Sav and (Not(WS_CAPTION)) or DS_MODALFRAME or WS_DLGFRAME);<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; Height:=Height-GetSystemMetrics(SM_CYCAPTION); &nbsp; &nbsp; //高度减去正常的标题栏的高度<br>&nbsp; &nbsp; Refresh; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //GetSystemMetrics方法得到不同的系统结构设置<br>&nbsp; end;<br>&nbsp; Brush.Style:=bsClear; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//隐藏背景,使窗体变成透明<br>&nbsp; Inherited;<br>end;
 

Similar threads

回复
0
查看
1K
不得闲
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部