如果你想要改变Windows的缺省打印机,你必须在Windows的WIN.INI中改变设备键。
发送一条 WM_WININICHANGE 消息:
var
strIni: array[0..MAX_PATH] of Char;
arrWindows: array[0..64] of Char;
begin
GetWindowsDirectory(strIni, SizeOf(strIni));
StrCat(strIni, ''''\win.ini'''');
with TIniFile.Create(strIni) do
try
WriteString(''''windows'''', ''''device'''', ''''HP LaserJet 4 Plus,HPPCL5MS,LPT1:'''');
finally
Free;
end;
StrCopy(arrWindows, ''''windows'''');
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@arrWindows));
end;
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




