Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form's Caption_Assign
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00424701
Message ID:
00425551
Vues:
11
>You're really a genius! :)

No, I just have little knowledge of programming on Assembler/C++/Delphi, where you cannot go further without knowing of these little items ;)

>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.

Ok, I ran it and investigated exact values of some constants. See approved code at the end of this letter, icluse functions for 4-byte integers converting. 1 byte you may get just using chr/asc functions. Note that this function works on Win 2K!

>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.
>

Check access rights...


HTH.
#DEFINE SIZE_OF_SPI_GETNONCLIENTMETRICS 340
#DEFINE OFFSET_OF_cbSize 1
#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 nOption, integer n2, string cStruct, integer n2
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
* note that you need to add 1 to each offset value when working with strings in VFP
* 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, 53, 32),chr(0),'')
  llItalic = asc(substr(lcMyStr, 45, 1))>0 && .T. if Italic
  llBold = strToInt(substr(lcMyStr, 41, 4)) > 500 && .T. if bold

* ............
* You may also try to get all other values from string. Just remember that INT takes 4 bytes, byte - is just 1 byte, LOGFONT structure takes 60 bytes in total.
endif


procedure IntToSTR
lparameters pnValue
return chr(pnValue % 256) + ;
	chr(int(pnValue / 256) % 256) + ;
	chr(int(pnValue / 65536) % 256) + ;
	chr(int(pnValue / 16777216) % 256 )

procedure STRToInt
lparameters pcValue
return asc(left(pcValue,1)) + ;
	asc(substr(pcValue,2,1))*256 + ;
	asc(substr(pcValue,3,1))*65536 + ;
	asc(substr(pcValue,4,1))*16777216
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform