掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
プリンタのプロパティの設定を反映させるには? (ID:11540)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
できました。Mr.XRAY さんありがとうございます。 おそらく、毎回デフォルトの設定に戻していたのかと思います。 以下にできなかったコードを記します。 var Device, Driver, Port: array[0..79] of char; DeviceMode: THandle; procedure TForm1.Button1Click(Sender: TObject); var DevMode: PDeviceMode; begin if ComboBox1.ItemIndex < 0 then begin Exit; end; Printer.PrinterIndex := ComboBox1.ItemIndex; Printer.GetPrinter(Device, Driver, Port, DeviceMode); //以下の2行が間違いだと思います。 Printer.SetPrinter(Device, Driver, Port, 0); Printer.GetPrinter(Device, Driver, Port, DeviceMode); //Mr.XRAYさんのコードにはありませんでした。 DevMode := GlobalLock(DeviceMode); try DocumentProperties(Application.Handle, 0, Device, DevMode^, DevMode^, DM_PROMPT or DM_MODIFY or DM_COPY); finally GlobalUnlock(DeviceMode); end; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.