其他语言

位置:IT落伍者 >> 其他语言 >> 浏览文章

利用Delphi全面控制Windows任务栏[2]


发布日期:2021年04月21日
 
利用Delphi全面控制Windows任务栏[2]
()EnableOrDisable过程代码如下

procedure TFormEnableOrDisable(Sender:TOBject);

begin

GetHandles;

if TCheckBox(Sender) Checked then

case TCheckBox(Sender) Tag of

: EnableWindow(Wnd[ False);

: EnableWindow(Wnd[ False);

: EnableWindow(Wnd[ False);

: EnableWindow(Wnd[ False);

: EnableWindow(Wnd[ False);

end

else

case TCheckBox(Sender) Tag of

: EnableWindow(Wnd[ True);

: EnableWindow(Wnd[ True);

: EnableWindow(Wnd[ True);

: EnableWindow(Wnd[ True);

: EnableWindow(Wnd[ True);

end;

end;

()HideOrShow过程代码如下

procedure TFormHideOrShow(Sender:TObject);

begin

GetHandles;

if TCheckBox(Sender) Checked then

case TCheckBox(Sender) Tag of

: ShowWindow(Wnd[SWHIDE);

: ShowWindow(Wnd[SWHIDE);

: ShowWindow(Wnd[SWHIDE);

: ShowWindow(Wnd[SWHIDE);

: ShowWindow(Wnd[SWHIDE);

end

else

case TCheckBox(Sender) Tag of

: ShowWindow(Wnd[SWShow);

: ShowWindow(Wnd[SWShow);

: ShowWindow(Wnd[SWShow);

: ShowWindow(Wnd[SWShow);

: ShowWindow(Wnd[SWShow);

end;

end;

()FormClose事件代码如下//将Windows任务栏恢复到正常状态

procedure TFormFormClose(Sender:TObject; var Action: TCloseAction);

var i:Integer;

begin

for i:= to do

begin

EnableWindow(Wnd[i]True);

ShowWindow(Wnd[i]SWShow);

end;

end;

()按F运行程序以上程序在Delphi/Windows/简体中文版环境下调试通过

()说明本文所述方法同样适用于VBVCBCC++Builder等编程工具但应注意语法 变量类型等不同要求

[] []

               

上一篇:Delphi中动态链接库两种调用方式的比较

下一篇:利用Delphi全面控制Windows任务栏[1]