|
-
Aug 21st, 2000, 11:47 PM
#1
Thread Starter
Addicted Member
I've looked through the boards and there are a number of postings about it but I'm not sure I understand.
How does one find the height in Twips of the taskbar? I'd like my application form to fill the screen vertically but not horizontally.
The answers I've seen before use the GetDesktop and GetRect APIs. But looking at it closely they both end up returning the size of the whole screen... that's not what I want..
I just want the size of the taskbar, so that if it's on the bottom I can make my form Screen.height-Taskbar.height.
Any ideas?
Eiredrake
-
Aug 21st, 2000, 11:50 PM
#2
Frenzied Member
well if they gve you something like 1024 * 768 then you only need one number...is that what it outputs?
-
Aug 22nd, 2000, 11:43 AM
#3
Thread Starter
Addicted Member
REturns
They return a long which is the actual Height of the screen in pixels presumably... But when I converted it, it was 9000. The same thing that Screen.Height returned. So it's not what I want.
If the whole screen is 9000 twips... then I just need to get the taskbar's height. The usable screen would presumably be Screen.Height-Taskbar.height. Only problem is either way I try to get the height it's returning the same value. 9000.
Eiredrake
-
Aug 22nd, 2000, 11:55 AM
#4
Frenzied Member
just use the SHAppBarMessage API
Code:
Option Explicit
Private Const ABM_GETTASKBARPOS = &H5
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long ' message specific
End Type
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
Private Function GetTaskBarHeight() As Single
Dim uData As APPBARDATA
Call SHAppBarMessage(ABM_GETTASKBARPOS, uData)
GetTaskBarHeight = ScaleY(uData.rc.Bottom - uData.rc.Top, vbPixels, vbTwips)
End Function
because of the scaleY function this only works inside a form, if you want it inside a module you'll have to change that line to Form1.ScaleY(... or something.
-
Aug 22nd, 2000, 10:58 PM
#5
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|