Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21271

DestroyWindow does not appear to work

$
0
0
Clicking Command2 does not destroy the App. Is myWnd not a valid handle?

Code:

Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long

Dim myWnd
  '
  '
Private Sub Command1()
 Dim Path As String
 
 Path = App.Path & "\Client.exe"

 Shell Chr(34) & Path & Chr(34), vbNormalFocus

 myWnd = FindWindow("ThunderRT6FormDC", "Form1")
   
End Sub

Private Sub Command2_Click()
 DestroyWindow myWnd
End Sub


Viewing all articles
Browse latest Browse all 21271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>