Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Hiding a Window From the Taskbar (Not Exlusivley for VB) (http://www.programmingforums.org/showthread.php?t=10854)

brownhead Jul 26th, 2006 10:26 PM

Hiding a Window From the Taskbar (Not Exlusivley for VB)
 
I'm trying to make a function the will hide a window from the taskbar. With VB windows (And I'm not positive on this but i'm pretty sure: All windows with the CS_OWNDC class style/extension/w-e) you can simply add or remove the WC_APPWINDOW style, but I'm looking for a way to do it with ALL windows. If anybody could help me out it'd be appreciated :D (If you only know how to do it in another language, or are simply more comfortable with a different languag, I don't really mind translating it to VB, or you can just kinda give me a general idea how to...) G'day all, and if you need more info or anything, just ask :D. Thankee :D

Booooze Jul 27th, 2006 12:49 AM

I know I have seen the code around somewhere. Have you tried google? Try A1vbcode.com, and freevbcode.com, and any free vb code site. Those seemed to have turned up some results. Also, if you havent done so, go download the apiguide from allapi.net (address may have changed). It may very well be in there.

bigguy Jul 27th, 2006 1:28 AM

vb6 = formname.showintaskbar = false
Same for vb.net to I think.

brownhead Jul 27th, 2006 2:24 AM

Bigguy, thats only for forms under your control... I'm talking about any window, and the only thing provided is the Handle (hWnd). And Boooze, I've been sifting around all the API's for awhile now (I have alot of experiance with API's concerning windows, so I was able to check ALOT of them, didn't even have to look many constants up) and I've tried varying combinations of window styles (Using SetWindowLong and GetWindowLong), trying to find out a pattern that signifies that it won't appear in the task bar (Class Setting/Style/W-E: CS_OWNDC and Window Ex Style: WS_EX_APPWINDOW will make it appear, and without the APPWINDOW style it'll dissapear. Can't seem to set the class style though... SetClassLong is how your supposed to do it, but its only working with windows under my control). I'm also gonna try SubClassing so that I can trick the TaskBar program (I think explorer controls the TaskBar..) that the window isn't visible, and then if that fails I'll try to create an invisible parent window that'll shadow the real one. But if anybody has some tips it'd be great :D (And Boooze, I'll check those 2 sites out, hopefully they'll have something)

v0id Jul 27th, 2006 3:22 AM

Try look at MSDN, they probably have it.

If you set your mainwindow in C++ to WS_CHILD, it don't show up, maybe it's the same in VB.net.

bigguy Jul 27th, 2006 3:42 AM

WHy dont you make it hide taksbar all together? lol

john Wesley Jul 27th, 2006 5:03 AM

I know a way you can do it using api's.

you need....FindWindow & SetWindowPos...

Dhwnd = FindWindow("CabinetWClass", vbNullString)
Call SetWindowPos(Dhwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

I have test this way of doing it with as many different windows as I could find, the only ones I found it does not remove are the #37720(dialog)* windows (* may not be the exact class name.)

brownhead Jul 27th, 2006 1:52 PM

WS_CHILD is an extremly good idea, dunno why I didn't think of that (I guess I just assumed that you couldn't set WS_CHILD, that it had to really be a child window)... anyways, John Wesley, that hides the window altogether... and you can achieve that a bit more easily with ShowWindow (ShowWindow hWnd, 0 and ShowWindow hWnd, 1). Thanks all :D

Edit: Dangit :(, WS_CHILD doesn't work.. probably because its still counted as a top level window.

Booooze Jul 27th, 2006 8:10 PM

http://a1vbcode.com/app-1332.asp

Look there. It might solve your problem. I'm not big on API'S anymore, but you might be able to modify to do what you want. WS_CHILD may not work, but perhaps WS_CLIPSHILDREN will. (that's a guess) The link may help you out.

v0id Jul 28th, 2006 10:16 AM

I'm not a VB guy, but isn't there some SetWindowPos-function, like there's in C? If there's try set it with the flag SWP_HIDEWINDOW.


All times are GMT -5. The time now is 1:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC