Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  166

•  TDictionary Custom Sort  3 340

•  Fast Watermark Sources  3 093

•  3D Designer  4 849

•  Sik Screen Capture  3 348

•  Patch Maker  3 554

•  Айболит (remote control)  3 664

•  ListBox Drag & Drop  3 016

•  Доска для игры Реверси  81 720

•  Графические эффекты  3 946

•  Рисование по маске  3 250

•  Перетаскивание изображений  2 631

•  Canvas Drawing  2 754

•  Рисование Луны  2 584

•  Поворот изображения  2 191

•  Рисование стержней  2 169

•  Paint on Shape  1 569

•  Генератор кроссвордов  2 239

•  Головоломка Paletto  1 767

•  Теорема Монжа об окружностях  2 233

•  Пазл Numbrix  1 685

•  Заборы и коммивояжеры  2 059

•  Игра HIP  1 282

•  Игра Go (Го)  1 230

•  Симулятор лифта  1 475

•  Программа укладки плитки  1 219

•  Генератор лабиринта  1 548

•  Проверка числового ввода  1 367

•  HEX View  1 497

•  Физический маятник  1 358

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Вывести диалог свойств принтера



Оформил: DeeCo

{ 
  If you need to create your own printer dialog, you can use the PrinterProperties 
  API function to bring up a printer's properties dialog. 
}

 uses
   WinSpool, Printers;

 procedure TForm1.Button1Click(Sender: TObject);
 const
   { 
   The TPrinterDefaults structure specifies the default data type, 
   environment, initialization data, and access rights for a printer. 
  }
   Defaults: TPrinterDefaults = (pDatatype: nil;
     pDevMode: nil;
     DesiredAccess: STANDARD_RIGHTS_REQUIRED or PRINTER_ACCESS_USE);
 var
   hPrinter: THandle;
   Device: array[0..255] of char;
   Driver: array[0..255] of char;
   Port: array[0..255] of char;
   hDeviceMode: THandle;
   RetVal: Boolean;
 begin
   Printer.PrinterIndex := Combobox1.ItemIndex;
   { Retrieve information about the specified printer }
   Printer.GetPrinter(Device,
     Driver,
     Port,
     hDeviceMode);
   { Retrieve a handle identifying the specified printer or print }
   if not OpenPrinter(@Device, hPrinter, @Defaults) then
     RaiseLastWin32Error;
   try
     { Display a printer-properties property sheet for the specified printer }
     PrinterProperties(Handle, hPrinter);
   finally
     { Close the specified printer object }
     ClosePrinter(hPrinter);
   end;
 end;

 procedure TForm1.FormCreate(Sender: TObject);
 begin
   { Show available printers in a Combobox }
   Combobox1.Items := Printer.Printers;
   Combobox1.ItemIndex := 0;
 end;







Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте