procedure SetDefaultPrinter(NewPrintName: string);
var
buffer: array[0..255] of Char;
name: string;
begin
name := NewPrintName;
if AnsiPos(',', name) = 0 then begin
name := name + ',';
end;
StrPCopy(buffer, name);
WriteProfileString('windows', 'device', buffer);
StrCopy(buffer, 'windows');
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, Longint(@buffer));
end;
沒有留言:
張貼留言