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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:53:24+00:00 2026-05-27T19:53:24+00:00

I am writing an application in c# to lock or freeze all programs untill

  • 0

I am writing an application in c# to lock or freeze all programs untill user enters a value in the app’s textbox and clicks ok.

The purpose of the app would be to get people to enter their time.

As far as I know you can set it to top most but they can end the app with task manager so am stuck here..

formName.TopMost = true;

Any help would be appreciated

  • 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-27T19:53:24+00:00Added an answer on May 27, 2026 at 7:53 pm

    Yes, that’s correct. The Windows operating system allows multiple programs to run at one time. What you’re experiencing is entirely by design.

    If I remember correctly, the TopMost property applies only to windows in your process, and as you mention, it’s all quite irrelevant: the user can still kill your application using the Task Manager.

    There’s no legitimate way of getting around that. It’s not a “limitation”, it’s a feature. Any app that prevents itself from being closed by the Task Manager is treading dangerously closely on the category of software that we call malware. Nothing good can come out of pursuits like this.

    Relevant reading: The arms race between programs and users


    Perhaps a good compromise solution is to make your window/form actually top-most and disable the Close button so that the user knows they shouldn’t try and close it. This is almost always enough to stop a user that is not determined to end your application by any means necessary, and that’s about all you should ever be concerned with.

    See the sample code here for how to make your window/form always appear on top of other running applications by setting the WS_EX_TOPMOST flag or toggling HWND_TOPMOST.

    I’ve also already written a detailed answer here about disabling the Close button the correct way by setting the CS_NOCLOSE class style.

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

Sidebar

Related Questions

I am writing an application in which I got to lock the computer screen
im writing an application that downloads and installs addons for programs which needs to
I am writing an application that downloads large files in the background. All clients
I am writing an application that needs to bring window of an external app
I am writing an application that if the user hits back, it may resend
I am writing vb.net code to log a user into my application using SQL
I'm writing an Android application which requires the user to login. I have a
I am writing vb.net code to log a user into my application using SQL
When writing application code, it's generally accepted that premature micro -optimization is evil, and
I'm writing an application that on some stage performs low-level disk operations in Linux

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.