Hello,

how to programatically close outlook model pop up in vb6.0?

Thanks

Hello,

I found the solution.what I did, I programatically kill that pop up and then open my outlook window. below is my code:

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Public Const WM_CLOSE = &H10

Public Sub Kill_Program(ProgramName As String)
Dim WinWnd As Long
'Stop
WinWnd = FindWindow(vbNullString, ProgramName)

If WinWnd <> 0 Then
MsgBox "Outlook E-mail Properties Popup will be closed."
PostMessage WinWnd, WM_CLOSE, 0&, 0&
' Else
' ' do nothing or
' MsgBox "No Popup of name " & ProgramName & " exists."
End If
End Sub

Ref Link:

http://www.vbforums.com/showthread.php?522026-RESOLVED-How-to-programmatically-kill-user-process-from-VB6

hope it will help others also.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.