Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculation for size of VFP Desktop area?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00723216
Message ID:
00724794
Views:
23
Actually, I found that _screen.height had the number I was looking for. (And I know that in 6.0 _vfp.height = _screen.height and in 7.0 _vfp.height # _screen.height.)

Thanks all.

James

======================================================================================


>>Sorry, left out that I was using VFP 6.0 (not by personal choice).
>>
>>So, it's my understanding that _Screen.Height and _Screen.Width is the height and width of the window containing the VFP desktop (including title bars, menus, status bar and area for forms to appear in). I would need to subtract from that the Title Bar and Menu Bar size (38) and the Status Bar size (23, which I have turned on in my application). I don't use toolbars in this application, so that does not need to be subtracted.
>>
>>so ...
>>
>>desktop_height = _Screen.Height - 38 - 23
>>
>>Does this sound right???
>>
>
>You're better off using the SYSMETRIC() function to handle the various elements. Unfortunately, the height of the status bar has to be taken into account as well. Between the API and Foxtools, however, it becomes simpler.
* Foxtools must be loaded before using this.
>* Get the window handle of the main VFP window
>lnhwnd = MainhWnd()
>* Initialize API call
>DELCARE INTEGER GetWindow IN Win32API;
>  INTEGER hwnd, INTEGER dFlag
>STORE 0 TO lndesktop, lnlast
>lldone = .F.
>DO WHILE NOT lldone
>  * The desktop is the last child window
>  lnlast = GetWindow(lnhwnd, 5) && GW_CHILD
>  lldone = (lnlast = 0)
>  IF NOT lldone
>   lndesktop = lnlast
>  ENDIF
>ENDDO
>STORE 0 TO nTop, nLeft, nBottom, nRight
>* Call Foxtools to get the co-ordinates.
>= _GetWRect(lndesktop, @nTop, @nLeft, @nBottom, @nRight)
Now it becomes a simple matter of subtraction.
=======================
J Robert Jernigan
Calabasas, CA USA
jrjernigan@hotmail.com

"To err is human ... I should know, I get to show my humanity everyday!" jrj

"I just love the internet - it takes this great big planet and makes it smaller. Now, why can't we all just get along?" jrj
Previous
Reply
Map
View

Click here to load this message in the networking platform