[comp.sys.mac.programmer] What printer's selected?

al@crucible.UUCP (Al Evans) (04/03/91)

Unavoidably, I need to find out from an application what printer is
currently selected. Maybe I'm just being brain-dead, but I can't
seem to find any "legal" way. The closest I've come up with is to
get the h & v resolutions from a PrGeneral call, and make an
educated guess based on the results. But this seems kinda clunky:-)
Am I just missing something obvious? 
					--Al Evans--
-- 

Al Evans                                                Reality is like this:
al@crucible.uucp                                          We are born knowing
uunet!execu!sequoia!crucible!al                 the world isn't what we think.

peirce@outpost.UUCP (Michael Peirce) (04/04/91)

In article <312@crucible.UUCP>, al@crucible.UUCP (Al Evans) writes:
> 
> Unavoidably, I need to find out from an application what printer is
> currently selected. Maybe I'm just being brain-dead, but I can't
> seem to find any "legal" way. The closest I've come up with is to
> get the h & v resolutions from a PrGeneral call, and make an
> educated guess based on the results. But this seems kinda clunky:-)
> Am I just missing something obvious? 

Get the STR resource with ID = -8192.  This is the name of currently
selected printer.  I'm not sure if names like "LaserWriter" or "ImageWriter"
change on international systems?

-- michael

--  Michael Peirce         --   outpost!peirce@claris.com
--  Peirce Software        --   Suite 301, 719 Hibiscus Place
--  Macintosh Programming  --   San Jose, California 95117
--           & Consulting  --   (408) 244-6554, AppleLink: PEIRCE