![]() |
Tipp 0203
|
Größe des Arbeitsbereiches ermitteln
|
 |
|
Autor/Einsender: Datum: |
|
Detlev Schubert 28.02.2002 |
|
Entwicklungsumgebung: |
|
VB 5 |
|
|
Da die TaskBar innerhalb des Desktops ein ganz normales Fenster darstellt, ist es bei manchen Programmen wichtig zu wissen, wie hoch die TaskBar ist, und wie viel Rest-Arbeitsbereich für die Anwendung noch übrig bleibt. Dies lässt sich mit der API-Funktion
SystemParametersInfo sowie der Konstante Const SPI_GETWORKAREA und einigen wenigen Codezeilen herausfinden, wie dieser Tipp es zeigt.
|
|
|
Option Explicit
Private Declare Function SystemParametersInfo Lib "User32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal _
uParam As Long, R As Any, ByVal fuWinIni As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const SPI_GETWORKAREA = 48
Private Sub cmdStart_Click()
Dim RetVal As Long
Dim R As RECT
RetVal = SystemParametersInfo(SPI_GETWORKAREA, 0, R, 0)
Label1(2).Caption = " " & (R.Right - R.Left) & " Pixel"
Label1(3).Caption = " " & (R.Bottom - R.Top) & " Pixel"
End Sub
|
|
|
|
|
Windows-Version |
95 |
 |
|
98/SE |
 |
|
ME |
 |
|
NT |
 |
|
2000 |
 |
|
XP |
 |
|
Vista |
 |
|
Win
7 |
 |
|
|
VB-Version |
VBA 5 |
 |
|
VBA 6 |
 |
|
VB 4/16 |
 |
|
VB 4/32 |
 |
|
VB 5 |
 |
|
VB 6 |
 |
|
|
|
Download (2,3
kB)
|
Downloads bisher: [ 926 ]
|
|
|