Thema: Delphi Form in Programm

Einzelnen Beitrag anzeigen

jensw_2000
(Gast)

n/a Beiträge
 
#6

Re: Form in Programm

  Alt 29. Aug 2005, 00:05
Da habe ich was für euch (gefunden)...

stammt aus diesem Thread:

http://www.delphipraxis.net/internal...deletetabentry

Delphi-Quellcode:
unit TaskbarIntf ;
// Code: DelphiPraxis "SCP"

interface
uses
  ComObj,windows;

const
  CLSID_TaskbarList: TGUID = '{56FDF344-FD6D-11d0-958A-006097C9A090}';
type
  ITaskbarList = interface
    ['{56FDF342-FD6D-11d0-958A-006097C9A090}']
       function HrInit: HResult; stdcall;
       function AddTab(hwnd: Cardinal): HResult; stdcall;
       function DeleteTab(hwnd: Cardinal): HResult; stdcall;
       function ActivateTab(hwnd: Cardinal): HResult; stdcall;
       function SetActiveAlt(hwnd: Cardinal): HResult; stdcall;
  end;

 function DeleteTabEntry(Wnd: hWnd) : boolean;

implementation

function DeleteTabEntry(Wnd: hWnd) : boolean;
const
  IID_ITaskBarList: TGUID ='{56FDF342-FD6D-11D0-958A-006097C9A090}';
var
  FTaskbarList: ITaskBarList;
begin
  result := (Wnd <> 0);
  if result then
  try
    FTaskbarList := CreateComObject(CLSID_TaskbarList) as ITaskbarList;
    FTaskbarList.HrInit;
    result := (FTaskbarList.DeleteTab(Wnd) = S_OK);
  except
    On EOleSysError do
      result := false
    else
      raise;
  end;
end;
end.
Aufruf im DLL-Form - FormCreate

  TaskbarIntf.DeleteTabEntry(findwindow('TApplication', nil)); ...und schon ist der Taskbareintrag des DLL-Forms weg ...
  Mit Zitat antworten Zitat