1、要显示或隐藏任务栏,首先要得到它的窗口句柄。任务栏是一个特殊的窗口,它的窗口类为: Shell-TrayWnd,没有标题,故只能用FindWindowEx函数来取得它的句柄: Function long FindWindowEx(long ph, long ch, ref String cn, ref String wn) Library ′user32′ Function Long ShowWindow(Long hWnd, Long nCmdShow ) Library ′user32′ 用ShowWindow来显示或隐藏窗口,其第二个参数为0表示隐藏,为5表示显示: handle = FindWindowEx(0,0,″Shell-TrayWnd″, wn)//wn为空串 ShowWindow(handle,0)//隐藏任务栏 -------------------------------------------------------------------------------------------------------------------------------------------------------- 2、 隐藏任务栏的方法,在OnCreate事件里利用Window API函数SetWindowLong:SetWindowLong(Application.Handle,GWL_EXstyle,WS_EX_TOOLWINDOW); PB使用时首先声明函数FUNCTION long SetWindowLong(ulong hWnd, integer nIndex, ulong dwNewLong) library "user32.dll" ALIAS FOR "SetWindowLongA", 然后调用:SetWindowLong(Handle(this),-20,128); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
pb:显示或隐藏windows的任务栏
最新推荐文章于 2024-08-08 17:46:22 发布