在NT下不会自动的进纸,为什么?
CSDN有高手在吗?
delphi大富翁高手很多的.

解决方案 »

  1.   

    Printer.PrinterIndex := Printer.PrinterIndex;
            Printer.GetPrinter(Device,Driver,Port,hDMode);
            if hDMode <> 0 then
                    begin
                    pDMode := GlobalLock(hDMode);
                    if pDMode <> nil then
                            begin
    {                        pDMode^.dmPaperSize:=DMPAPER_USER;
                            pDMode^.dmPaperLength:=Height * 10;
                            pDMode^.dmPaperWidth:=Width * 10;  }
                            pDMode^.dmFields := pDMode^.dmFields or DM_FormName;
                            Form1.Flags := FORM_BUILTIN;
                            Form1.name := 'PrintFP';
                            Form1.Size.cx := 80;
                            FOrm1.Size.cy := 137;                        
                            if addform(Printer.handle,1,@Form1)  then
                                    showmessage('ok')
                            else
                                    showmessage('false');
                            pDMode^.dmFormName := 'Form1';
    {                        pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERSIZE;
                            pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERLENGTH;
                            pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERWIDTH;}
                            pDMode^.dmFields := pDMode^.dmFields or DM_FormName;
                            end;
            
                    ResetDC(Printer.Handle,pDMode^);
                    GLobalUnLock(hDMode);
                    end;
            Printer.PrinterIndex := Printer.PrinterIndex;
      

  2.   

    问题现在明显了,是在NT下,如何自定义纸张的问题,在程序中如何处理?
    addform总返回False,如何处理?
    斑竹在吗?大侠们在吗?
    分数不够可以再加啊
      

  3.   

    恢复dmpagesize指的是nt下的纸张序号。
      

  4.   

    系统好象无法自定义纸张大小,看来只好直接用Printer API了。