I'm just wondering how would I hide a window from the Taskbar.

Its a small window which sits always on top so theres no need for it there, does anyone have any ideas?
Posted on 2001-09-19 12:48:16 by Eóin
You have to use the WS_EX_TOOLWINDOW extended style. The resulting window will have a smaller title bar, but it will not displayed on task bar.
Posted on 2001-09-19 12:58:29 by LuHa
RegisterServiceProcess. This code is directly converted from some C
code I wrote, and is untested. Use at your own risk :].



.data
szKernel32 db "KERNEL32.DLL", 0
szRSP db "RegisterServiceProcess", 0

.code

invoke GetModuleHandle, offset szKernel32
test eax, eax
jz error

invoke GetProcAddress, eax, offset szRSP
test eax, eax
jz error

; too lazy to set up a function proto ;)
push 1
push 0
call eax
Posted on 2001-09-19 15:04:38 by f0dder
LuHu, that method won't work as the only style I wanted was WS_POPUP, no caption bar at all.

Fodder, I tried that but GetProcAddress returns NULL. I've just been reading on the net and it says RegisterServiceProcess also hides the process from the ctrl+alt+del menu.

While I don't mind if that happens, all I require is that the program doesn't show on the taskbar at the bottom.
Posted on 2001-09-19 19:06:41 by Eóin
Are you by any chance on NT/2k? RegisterServiceProcess is, as far
as I remember, win9x only :/.
Posted on 2001-09-20 06:01:13 by f0dder
Yep, I'm using win2k.

I suppose I can just use LuHus method alnog with regions to hide the captionbar.

Thanks for all the help though.
Posted on 2001-09-20 12:13:24 by Eóin
There must be a way!
Posted on 2001-09-20 12:28:18 by f0dder
Could you create your own custom window? I have an example on my web-page.. (actually the download bundled with the Objects.inc). It creates a custom window (using WS_POPUP tho), and paints all that is needed. Not realy all that much work.

Brief pause....

Actually,
I got it too work with my custom window demo!! I modified the the create window params to:
      invoke   CreateWindowEx,WS_EX_TOPMOST or WS_EX_TOOLWINDOW, \

addr szThisClassName, \
addr szThisDisplayName, \
WS_POPUP or WS_SYSMENU, \
ebx,eax,THIS_WIDTH,THIS_HEIGHT, \
0,0,hInst,0


See the Com' posting for the page link.. or use the WWW below and goto the source code section. Get the first program. Open MessageLoop.asm and modify the create to the above. Recompile it and you will get a custom window that is not in the task bar, and no caption bar, Well i drew my own, but you dont have to if you dont want to.

Hope this helps..

NaN
Posted on 2001-09-20 12:30:29 by NaN
Thanks NaN that was it, the WS_EX_TOOLWINDOW stlye sorted it.

Fodder and LuHu thanks as well. All help is appreciated.
Posted on 2001-09-20 12:54:37 by Eóin
try the follwing: create a child window and set its parent window handle to NULL. this should work.
Posted on 2001-09-20 15:18:52 by darester