Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
Delphi 7 Enterprise
|
Re: Standarddrucker ändern
29. Jul 2003, 12:57
Hallo,
Delphi-Quellcode:
var
Device: array[0..255] of char;
Driver: array[0..255] of char;
Port: array[0..255] of char;
hDeviceMode: THandle;
begin
Printer.PrinterIndex := ....; {select printer to make default}
Printer.GetPrinter(Device, Driver, Port, hDeviceMode);
StrCat( Device, ',');
StrCat( Device, Driver );
StrCat( Device, ',');
StrCat( Device, Port );
WriteProfileString( 'windows', 'device', Device );
StrCopy( Device, 'windows' );
SendMessage( HWND_BROADCAST, WM_WININICHANGE, 0, longint( @Device ));
end;
Quelle: How to set the default printer in Windows
Armin P. Pressler
BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
|
|
Zitat
|