调用API哪个函数可以把WINDOWS状态栏自动隐藏(100分)

  • 主题发起人 主题发起人 wguo
  • 开始时间 开始时间
W

wguo

Unregistered / Unconfirmed
GUEST, unregistred user!
请哪位高手指点迷津!
 
&nbsp;hTaskbarWnd : THandle ;<br>begin &nbsp; <br>hTaskbarWnd := FindWindow('Shell_traywnd', ''); &nbsp;<br>&nbsp;SetWindowPos(hTaskbarWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW);<br>end;<br>procedure TForm1.Button2Click(Sender: TObject); <br>//顯示 taskbarvar &nbsp;hTaskbarWnd : <br>THandle ;begin &nbsp; hTaskbarWnd := FindWindow('Shell_traywnd', ''); &nbsp;<br>&nbsp;SetWindowPos(hTaskbarWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW);
 
SetWindowPos只是调整窗口位置及大小吧<br>换成showwindow才是控制隐藏吧
 
var<br>&nbsp; hStatusBarhandle:thandle;<br>&nbsp; wndclass:array[0..50] of char;<br>begin<br>&nbsp; strpcopy(@wndclass[0],'shell_traywnd');<br>&nbsp; hStatusBarhandle:=findwindow(@wndclass[0],nil);<br>&nbsp; showwindow(hStatusBarhandle,sw_hide); &nbsp;<br>// &nbsp;showwindow(hStatusBarhandle,sw_show); &nbsp;//恢复用sw_show或者sw_restore<br>
 
Var<br>&nbsp; &nbsp;Handle:Thandle;<br>&nbsp; &nbsp;WinState:Array[0..50] of Char;<br>begin<br>&nbsp; &nbsp;StrCopy(@winState[0],'Shell_Traywnd');<br>&nbsp; &nbsp;Handle:=FindWindow(@winstate[0],nil);<br>&nbsp; &nbsp;showwindow(Handle,Sw_Hide); &nbsp; /*进行隐藏*/<br>&nbsp; &nbsp;ShowWindow(Handle,Sw_Show); &nbsp; /*进行显示*/<br>end;<br><br>
 
呵呵,楼上的方案OK,我都试过了。。。:)<br><br>有收获。。:)
 
后退
顶部