- 日時: 2011/04/05 13:19
- 名前: 花ちゃん
- ***********************************************************************************
* カテゴリー:[他のアプリ関係][][] * * キーワード:他のアプリを終了させる,他のEXE,アプリケーション,リモート操作,, * ***********************************************************************************
---------------------------------------------------------------------------------------- No.3252 IEの終了方法 (RE:ほかのプロセスの終了) 投稿者:NAO★ [2001/11/23(金)21:50分] ----------------------------------------------------------------------------------------
IEを終了するときは SendMessage ではなくて PostMessage 関数を使うと終了できます
Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _ (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ ByVal lParam As Long) As Long Private Const WM_CLOSE As Long = &H10
Private Sub Command1_Click() Dim hwnd As Long Dim Ret As Long
hwnd = FindWindow("IEFrame", vbNullString) Ret = PostMessage(hwnd, WM_CLOSE, 0&, 0&) End Sub
|