|
-
Apr 4th, 2001, 01:47 PM
#1
Thread Starter
Hyperactive Member
-
Apr 4th, 2001, 01:50 PM
#2
PowerPoster
Here's one way. Just use the name of the window's caption as an argument in the FindWindow. It has to be exact.
Code:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const WM_CLOSE = &H10
Private Sub Command1_Click()
Dim rc As Long
rc = FindWindow(vbNullString, "Untitled - Notepad")
SendMessage rc, WM_CLOSE, 0, 0
End Sub
-
Apr 4th, 2001, 02:01 PM
#3
Already answered this in your other thread.
-
Apr 4th, 2001, 02:07 PM
#4
Thread Starter
Hyperactive Member
-
Apr 4th, 2001, 04:56 PM
#5
Code:
Private Sub Command2_Click()
Call KillApp("" & Text1.Text & "")
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|