I need to use my program installed on flash pendrive to be used on several computers.I need to test, if selected printer (saved in INI file) is present on machine.
How to get list of printers installed on exact machine?
Marek
PS. I found in other minigui something like that:
private aprinters := {}
INIT PRINTSYS
GET PRINTERS TO aprinters
RELEASE PRINTSYS
but it doesn't work in our HMG 2.6.7
How to get list of active printers?
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: How to get list of active printers?
If you want that the user select a printer for a list with all available, you could use the GetPrinter() function.mol wrote:I need to use my program installed on flash pendrive to be used on several computers.I need to test, if selected printer (saved in INI file) is present on machine.
How to get list of printers installed on exact machine?
Marek
PS. I found in other minigui something like that:
private aprinters := {}
INIT PRINTSYS
GET PRINTERS TO aprinters
RELEASE PRINTSYS
but it doesn't work in our HMG 2.6.7
If you want to do it yourself, you can use the aPrinters() (internal) function.
Sample:
Code: Select all
cPrinter := GetPrinter()
If Empty (cPrinter)
Return
EndIf
SELECT PRINTER cPrinter ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_LETTER ;
QUALITY PRINTER_RES_MEDIUM
Code: Select all
SELECT PRINTER DEFAULT ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_LETTER ;
QUALITY PRINTER_RES_MEDIUM
Code: Select all
SELECT PRINTER DIALOG TO lSuccess
If lSuccess == .T.
PrintDoc()
MsgInfo('Print Finished')
EndIf
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: How to get list of active printers?
Many thanks Roberto!
I dind't know anything about internal function aPrinters()
That's all I need for my project.
Best regards, Marek
I dind't know anything about internal function aPrinters()
That's all I need for my project.
Best regards, Marek
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: How to get list of active printers?
OOPS!...mol wrote:Many thanks Roberto!
I dind't know anything about internal function aPrinters()
That's all I need for my project.
Best regards, Marek
I've documented aPrinters(). It is in \hmg\doc\print.html.
I've said 'internal' because I've added to be used by GetPrinter() function and I not use it directly.
Anyway... its early in the morning here and I've not drink my first coffee yet ...
I must avoid to answer messages prior to breakfast
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)