>>>>Hi everybody!
>>>>
>>>>Does anybody know, how I could determine the Windows 95 (or NT4.0) default font properties? (name, size, color) (for menus and message box?)
>>>>I checked winapi32 functions like getsysmetrics, but I didnot find anything for this.
>>>>
>>>>Any advice?
>>>>
>>>>TIA
>>>>
>>>>BB
>>>
>>>Hi Bela,
>>>
>>>The Windows fonts definitions are stored in the registry under the HKEY_CURRENT_USER\ControlPanel\desktop\WindowMetrics key. It's stored as binary data, so you'll have to translate it. Byte 0 is the font size, bytes 8 and 9 the style. The font name begins at byte 18. All told, there are 50 bytes associated with this information. You can use the registry class that comes with VFP 5 is retrieve this information.
>>>
>>>HTH,
>>>
>>>George
>>
>>Thaks! I have found as you wrote.
>>
>>I consult a man, who told that this is a C++ LOGFONT structure, stored to there.
>>
>>I looked the registry data, and as I saw the font name is double byte character string. How can it be translated to single byte string?
>>
>>BB
>
>Bela,
>
>Look at the STRCONV() function in the VFP help file. If you want to see an example, look in the Knowledge Base here, at the posting Michel made on converting single to double byte strings (UNICODE). It's in the WIN32 and other APIs section. Thanks, Michel.
>
>George
Thanks for your answer.
I tested the registry entries mentioned above, and I saw, that under NT and Win95 the values are different in type. The length of a font entry in NT is 92 byte long and font name is in two byte format. But under Win 95, the font name is in normal string format and the structure of the whole entry is, like You wrote. I know that NT internal character format is UNICODE. But is it good practice to write code, that differ depending on the OS type. And what if the next windows version use a different format?
Any comment?
BB
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement