home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14322 < prev    next >
Encoding:
Text File  |  1992-08-21  |  2.1 KB  |  57 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
  3. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  4. Subject: Re: HELP: how can I ...
  5. In-Reply-To: cchen@silver.ucs.indiana.edu's message of Fri, 21 Aug 1992 10:48:25 GMT
  6. Message-ID: <D88-JWA.92Aug21175725@dront.nada.kth.se>
  7. Originator: d88-jwa@dront.nada.kth.se
  8. Sender: usenet@kth.se (Usenet)
  9. Nntp-Posting-Host: dront.nada.kth.se
  10. Organization: Royal Institute of Technology, Stockholm, Sweden
  11. References: <BtBy0p.7Gt@usenet.ucs.indiana.edu>
  12. Date: Fri, 21 Aug 1992 16:57:25 GMT
  13. Lines: 42
  14.  
  15. > cchen@silver.ucs.indiana.edu writes:
  16.  
  17.    I am new to this THINK C programming stuff and I have two questions
  18.    that might be obvious to some of you seasoned MAC programmers:
  19.  
  20.    1. How can I find out what kind of video card is installed through my
  21.       program?
  22.  
  23. "What kind" !? What if there are several video cards? No card?
  24. Internal video? Multiple screens?
  25.  
  26. Maybe you mean what kinds of bit depths the attached screens
  27. have? Look in Inside Mac VI; it has a fairly good explanation.
  28. IM V also goes on about the same info. Beware; the user may
  29. change bit-depth at any time; if you write directly to screen,
  30. be sure to take that into account.
  31.  
  32. If you want to simply list "Card XXX installed" try:
  33. 1) If color QD is not available, it's internal to the machine.
  34. 2) If color QD _is_ available, loop through all screens/devices,
  35.    and check the slot info there, then query the slot.
  36.  
  37.    2. How can an application getthe document name/path through which the
  38.       application is invoked?
  39.  
  40. I posted on this yesterday...
  41.  
  42. Immediately after startup:
  43.  
  44.     short refNum = CurResFile ( ) ;
  45.     PBHGetFCBInfo ( .... using refNum .... ) ;
  46.  
  47. This will give you the name, the vRefNum and dirID to the
  48. current resource file, which happens to be the application
  49. at startup. Use HOpenDF to open the applications data fork
  50. using this info.
  51.  
  52. -- 
  53. - I have decided that it is not boxes but my lack of skill that's the problem.
  54. - Traitor! This kind of attitude will get you nowhere around here. If you must
  55.   know, it's not your boxes that are the problem, it's your lack of a
  56.   sufficient number of boxes. Go out and buy something.
  57.