The service sector is too noticeable

Work with a service application in Delphi 5, which is designed to work in Windows XP - 7. Most applications work fine, but I have one problem. Part of this service application is a form that sometimes displays data (similar to the slider block that Avast uses to let you know that it has been updated). When the service displays the form, the form is displayed on the taskbar, but we do not want this. Are there any suggestions on how to hide the form button on the taxbar? So far, none of the standard methods I have found for regular applications. Thank.

+3
source share
3 answers

Cancel the form method CreateParamsand add a value WS_EX_TOOLWINDOWto the field Params.ExStyle. This will mean it as a tool window in which there will be no entry on the taskbar.

+1
source

It sounds as if you see a notification area icon (aka system tray icon) to inform the user about events in / related to the service.

You need to separate this GUI aspect of your service from the service itself and use some kind of IPC to allow the tray icon applet to communicate with the service as needed. Depending on the needs of your IPC, this may be a named pipe, file sharing with memory mapping, or something more complex.

Then the taskbar GUI behavior management methods should work as expected.

+7

http://delphi.about.com/od/adptips1999/qt/hidefromtaskbar.htm

procedure TMainForm.FormCreate(Sender: TObject) ;
begin
  ShowWindow(Application.Handle, SW_HIDE) ;
  SetWindowLong(Application.Handle, GWL_EXSTYLE, getWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW) ;
  ShowWindow(Application.Handle, SW_SHOW) ;
end;

Delphi 2007, , :

Set MainFormOnTaskBar to FALSE

Inside the main form, calling the OnShow event handler

ShowWindow(Application.Handle, SW_HIDE);

Inside the main OnActivate form, an event handler call

ShowWindow(Application.Handle, SW_HIDE); 
+1
source

Source: https://habr.com/ru/post/1740234/


All Articles