how to start a Process so that it doesn't appear on the taskbar

  • Thread starter Thread starter garyusenet
  • Start date Start date
G

garyusenet

I have started a process app.exe and it launches fine.
I am able to position it around the screen without too much problem.

I'm trying to hide this process from the desktop.

If i minimize it, as you would expect it appears on the taskbar. How do
i stop it from appearing on the taskbar once it's minimized?

Thankyou.

Gary-
 
Hi gary,

this is defined in the windowstyles for a window. Therefore, you have to
change the styles after createing the process.

e.g.
lSetStyleEX = GetWindowLong(hwnd, GWL_EXSTYLE);
lSetStyleEX = lSetStyleEX | WS_EX_APPWINDOW;
lSetStyleEX = lSetStyleEX & (! WS_EX_TOOLWINDOW);
tCS.ExStyle = lSetStyleEX;
SetWindowLong hwnd, GWL_EXSTYLE, tCS.ExStyle

Best Regards
Marcel
 
Marcel Beutner said:
this is defined in the windowstyles for a window. Therefore, you have to
change the styles after createing the process.
lSetStyleEX = GetWindowLong(hwnd, GWL_EXSTYLE);
lSetStyleEX = lSetStyleEX | WS_EX_APPWINDOW;
lSetStyleEX = lSetStyleEX & (! WS_EX_TOOLWINDOW);
tCS.ExStyle = lSetStyleEX;
SetWindowLong hwnd, GWL_EXSTYLE, tCS.ExStyle

Wait, you just posted code to make sure it DOES appear on the taskbar!
To remove it, should perhaps be
lSetStyleEX = lSetStyleEX | WS_EX_TOOLWINDOW;
lSetStyleEX = lSetStyleEX & (! WS_EX_APPWINDOW);

Also, my memory is that changes to StyleEx are not reflected in the
toolbar until after you call SetWindowPosition.
 
Hi thankyou but I don't understand the code.

For a start I see no reference to my process in the code, so how does
it know that this code relates to my process? I have searched MSDN for
Isetstyleex and found nothing.

Could someone please elaborate on this for me.

Many Thanks,

Gary-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top