如何改变WINDOWS打印机的默认设置,我想改变打印机的默认设置为'横向'

解决方案 »

  1.   

    dialog面板的printsetupdialog组件里就可以修改啊
      

  2.   

    procedure TFrmPrint.cbPrintersChange(Sender: TObject);
    var
      IniFile: TIniFile;
      TempStr1, TempStr2: String;
      S: array[0..64] of char;
    begin
      with Printer do
      begin
        // Set the new printer based on the ComboBox's selected printer
        PrinterIndex := cbPrinters.ItemIndex;
        // Store the printer name into a temporary string
        TempStr1 := Printers[PrinterIndex];
        // Delete the unnecessary portion of the printer name
        System.Delete(TempStr1, Pos(' on ', TempStr1), Length(TempStr1));
        // Create a TIniFile class
        IniFile := TIniFile.Create('WIN.INI');
        try
          // Retrieve the device name of the selected printer
          TempStr2 := IniFile.ReadString('Devices', TempStr1, '');
          // Change the default printer to that chosen by the user
          IniFile.WriteString('windows', 'device', TempStr1 + ',' + TempStr2);
          // Tell all windows that the default printer changed. 
          StrCopy(S, 'windows');
          SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@S));
        finally
          IniFile.Free;
        end;
      end;end; 
    我自己用了,可以实现.
    朋友,有quickreport的打印demo吗,给个啦........急阿...
      

  3.   

    哦,急忙中发现看错了,以为你要改变默认打印机,结果你要改'默认打印机设置',呵呵,我闪了
    用api试试...