wimmeyvaert
asked on
Calling Start-Settings-Printers
Hi Experts,
Is there anyone who knows how to open Start-Settings-Printers from within a Delphi-application ?
I'm using D5, Win NT4 SP6.
Thanx,
The Mayor.
Is there anyone who knows how to open Start-Settings-Printers from within a Delphi-application ?
I'm using D5, Win NT4 SP6.
Thanx,
The Mayor.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
uses ShellApi, ShlObj;
procedure TForm1.Button1Click(Sender
var
PIDL:PItemIDList;
Info:TShellExecuteInfo;
pInfo:PShellExecuteInfo;
WaitCode:DWord;
begin
{Obtenemos PIDL de la carpeta virtual}
{get PIDL of the virtual folder}
SHGetSpecialFolderLocation
CSIDL_PRINTERS,
PIDL);
{Puntero a Info}
{Pointer to Info}
pInfo:=@Info;
{Rellenamos Info}
{Fill info}
With Info do
begin
cbSize:=SizeOf(Info);
fMask:=SEE_MASK_NOCLOSEPRO
SEE_MASK_IDLIST;
wnd:=Handle;
lpVerb:=nil;
lpFile:=nil;
{Parametros al ejecutable}
{Executable parameters}
lpParameters:=nil;
lpDirectory:=nil;
nShow:=SW_ShowNormal;
hInstApp:=0;
lpIDList:=PIDL;
end;
{Ejecutamos}
{Execute}
ShellExecuteEx(pInfo);
{Esperamos que termine}
{Wait to finish}
repeat
WaitCode := WaitForSingleObject(Info.h
Application.ProcessMessage
until (WaitCode <> WAIT_TIMEOUT);
end;
This does the trick!
But is there anyone who knows how to open the printerspooler from a speicific printer from within a Delphi-App ?