Can I hide the Delphi Application window?

We just moved our application from the MDI container to one document interface. Our users are used to use the Windows menu in the parent MDI to display windows side by side. We want to train them to right-click on the Windows taskbar and use the window management functions there.

In Delphi applications, we noticed that the window wrapper leaves room for a hidden Application window. Therefore, if I have only two windows, this will arrange three rooms. The application window does not appear, but there is still room for it.

This is compounded by the fact that we have two different applications. If they have only one window open in each application, and you want to show them side by side, then in fact they will try to take into account 4 windows.

Therefore, instead of seeing two windows, each of which occupies half the screen, I see two windows that occupy 1/4 of the desktop, and the rest of the screen is open.

I found that adding a line to hide the application window when starting my application would fix this problem.

ShowWindow (Application.Handle, SW_HIDE);

Change if someone is not reading right up to the answer. Based on Craig's answer below I set the window style to WS_EX_TOOLWINDOW instead of hiding the window.        SetWindowLong (Application.Handle, GWL_EXSTYLE, GetWindowLong (Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);

() : ( )? , - , . - , ? ?

Delphi 2007. Windows XP, Vista 7.

: , , , , . . MainFormOnTaskbar true.

, , , Delphi IDE ( 2007) . . Delphi IDE . IDE, . , " ". , 1/3 . IDE " Windows Side by Side", 1/2 .

+5
4

MainFormOnTaskBar , , DPR:

SetWindowLong(Application.Handle, GWL_EXSTYLE,
  GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);

Delphi WS_EX_TOOLWINDOW, TApplication.

+3

Delphi 2007 ( ) TaskBar,

Application.MainFormOnTaskbar := True;

(*.dpr).

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;   // <--
  Application.CreateForm(TForm7, Form7);
  Application.CreateForm(TForm8, Form8);
  Application.Run;
end.

, , Delphi - .

+5

I still use Delphi 7, and I used this technique in conjunction with the WndParent trick: = GetDesktopWindow to get the taskbar button for each window, as Microsoft Office started to do with some version (I think XP?)

0
source

I believe this is how applications are minimized to the system tray.

-1
source

All Articles