View previous topic :: View next topic |
Author |
Message |
FK_GER
Joined: 26 Oct 2017 Posts: 35 Location: University of Kassel,Germany
|
Posted: Sat Apr 07, 2018 1:41 pm Post subject: Informations about windows metrics? |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Sat Apr 07, 2018 5:00 pm Post subject: |
|
|
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 |
|
|
FK_GER
Joined: 26 Oct 2017 Posts: 35 Location: University of Kassel,Germany
|
Posted: Mon Nov 26, 2018 5:48 pm Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Mon Nov 26, 2018 8:15 pm Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Tue Nov 27, 2018 1:50 pm Post subject: |
|
|
... 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 |
|
|
|