Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Screen size
Message
De
30/04/2007 03:49:19
 
 
À
26/04/2007 21:16:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01220016
Message ID:
01221013
Vues:
20
thank you,sorry for being late.

>Got this code from this forum. I hope this works in your computer & OS
>
>#define _TEST
>#ifdef _TEST
>change_screen_size(3)
>=inkey(0)
>change_screen_size(1)
>=inkey(0)
>change_screen_size(2)
>inkey(0)
>change_screen_size(3)
>#endif
>
>
>funct change_screen_size
> LPARAMETERS tnSize
> if type('tnSize') != 'N'
>    if type('tnSize') == "C"
>       tnSize = val(tnSize)
>    else
>       tnSize = 2
>    endif
>
> endif
> tnSize = iif(empty(tnSize), 0, tnSize)
> do case
> case tnSize == 1
>      ChangeRes(640, 480)
> case tnSize == 2
>      ChangeRes(800, 600)
> case tnSize == 3
>      ChangeRes(1024, 768)
> endcase
>return
>*
>
>FUNC ChangeRes
>    LPARAMETERS tnWidth, tnHeight
>    LOCAL lnWidth, lnHeight, lnModeNum, lcDevMode
>    DECLARE INTEGER EnumDisplaySettings   IN Win32API ;
>            STRING lpszDeviceName,;
>            INTEGER iModeNum, ;
>            STRING @lpDevMode
>    DECLARE INTEGER ChangeDisplaySettings IN Win32API ;
>            STRING @lpDevMode, ;
>            INTEGER dwFlags
>    lnModeNum  = 0
>    lcDevMode  = REPLICATE(CHR(0), 156)
>    lnWidth    = IIF(EMPTY(tnWidth), 800, tnWidth)
>    lnHeight   = IIF(EMPTY(tnHeight), 600, tnHeight)
>    DO WHILE EnumDisplaySettings(NULL, lnModeNum, @lcDevMode) <> 0
>        lnModeNum = lnModeNum +1
>    ENDDO
>    lcDevMode = STUFF(lcDevMode,  41, 4, LongToStr(1572864))
>    lcDevMode = STUFF(lcDevMode, 109, 4, LongToStr(tnWidth))   && Width
>    lcDevMode = STUFF(lcDevMode, 113, 4, LongToStr(tnHeight))  && Height
>    ChangeDisplaySettings(@lcDevMode, 1) && Change res
>ENDFUNC
>*---
>
>FUNC LongToStr
>    LPARAMETERS lnLongVal
>    LOCAL lnCnt, lcRetStr
>    lcRetStr = ''
>    FOR lnCnt = 24 TO 0 STEP -8
>        lcRetStr = CHR(INT(lnLongVal/(2^lnCnt))) + lcRetStr
>        lnLongVal = MOD(lnLongVal, (2^lnCnt))
>    NEXT
>    RETURN lcRetStr
>ENDFUNC
>*---
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform