How to hide an application from taskbar in Windows 7?

后端 未结 3 1538
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 17:33

I would like to hide an application from the Windows 7 taskbar.

I want to make something like a toolbar on the edge of the screen which does certain things when the

3条回答
  •  佛祖请我去吃肉
    2020-12-09 18:32

    your application main form is normally created in the dpr so open the dpr and look for the line that creates the main form.

    // add this line first
    // blank app title will prevent app from showing in the applications list in task manager
    Application.Title := '';
    
    // this line is already in the dpr and creates the main form, the class will differ
    Application.CreateForm(TMainForm, Result);
    
    // make the main form invisible to windows taskbar/task switcher
    i := GetWindowLong(Application.Handle, GWL_EXSTYLE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE, i OR WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW);
    

    i know this works on XP and 7. i'm guessing it's good for 8 as well. this adds the tool window flag and removes the appwindow flag so i guess if you're not interested in the toolwindow flag you can leave out the following part

    i OR WS_EX_TOOLWINDOW
    

提交回复
热议问题