Here is a basic example that will drive the dialog up using a function that accepts the job name (which is the file name without the job extension)
Hope this helps,
Russell
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComObj, ActiveX, ShlObj;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure DisplayTaskPropertySheet(J
var pidl: PITEMIDLIST;
lpInvoke: CMINVOKECOMMANDINFO;
lpMsg: TMsg;
pMenu: IContextMenu;
pMalloc: IMalloc;
pDesktopFolder: IShellFolder;
pFolder: IShellFolder;
pEnum: IEnumIDList;
lpName: TStrRet;
szPath: String;
bFound: Boolean;
dwFetch: Cardinal;
chEaten: ULONG;
dwAttributes: ULONG;
begin
// Set default found state
bFound:=False;
// Determine path for tasks
SetLength(szPath, MAX_PATH);
dwFetch:=GetWindowsDirecto
SetLength(szPath, dwFetch);
szPath:=szPath+'\Tasks';
// Get a pointer to the Desktop's IShellFolder interface.
if (SUCCEEDED(SHGetDesktopFol
begin
// Get malloc
SHGetMalloc(pMalloc);
// Convert the path to an ITEMIDLIST.
if (pDesktopFolder.ParseDispl
begin
// Bind to the object
if (pDesktopFolder.BindToObje
begin
// Get the folder enumerator
if (pFolder.EnumObjects(0, SHCONTF_NONFOLDERS, pEnum) = S_OK) then
begin
// Locate the file
while (pEnum.Next(1, pidl, dwFetch) = S_OK) do
begin
// Check for file
if (pFolder.GetDisplayNameOf(
begin
// Check for correct item
if (CompareText(String(lpName
begin
// Get context menu for item
if (pFolder.GetUIObjectOf(0, 1, pidl, IContextMenu, nil, pMenu) = S_OK) then
begin
// Setup for menu item
lpInvoke.cbSize:=SizeOf(CM
lpInvoke.fMask:=CMIC_MASK_
lpInvoke.hwnd:=GetDesktopW
lpInvoke.lpParameters:=nil
lpInvoke.lpDirectory:=nil;
lpInvoke.nShow:=SW_SHOW;
lpInvoke.dwHotKey:=0;
lpInvoke.hIcon:=0;
// Fire the "Properties" menu item
lpInvoke.lpVerb:=MakeIntRe
if (pMenu.InvokeCommand(lpInv
begin
// Required to allow the dialog to display
Sleep(1000);
end;
// Release interface
pMenu:=nil;
end;
// Set found
bFound:=True;
end;
// Free memory
pMalloc.Free(lpName.pOleSt
// Break if done
if bFound then break;
end;
end;
// Release interface
pEnum:=nil;
end;
// Release interface
pFolder:=nil;
end;
end;
// Release interfaces
pDesktopFolder:=nil;
pMalloc:=nil;
end;
end;
procedure TForm1.Button1Click(Sender
begin
DisplayTaskPropertySheet('
end;
Main Topics
Browse All Topics





by: frizePosted on 2005-08-10 at 11:17:42ID: 14644846
see this beatiful component : m/tasksche duler.html
http://www.sicomponents.co
i think that will help you