Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Knowledge Base

Post new topic   Reply to topic
IsAltTabWindow
View previous topic :: View next topic  
Author Message
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: May 8th, 2004 12:01 PM    Post subject: IsAltTabWindow Reply with quote

[vb:1:e9d1db90e0]
Private Declare Function IsWindowVisible Lib "user32" _
(ByVal hWnd As Long) As Long

Private Declare Function GetWindow Lib "user32" _
(ByVal hWnd As Long, _
ByVal wCmd As Long) As Long

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long) As Long


Private Const GW_OWNER As Long = 4
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_TOOLWINDOW As Long = &H80
Private Const WS_EX_APPWINDOW As Long = &H40000


Public Function IsAltTabWindow(ByVal hWnd As Long) As Boolean

Dim ex As Long
Dim vis As Boolean
Dim app As Boolean
Dim tool As Boolean
Dim owned As Boolean

vis = IsWindowVisible(hWnd)
ex = (GetWindowLong(hWnd, GWL_EXSTYLE))
app = (ex And Not WS_EX_APPWINDOW) <> ex
tool = (ex And Not WS_EX_TOOLWINDOW) <> ex
owned = GetWindow(hWnd, GW_OWNER) <> 0

IsAltTabWindow = vis And (app Or Not (tool Or owned))

End Function
[/vb:1:e9d1db90e0]
_________________
"you should make amends with you" (Incubus)


Last edited by Gilad_r on May 8th, 2004 01:47 PM; edited 1 time in total
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: May 8th, 2004 01:05 PM    Post subject: Reply with quote

What does this do? Confused
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: May 8th, 2004 01:46 PM    Post subject: Reply with quote

tells you whether the window appears in the Alt-Tab list...
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Knowledge Base All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic