Detecting a specific window 
Author Message
 Detecting a specific window

Hi folks,

        How can I detect (under VB5.0) if a specific window of an other 16bit or
32bit   program has been opened by the user.

Thanks for helps


Sat, 29 Apr 2000 03:00:00 GMT  
 Detecting a specific window

Hi Yves,

you can use the API function FindWindow.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA"
(ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long)
As Long

' If you know the exact Windowstitle
hwnd = FindWindow(vbNullString, "WinTitle")

' If you know the Classname
hwnd = FindWindow("classname", vbNullString)

Hope this helps...

Sat, 29 Apr 2000 03:00:00 GMT  
 Detecting a specific window

You can FindWindow using the WindowClass instead.
Use a "Spy" application to find out the class of a window.
Simon Jones
PC Pro Magazine

Mon, 01 May 2000 03:00:00 GMT  
 Detecting a specific window

I think the Knowledge Base (see .sig) has an article on this. Searching
for partial, window, and title (or caption) should find it (I'm at home
right now, and can't look it up, sorry...)

N Varacalli


>How would you find a window if you only know part of the title?

RTF/MIME/HTML mail/posts will be rejected/ignored. (incl.`address cards`)

Win 32 API Help File  :
Microsoft Knowledge Base:

Tue, 02 May 2000 03:00:00 GMT  
 [ 4 post ] 

 Relevant Pages 

1. Detecting a specific window

2. sendkeys to specific window / windows handle

3. Detecting changes in a specific directory

4. Help: Detect Right-Click of specific Toolbar Button (VB6)

5. How to detect if a specific program is running

6. How to detect 16-bit Windows-based application running under Windows NT

7. Windows App running under a specific account

8. Subclassing, in general, not a specific window

9. How VB Can Determine if a Specific Windows Program Is Running

10. Making video from MCI go to specific window?

11. Finding and Killing a Specific EXE running in Windows NT

12. FindWindow & Closing Specific Windows VB Programs


Powered by phpBB® Forum Software