Default Windows Printer Name (OpenInsight Specific)
At 15 OCT 1998 01:34:36PM Dave Pociu wrote:
I need a way to get the name of the default Windows printer on a workstation.
There is Utility( "PRINTSETUP) that allows the user to choose the default printer. It does not however return the printer's name.
At 15 OCT 1998 01:55PM Carl Pates wrote:
Hi Dave,
You can get it via a call to GetProfileString API call (which is already prototyped in OI).
It's in the windows section under the entry name 'device'.
eg.
Declare Function GetProfileString
Buffer=Str( \00\, 255 )
BufferLen=255
Section=windows" : \00\
Entry=default" : \00\
Default=\00\
NameLen=GetProfileString(Section, Entry, Default, Buffer, BufferLen )
PrinterName=Buffer1,\00\
World Leaders in all things RevSoft
At 15 OCT 1998 07:31PM Dave Pociu wrote:
We're not worthy… ;)
At 16 OCT 1998 01:54PM Dave Pociu wrote:
At 16 OCT 1998 01:58PM Dave Pociu wrote:
For anyone that wants to do this, here is what I had to do past what Carl suggested:
1. Prototyped GetProfileString in SYSPROCS DLL_KERNEL as
SHORT PASCAL GetProfileString(LPCHAR,LPCHAR,LPCHAR,LPCHAR,SHORT)
I had GetPrivateProfileString prototyped in there, not GetProfileString.
2. Entry=device":\00\
My printer is listed under "device" not "default".
Carl, thanks again for your help.
At 18 OCT 1998 07:56PM Carl Pates wrote:
My printer is listed under "device" not "default".
Doh! Guess you are worthy then!
At 19 OCT 1998 09:55AM Cameron Revelation wrote:
Dave,
Just look at PRINTSETUP_EQUATES and PRINTSETUP.
Cameron Purdy
Revelation Software