windows启动过程中任务栏又冒了出来???(50分)

  • 主题发起人 powersun
  • 开始时间
P

powersun

Unregistered / Unconfirmed
GUEST, unregistred user!
我的程序要求随windows启动运行的,在注册表/RunServices中已注册,程序启动没问题。只不过在启动过程中mainform.formcreate中强制隐藏的任务栏一会儿又冒了出来,只有点击一次mainform后才正常。
why?怎样解决 ?

//隐藏 Windows 的任务条
hideTaskbar;
//隐藏 Windows 的任务条
procedure hideTaskbar;
var
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle := FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_HIDE);
End;
 
还有,怎样让此程序在windows启动后不失去焦点?
 
有个专门隐藏任务条的函数和AppBar有点关系,你搜索一下吧,记不清了。应该比ShowWindow管用。
 
在active中会怎样?
 
WINSHELLAPI UINT APIENTRY SHAppBarMessage(

DWORD dwMessage,
PAPPBARDATA pData
);


Parameters

dwMessage

Identifier of the appbar message to send. This parameter can be one of the following values:

ABM_ACTIVATE Notifies the system that an appbar has been activated.
ABM_GETAUTOHIDEBAR Retrieves the handle of the autohide appbar associated with a particular edge of the screen.
ABM_GETSTATE Retrieves the autohide and always-on-top states of the Windows taskbar.
ABM_GETTASKBARPOS Retrieves the bounding rectangle of the Windows taskbar.
ABM_NEW Registers a new appbar and specifies the message identifier that the system should use to send notification messages to the appbar.
ABM_QUERYPOS Requests a size and screen position for an appbar.
ABM_REMOVE Unregisters an appbar, removing bar from the system's internal list.
ABM_SETAUTOHIDEBAR Registers or unregisters an autohide appbar for an edge of the screen.
ABM_SETPOS Sets the size and screen position of an appbar.
ABM_WINDOWPOSCHANGED Notifies the system when an appbar's position has changed.


pData

Pointer to an APPBARDATA structure. The content of the structure depends on the value of
dwMessage.



Return Values

Returns a message-dependent value. For more information, see the documentation for the individual appbar messages.

See Also

APPBARDATA
 
to wk_knife:
再辛苦一下,写一下代码。
实在是因为我学了不久!
 
procedure hideTaskbar;
var
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle := FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_HIDE);
EnableWindow(wndHandle,False);//加一句不可用试试。
End;

应该没问题了。

对TaskBar取ABM_REMOVE好象不起作用。一般的AppBar都不这样。

 
to wk_knife:
还是不行。
 
我专门放到注册表中试了一下。我的代码很简单就那么几句,没出什么问题。
 
我在win2000中试的。
 
不要放在runserces里,放在run里就没问题,你试试。
 
maming:
那样启动时间太迟。
而在注册表/RunServices注册启动较早,所以我猜测可能后来其它的程序启动过程中又将它显示了。
能不能有API函数使它.....
 
那就在主程序中用消息循环吧!
//进入消息循环
while(GetMessage(Msg,Handle,0,0))do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;

//主窗口的消息处理函数
function WindowProc(hWnd,Msg,wParam,lParam:integer):Longint; stdcall;
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
I
回复
0
查看
531
import
I
D
回复
0
查看
2K
DelphiTeacher的专栏
D
顶部