How to hide my Window in ALT+TAB?

Just starting out? Need help? Post your questions and find answers here.
Phantomas
User
User
Posts: 96
Joined: Wed Jul 01, 2009 12:59 pm

How to hide my Window in ALT+TAB?

Post by Phantomas »

Hello, small question: how to hide my window in ALT+TAB? Thanks...
User avatar
Michael Vogel
Addict
Addict
Posts: 2808
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

Short answer:

Code: Select all

SetWindowLong_(WinID,#GWL_EXSTYLE,GetWindowLong_(WinID,#GWL_EXSTYLE)|#WS_EX_TOOLWINDOW);
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Wrong answer. Still shows my window in ALT+TAB. Try again. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Phantomas
User
User
Posts: 96
Joined: Wed Jul 01, 2009 12:59 pm

Post by Phantomas »

Michael Vogel, this works, thanks. I cleaned: "|#WS_EX_TOOLWINDOW".

It is a decision reasonable? Whether the same is possible to do facilities of PureBasic (not using WinAPI)?

Hmm... it does not work in my program :(.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I messed with hiding windows from the task switcher a while back just for the heck of it but didn't get too into it really but heres some of what I remember that worked for me from a little research back then.

There are actually I think only two ways of correctly (might be wrong tho) hiding a window from the task switcher (which is the Alt + Tab):

A. Add an extended window style like with WS_EX_TOOLWINDOW - I believe this is the most correct and accepted way to do this.
B. Make it a child window of another window.

To add an extended window style with WS_EX_TOOLWINDOW, I think is like this (can't remember right now) - i'm not near my PB machine right now:

Code: Select all

SetWindowLong_(hWnd, #GWL_EXSTYLE, (GetWindowLong_(hWnd, #GWL_EXSTYLE) | #WS_EX_TOOLWINDOW) | #WS_EX_APPWINDOW)
You'll have to look up the values of #GWL_EXSTYLE, #WS_EX_TOOLWINDOW, and #WS_EX_APPWINDOW maybe but i want to think that PB has these as constants or at least most of them. This is pretty close to what Michael posted above so I think its right and that he was on the right track. The difference between ours is that I found i had to use #WS_EX_APPWINDOW also.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

I cannot see why you would WANT or NEED to do this! Spidey sense activated!!! :evil:

What is it as of this post... 7 posts and you already want to know how to HIDE your program???
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Micko
Enthusiast
Enthusiast
Posts: 244
Joined: Thu May 24, 2007 7:36 pm
Location: Senegal
Contact:

Post by Micko »

Rook what is your problem again ? Awake minds need to know somethings without having twisted ideas that you seem to allude... :shock: i know what i'm talking about, you too i think. :evil:
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Ahhh now we hear from Senegal... Bastion of Computer legality! 7 posts... almost no code posted and wants to know how to hide his "program" in Windows Task Manager...

Are you simply ignorant?
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Micko
Enthusiast
Enthusiast
Posts: 244
Joined: Thu May 24, 2007 7:36 pm
Location: Senegal
Contact:

Post by Micko »

you think you are smarter than everyone on this board :lol: :lol: :lol: ? there are very competent people here but are discreet. you are less gifted, and under succeptible informed. I don't know what is behind your person... :shock:
Why I answered here, because I wrote a program to protect files and folders, and I ask a question like Phantomas one and you attack me. you should learn what is a forum idea for your knowledge because everyone who come here are not necessary malicious. Maybe that is your case. I have finished with you because you're not better than me :D(Everybody here but not you). Kale's book is an exceptionnal tools for PB. (whom I thank from my heart "Jerry djeff ! ----> tanks in senegalese language :lol: " and every PB english forum user ).
:D
Digital Wargames
Enthusiast
Enthusiast
Posts: 203
Joined: Sat May 23, 2009 4:39 am

Post by Digital Wargames »

Micko: You and I should both learn not to feed the trolls :wink:
Don't discourage beginners. Encourage beginners.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Digital Wargames wrote:Micko: You and I should both learn not to feed the trolls :wink:
Is it possible for you to shut the **** ** at least for 5 Minutes?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Micko wrote:Kale's book is an exceptionnal tools for PB. (whom I thank from my heart "Jerry djeff ! ----> tanks in senegalese language :lol:
Cheers! :D
--Kale

Image
Post Reply