CoNFuCiOuS
01-08-2002, 08:05 PM
hi, I'm making my own ownerdraw menus, and I saw that the Font "Marlett" has checkmarks and everything, so I was thinking of using that rather than including a picture and mask of a check with my files. so my question is : how do I choose my own font for a DC? I've seen the CreateFont Api example on allapi.net, but I dont understand what's going on there... an example of the createfont api and how to use it or any other method of using "Marlett" to drawtext on my dc would be helpful
thanks
Thinker
01-08-2002, 08:14 PM
Did you ever download the API-Guide from allapi.net (http://allapi.net)? It seems to
have a good example of just what you asked.
CoNFuCiOuS
01-08-2002, 08:17 PM
well, since I use netzero, the word download scared me, its **** slow even after I cracked it..lol but ill check it out if you say its good
thanks
Volte
01-09-2002, 01:48 PM
You don't even need to download API-guide (although it is very handy!) as they have the entire data-base on the website.
divil
01-09-2002, 02:25 PM
Create your font object, select it in to the DC, then you can use it. Remember to select it out again though.
CoNFuCiOuS
01-11-2002, 08:03 PM
thanks guys, I downloaded the api guide...its amazing...so many api's that ms's api viewer doesn't have. My menus look nice, and ez code to draw the check marks and stuff now :)
CoNFuCiOuS
01-11-2002, 08:05 PM
oh yeah, divil, what do you mean select out?
do you mean use DeleteObject?
ChiefRedBull
01-12-2002, 03:23 AM
Once you've selected an object into a DC with SelectObject, the handle to the old object is returned. eg:
oldObj = SelectObject(newObj, hDC)
Once you've ifnished with it, you should really always select the old object back in. eg:
retVal = SelectObject(oldObj, hDC)
This just keeps everything neat and in its proper place. Then kill the dc...
DeleteDC hDC
Chief
Derek Stone
01-12-2002, 11:40 AM
You might even try this:
DeleteObject SelectObject(hDC, hObject)
Good Luck
-cl
CoNFuCiOuS
01-12-2002, 01:07 PM
ok, thanx
everything works great.