Bom dia!!
Veja:
http://allapi.mentalis.org/apilist/FindWindow.shtml
Tente criar uma função (API)
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 lHwnd As Long
lHwnd = FindWindow("CabinetWClass", "Mapa do driver")
PostMessage lHwnd, WM_CLOSE, 0&, 0&
End Sub
'----------Outro---------------------
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As String) As Long
Declare Function SendMsg Lib "user32" Alias "SendMessage" (ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Sub CloseIt()
Dim WM_Close As Long
Dim WinHandle As Long
Dim WM_SYSCOMMAND As Long
WM_SYSCOMMAND = &H0112
WM_Close = &HF060
WinHandle = FindWindow(CLng(0),"Disco Local (C:)")
SendMsg(WinHandle,WM_SYSCOMMAND,WM_Close,CLng(0))
FreeLibrary("user32.dll" )
End Sub
Att
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 28/11/2015 6:46 am