Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetTopWindow
Message
 
 
À
01/08/2000 00:51:59
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Titre:
Divers
Thread ID:
00399125
Message ID:
00399475
Vues:
19
First off, GetTopWindow only returns child window handles, not parents. This might be able to be used in an MDI application (not sure, haven't tested).

Second, as Joe suggested, use the GetForegroundWindow function. As long as the function is called in or after the Activet of the form, then the foreground window and the form window handle should be the same.

HTH.

>Public Declare Function GetTopWindow Lib "user32" (ByVal hWnd As Long) As Long
>
>For Click Event of form write this code:
>Private Sub Form_Click()
> Dim n As Long
> n = GetTopWindow(0) 'or n=GetToWindow(GetDesktopWindow())
> if n<>me.hwnd then
> msgbox "!="
> else
> msgbox "="
> end if
>End Sub
>
>while when i click on form n<>me.hwnd?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform