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 6820009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:22:25+00:00 2026-05-26T21:22:25+00:00

A few minutes ago I encountered a weird problem with TopMost. I created a

  • 0

A few minutes ago I encountered a weird problem with TopMost. I created a topmost form (WinForms) did some tabbing and everything was fine.

Then I tried to open a computer game (fullscren-windowed) which means the game is fullscreen but in a windowed mode which means you can still overlay it with forms. Everything fine until I opened my Browser for example (could be any other program (editor)). Just as a quick side note I have two monitors.

  1. I tabbed out of the computer game (where my form is TopMost) into the browser
  2. I clicked somewhere in the browser (url)
  3. I tabbed back into the game, clicked somewhere in the game (my form is still TopMost)
  4. I do step 1-3 again and suddenly my form (topmost) disappeared.

This happens every time I do this and this problem can be reproduced on at least 2 other
machines.

EDIT:

I tried to implement the suggested solution

public partial class Form1 : Form
{
    const UInt32 SWP_NOSIZE = 0x0001;
    const UInt32 SWP_NOMOVE = 0x0002;
    const UInt32 SWP_NOACTIVATE = 0x0010;

    [DllImport("user32.dll")]
    static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

    public void setTOP()
    {
        SetWindowPos(this.Handle, new IntPtr(-1), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
    }

    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        this.setTOP();
    }
}

But this didn’t work.

  • 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-26T21:22:25+00:00Added an answer on May 26, 2026 at 9:22 pm

    It’s a horrible solution but it’s better than nothing so far.

    I implemented a timer which calls topmost every x seconds. Just like I said, it’s not a good solution but the only one which came to my mind. I’ll continue to work on this but for the meantime this is what i do.

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

Sidebar

Related Questions

A few minutes ago, I commited some files and then pushed them to my
SVN was working just fine until a few minutes ago -- I can still
a few minutes ago I had a discussion with my boss and want now
I was a bit surprised a few minutes ago when I tried to overload
THIS USER HAS ALREADY ASKED THE EXACT DUPLICATE A FEW MINUTES AGO sql and
I got rejected from CodeCanyon just a few minutes ago and I'm kinda disappointed,
I was answering a question a few minutes ago and it raised to me
i just asked a question few minutes ago which led me to this one
Possible Duplicate: JIT compiler vs offline compilers So until a few minutes ago I
This is another question related to a question I asked a few minutes ago.

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.