forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Informations about windows metrics?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
FK_GER



Joined: 26 Oct 2017
Posts: 35
Location: University of Kassel,Germany

PostPosted: Sat Apr 07, 2018 1:41 pm    Post subject: Informations about windows metrics? Reply with quote

Depending on the dimensions of the used PC-monitor, my programs define the size (width and height) and the place (x-position,y-position) of the needed windows.
In the manual I find only a routine, which allows to get infomations about the used screen and the used font:
Code:
      INCLUDE <windows.ins>
      INTEGER*4 xres,yres,font_h
      xres = clearwin_info@('screen_width')   ! Monitorpixels in x/w-direction
      yres = clearwin_info@('screen_depth')   ! Monitorpixels in y/h-direction
      font_h=clearwin_info@('system_font_height')

To specify the dimensions of windows to be opended at the screen, some more informations about the used parameters are helpfull, such as:
- width of borderline
- width of frameline
- height of caption bar
- width and heigth of scrollbars (vertical and horizontal)
- width and heigth of menu bar
- width and heigth of frame
- width and heigth of border

Is it possible to get these informations with the same procedure clearwin_info@('.....'); what are the 'keywords'.
For Information: I'm using Personal Edition V8.1
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sat Apr 07, 2018 5:00 pm    Post subject: Reply with quote

These parameters can be obtained by calling the Windows API function GetSystemMetrics. The interface is in win32api.ins and details can be found by searching for "MSDN GetSystemMetrics".
Back to top
View user's profile Send private message AIM Address
FK_GER



Joined: 26 Oct 2017
Posts: 35
Location: University of Kassel,Germany

PostPosted: Mon Nov 26, 2018 5:48 pm    Post subject: Reply with quote

Hi Paul,
my question from april is a long time ago already, but still currently.
I looked at the Microsoft page "GetSystemMetrics function" and found an example. But I'm not sure which files must be included and how to express the ftn95-statements .
Do you have an example for FTN95 how to call the parameters from the Windows API function GetSystemMetrics?
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Mon Nov 26, 2018 8:15 pm    Post subject: Reply with quote

Code:
      WINAPP
      PROGRAM System_Metrics
      INCLUDE <WINDOWS.INS>
      iWINDOW_BORDER    = GetSystemMetrics (SM_CXBORDER)
      iWINDOW_MENU_HEIGHT = GetSystemMetrics (SM_CYMENU)
      WRITE (*,*) iWINDOW_BORDER, iWINDOW_MENU_HEIGHT
      END


Implicit typing used. Values and type declarations for the parameters SM_etc are given in one of the include files.

Eddie
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Nov 27, 2018 1:50 pm    Post subject: Reply with quote

... and to add to the above (which I did in a hurry), all the 'enquiry' functions work like this. The parameter(s) to the routines are usually just simple integers, but they are all assigned to named variables to make the code more readable. The answer is returned.

If you look at the 'INS' files, you will see what a huge range of functions there are (look in win32api.ins at first). These functions are all described online in MSDN. You should use the parameter names (like SM_CXBORDER) and not the numeric values if you want to be able to read your code afterwards.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group