Abundant Technologies - IT Consulting Experts

 Source Code Library

 Code Details

 
Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) _ As Long Declare Function SendMessage _ Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Long) _ As Long Public Sub mdl_CLOSE_PROGRAM(TITLETEXT As String) Dim lpClassName As String Dim lpCaption As String Dim Handle As Long Const NILL = 0& Const WM_SYSCOMMAND = &H112 Const SC_CLOSE = &HF060& lpClassName = vbNullString lpCaption = TITLETEXT '* Determine the handle to the Calculator window. Handle = FindWindow(lpClassName$, lpCaption$) '* Post a message to Calc to end its existence. Handle = SendMessage(Handle, WM_SYSCOMMAND, SC_CLOSE, NILL) End Sub

Mail To: info@3pc.com