Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6086773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:47:38+00:00 2026-05-23T11:47:38+00:00

I have my main Application hidden using: Application.ShowMainForm:= False; The Application uses a TTrayIcon

  • 0

I have my main Application hidden using:

Application.ShowMainForm:= False;

The Application uses a TTrayIcon which I have assigned a Popup menu to.

By using and selecting one of the Popup menus in the Tray Icon I want to make my Application visible again, but I want the position of the Application to popup above the Taskbar.

By default the Windows Taskbar is at the bottom, so in this case my Application would appear in the bottom right just above the clock – of course the Taskbar can be moved and sized by the user so I need a way of knowing definitively these metrics.

Simply put, I want my Application to appear in the corner of the Taskbar above (or next) to the System clock.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:47:38+00:00Added an answer on May 23, 2026 at 11:47 am

    Use SHAppBarMessage to get the location of the taskbar:

    SHAppBarMessage(ABM_GETTASKBARPOS, appBarData);
    

    That, along with the size of the “primary” monitor:

    nScreenWidth := GetSystemMetrics(SM_CXSCREEN);
    nScreenHeight := GetSystemMetrics(SM_CYSCREEN);
    

    and you can work out if the Taskbar is located at the

    • top
    • left
    • bottom
    • right

    of the screen, and its size.

    {Calculate taskbar position from its window rect. However,
     on XP it may be that the taskbar is slightly larger or smaller than the
     screen size. Therefore we allow some tolerance here.
    }
    if NearlyEqual(rcTaskbar.Left, 0, TASKBAR_X_TOLERANCE) and
            NearlyEqual(rcTaskbar.Right, nScreenWidth, TASKBAR_X_TOLERANCE) then
    begin
        // Taskbar is on top or on bottom
        if NearlyEqual(rcTaskbar.Top, 0, TASKBAR_Y_TOLERANCE) then
            FTaskbarPlacement := ABE_TOP
        else
            FTaskbarPlacement := ABE_BOTTOM;
    end
    else
    begin
        // Taskbar is on left or on right
        if NearlyEqual(rcTaskbar.Left, 0, TASKBAR_X_TOLERANCE) then
            FTaskbarPlacement := ABE_LEFT
        else
            FTaskbarPlacement := ABE_RIGHT;
    end;
    

    With that you can pop up your toast:

    case FTaskbarPlacement of
    ABE_RIGHT:
       begin
          Self.Left := rcTaskbar.Left-Self.Width;
          Self.Top := rcTaskbar.Bottom - Self.Height;
       end;
    ABE_LEFT:
       begin
          Self.Left := rcTaskbar.Right;
          Self.Top := rcTaskbar.Bottom - Self.Height;
       end;
     ABE_TOP:
        begin
           Self.Left := rcTaskbar.Right - Self.Height;
           Self.Top := rcTaskbar.Bottom;
        end;
     else //ABE_BOTTOM
        // Taskbar is on the bottom or Invisible
        Self.Left := rcTaskbar.Right - Self.Width;
        Self.Top := rcTaskbar.Top - Self.Height;
     end;
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my main application delegate which contains a method that returns an object.
I have WPF Application where I have One main form and other user controls
I have an application composed of a main view and a secondary view which
I'm creating an application with its main window hidden by using the following code:
In my Map application I have segment controller on main screen and using that
I have an application with tray icon. There is a hidden main window (CMainFrm),
Hello all I have main windows application and I like to popup dialog for
I have an application which will post a message on a friends wall using
i have main Application which is Spark component <s:Application xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark minWidth=955 minHeight=600 initialize=initApp();
I have a Silverlight application using C#, with 2 main functions that I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.