I just tested getDefaultPrinter() here and it works fine with Windows 8.1, FW13.04, xHarbour and Borland 5.82.
prnGetName() returns the current printer, which may, or may not, be the Windows default printer.
When any app is run, the current printer of that app is the Windows default printer. However, via any printer setup dialog, or via code the app may change the current printer for that app. So, when
prnGetName() you will get the Windows default printer, unless or until either the code or the user changes it.
I have this code in my notes for getting the Windows default printer. I have tested it just now and it works.
- Code: Select all Expand view
// Returns the Windows default printer
function getPrinter()
local cString
cString:= GetProfString( "windows", "device" , "" )
cString:= left(cString,at(",",cString)-1)
return cString
Hope it works for you.
James