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

  • Home
  • SEARCH
  • 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 812475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:12:37+00:00 2026-05-15T01:12:37+00:00

I have this Windows Forms application where it sits in the notification area. Clicking

  • 0

I have this Windows Forms application where it sits in the notification area. Clicking on the icon brings it up front, clicking it again (or clicking on the app X icon) sends it back. This is the type of app that having the window always on top is important when it’s displayed by clicking the icon (it’s optional though).

Right-clicking the icon brings up a context menu where one can select to enable the “always on top” option or not. When the application first starts up, the app settings are read from an XML file and I’m 99% that this is working as it should, the TopMost property is properly read (and written).

After some time (minutes, hours, days, whatever; I normally hibernate and rarely shutdown) the TopMost stops working. I don’t change the option, I don’t think anything is changing the option value but I click the notification area icon and app is not brought up front. It shows up but it’s on the background (it displays on Alt+Tab), it’s not “always on top” as it should. I bring up the context menu, disable the option (cause it’s enabled) and enable it back and it starts to work after that. The app is now “always on top”. However, it can lose this ability anytime after a while.

I can’t understand why this happens and how this happens. Does anyone have any idea why? If not, any idea how could I try to debug such behavior?

EDIT:
I added a piece of code to show a MessageBox when the TopMost property was changed to see if I could notice any strange behavior but it was no good. It didn’t help because the form was with TopMost = true but it still was in the background…

  • 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-15T01:12:38+00:00Added an answer on May 15, 2026 at 1:12 am

    There is more than just one “Topmost” window. Topmost just says “Before all non-topmost windows”.

    I am pretty sure a reinitialization of the desktop (such as when hibernating) requires another SetWindowPos(hwnd, HWND_TOPMOST, ...) (which is the underlying Win32 API call).

    As a workaround, you could reset and set the property again when showing the window.

    Another possibility is that hiding the window also changes the Z order – either implicitely how Win32 implements that, or explicitely in the way WinForms call the hide/show window.

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

Sidebar

Related Questions

This is a Windows Forms application. I have a function which captures some mouse
This is a strange one... In a windows forms app (VB.NET/VS 2005) I have
I have a windows application running at the backend. I have functions in this
I have my Windows Application that accepts args and I use this in order
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a
I have a windows forms application that runs two threads simultaneously, with the UI
I have a Windows Forms application (C#) containing a ListBox into which I have
Suppose I have this Windows wchar_t string: L\x4f60\x597d and L\x00e4\x00a0\x597d and would like to
I have added some code which compiles cleanly and have just received this Windows
I have the VS2005 standard edition and MS says this: Note: The Windows Service

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.