![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
TaskBar [D7, Win95/98]
Laymer © (2004-02-27 13:47:00)Не подскажите как убрать прогу из TaskBar и поместить ее туда где часы.
GLFox (2004-02-27 15:14:00) [1]Вот кусок рабочей проги
program WinObsrv;
uses
Windows,
Messages,
ShellAPI,
MainWnd in 'MainWnd.pas',
{$R *.res}
function TrayIconAdd(hWindow:HWND; IconID:Integer; sTip:String):Boolean;
var
hTrayIcon : HICON;
NID:NOTIFYICONDATA;
i,iMaxLen:Integer;
begin
NID.cbSize := sizeof(NOTIFYICONDATA);
NID.Wnd := hWindow;
NID.uID := IconID;
NID.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
NID.uCallbackMessage := WM_TrayIcon;
hTrayIcon:=LoadIcon(hInstance,'MAINICON');
NID.hIcon:=hTrayIcon;
if Length(sTip)>0 then begin
if Length(sTip)>(Length(NID.szTip)-1) then iMaxLen:=Length(NID.szTip)-1
else iMaxLen:=Length(sTip);
for i:=1 to iMaxLen do NID.szTip[i-1]:=sTip[i];
NID.szTip[iMaxLen]:=#0;
end else NID.szTip[0]:=#0;
Result:=Shell_NotifyIcon(NIM_ADD,@NID);
if (hTrayIcon<>0) then DestroyIcon(hTrayIcon);
end;
function TrayIconDel(hWindow:HWND; IconID:Integer):Boolean;
var NID:NOTIFYICONDATA;
begin
NID.cbSize:=sizeof(NOTIFYICONDATA);
NID.Wnd:= hWindow;
NID.uID:= IconID;
Result:=Shell_NotifyIcon(NIM_DELETE,@NID);
end;
var
Msg:TMsg;
WndMain:TMainWnd;
begin
WndMain:=TMainWnd.Create(hInstance,'');
TrayIconAdd(WndMain.Handle,IconIDMain,AppTitle+' '+AppVersion);
repeat
GetMessage(Msg,0{WndMain.Handle},0,0);
if Msg.message=WM_QUIT then Break;
TranslateMessage(Msg);
DispatchMessage(Msg);
until False;
TrayIconDel(WndMain.Handle,IconIDMain);
WndMain.Free;
end.
DeadMeat (2004-02-27 15:07:00) [2]Этт тебе к АП надо... Он этот вопрос любит...
VMcL (2004-02-27 14:41:00) [3]FAQ
___
LMD