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

The Archive Base Latest Questions

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

I’ve got a Delphi app that is running in an environment where it gets

  • 0

I’ve got a Delphi app that is running in an environment where it gets minimized by another aggressive app that is trying to seize the screen entirely (it’s POS stuff). When a second application is started it get hunts down the windows and minimizes them, probably by enumerating the windows and hitting them with a ‘ShowWindow(handle,SW_MINIMIZE)’.

It seems to me that the thing to do is to pick up these commands and block resize/minimize messages to the window. I’ve tried hacking around a few handlers to try and capture this behaviour, but still the SW_MINIMIZE will hide it. And Winsight is not showing me much other than the notification messages that something is resizing etc. I’ve put in a message handler for WMSysCommand messages, but that only seems to stop actions like the minimize button being clicked. And I’ve tried overriding the WndProc function to filter messages but that doesn’t cut it either.

If anyone could shed some light on what happens when the ShowWindow(handle,SW_MINIMIZE) call is inflicted on an application I’d be very grateful!

Thanks
Terry

  • 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-23T17:47:15+00:00Added an answer on May 23, 2026 at 5:47 pm

    What happens when ShowWindow is called with SW_MINIMIZE as ‘nCmdShow’ is that the window manager minimizes the window.

    The system will send various notification messages, some more important to be able to carry out the minimization and the application can act upon, like WM_WINDOWPOSCHANGING, WM_GETMINMAXINFO, WM_NCCALCSIZE, or some just to notify, like WM_WINDOWPOSCHANGED, WM_MOVE, WM_SIZE, but normally, none of these is for blocking the operation.

    The cleanest way, I think, if you can decide that the minimization is unexpected, is to respond to a WM_SIZE message when ‘wParam’ is SIZE_MINIMIZED, and restore your window accordingly. Then your form will bounce back from the taskbar:

    type
      TForm1 = class(TForm)
        ...
      private
        procedure WmSize(var Msg: TWMSize); message WM_SIZE;
      end;
    
    procedure TForm1.WmSize(var Msg: TWMSize);
    begin
      inherited;
      if (Msg.SizeType = SIZE_MINIMIZED) and IsUnexpectedMinimize then
        PostMessage(Handle, WM_SYSCOMMAND, SC_RESTORE, 0);
    end;
    

    I don’t have any clear idea about how you might decide either a minimization is unexpected or not but it would seem you do. User initiated actions would cause a WM_SYSCOMMAND to be send, but I don’t know if some of the OS features also do that and you’ll be able to differentiate if the OS minimizes the window or the aggressive application.

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

Sidebar

Related Questions

No related questions found

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.