Solved

Task-Bar Height and Location

Posted on 1998-08-30
2
148 Views
Last Modified: 2010-04-30
Hi,
How do i get the Height and Location of Task-bar and the list of active tasks in vb5

thanks.
0
Comment
Question by:msali
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
shchuka earned 50 total points
ID: 1432010
This is how you can find the location and the size of the taskbar:

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

Dim R As RECT, lRes As Long,
Dim lW As Long, lH As Long

lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, R, 0)
If lRes Then
      With R
            .Left = Screen.TwipsPerPixelX * .Left
            .Top = Screen.TwipsPerPixelY * .Top
            .Right = Screen.TwipsPerPixelX * .Right
            .Bottom = Screen.TwipsPerPixelY * .Bottom
            lW = .Right - .Left
            lH = .Bottom - .Top
      End With
End If

Now iw and ih contain the width and height of the taskbar correspondently;
r.left and r.top contai the upper left coordinates of the taskbar (in twips).
0
 
LVL 2

Expert Comment

by:shchuka
ID: 1432011
To find the tasks running on the system, you may try using the sysinfo.ocx control.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now