如何在Windows中改变缺省打印机
发送一条 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;
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论