指定の親ウィンドウの子ウィンドウかどうか調べる
Declare Function IsChild Lib "user32.dll" _
(ByVal hWndParent As Long, ByVal hWnd As Long) As Long
Declare Function IsChild Lib "user32.dll" _
(ByVal hWndParent As Integer, ByVal hWnd As Integer) As Integer
BOOL IsChild(
HWND hWndParent,
HWND hWnd
);
引数
hWndParent
親ウィンドウのハンドルhWnd
対象のウィンドウのハンドル戻り値
正常終了のとき 0以外サンプル
エラーのとき 0
ダウンロード(IsChild.lzh 1.10KB)'指定の親ウィンドウの子ウィンドウか調べる
Private Declare Function IsChild Lib "user32.dll" _
(ByVal hWndParent As Long, ByVal hWnd As Long) As Long
Private Sub Command1_Click()
Dim rc As Long
rc = IsChild(Me.hWnd, Me.Text1.hWnd)
If rc = 0 Then
Me.Text1.Text = "違うらしい...。"
Else
Me.Text1.Text = "Form1の子ウィンドウだったよ!"
End If
End Sub