Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form's Caption_Assign
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00424701
Message ID:
00425489
Views:
9
>>Ok, I even found this code snippet. Still it doesn't clear for me, how can I retrieve necessary information in my VFP application:
>>
>>The following code snippet shows how to obtain a handle to the title bar font under Windows 95 or Windows NT 4.0:

Vlad,

You're really a genius! :) Have you tried this code and what results did you get? I have not functions, you mentioned, so if you can send them to me or post here, it would be great. I suspect, that we can find them in Ed Rauh clsHeap, but we have to check.

BTW, something weird and very hazard just happened on my work. Today I modified bunch of code in one of my applications on Developer Server. Right now I found, that bunch of directories and code had gone in this application directory. I'm 100% sure, that I didn't delete them... It would be a tremendeus lost for me, though of course, I can repeat all, what I've done.

>
>>    NONCLIENTMETRICS ncm;
>>    memset(&ncm, 0, _
>>		sizeof(ncm));
>>    ncm.cbSize = sizeof(ncm);
>>    SystemParametersInfo( _
>>	  SPI_GETNONCLIENTMETRICS,
>>	  0, &ncm, 0);
>>        //Get caption bar
>>		//font handle.
>>    hFontConsole = CreateFontIndirect( _
>>  &ncm.lfCaptionFont);
>
>
> First of all, need to say that SPI_GETNONCLIENTMETRICS works for Win95 system only, if my help file do not lie. Please, assure that it is what you need.
>
> Ok, following is VFP code. It is VERY draft. General idea is that structure in VFP is a single string from which you should extract values or put values. It is not simple because you should know manu things, like offset of certain fields in structure, how to convert integer value into binary representation in the string etc. I have no all these tools, but functions like 'IntToSTR' and 'StrtoInt' in my below sample probably already exist somwhere (I don't knw where exactly because I never used them). These functions convert integer to its 4-byte binary representation in string and vise versa. If you cannot find or make them, I can post their exact implementation.
>
> HTH.
>
>
>* following line should be corrected because I don't know exact number
>#DEFINE SIZE_OF_SPI_GETNONCLIENTMETRICS 4000
>* following should be examined and corrected too
>#DEFINE OFFSET_OF_cbSize 0
>
>#DEFINE SPI_GETNONCLIENTMETRICS 41
>
>* prepare string buffer for structure
>local lcMyStr
>lcMyStr = space(SIZE_OF_SPI_GETNONCLIENTMETRICS)
>* put buffer length into structure
>lcMyStr = stuff(lcMyStr, OFFSET_OF_cbSize, 4, IntToSTR(SIZE_OF_SPI_GETNONCLIENTMETRICS) )
>
>DECLARE INTEGER SystemParametersInfo IN WIN32API integer, integer, @string, integer
>if SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @lcMyStr, 0)>0
>* examine result string
>* values of lfCaptionFont structure should start at the offset 24.
>* these values are:
>*   lfHeight   - 24
>*   lfWidth    - 28
>*   lfEscapement - 32
>*   lfOrientation - 36
>*   lfWeight - 40
>*   lfItalic - 44
>*   lfUnderline - 45
>*   lfStrikeOut - 46
>*   lfCharSet - 47
>*   lfOutPrecision - 48
>*   lfClipPrecision - 49
>*   lfQuality - 50
>*   lfPitchAndFamily - 51
>*   lfFaceName - 52
>* the last one is the most interesting - its 32 bytes of Font Face name. So you can take it, for example, by easy way:
>  lcCaptionFont = chrtran(substr(lcMyStr, 52, 32),chr(0),'')
>  llItalic = asc(substr(lcMyStr, 44, 1))>0 && .T. if Italic
>  llBold = strToInt(substr(lcMyStr, 40, 4)) > 500 && .T. if bold
>endif
>
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform