Stopping the "Send" "Don't Send" report dialog box....

Posted on 2005-03-23
Medium Priority
Last Modified: 2010-05-02
I have a program that calls an OCX control when the user clicks "Start".  The program seems to run normally but Windows brings up the famous "Send" "Don't Send" dialog box and says that my program has encountered an error and needs to close.  I just want to know if there is some error handling code that I can insert in my project to stop this dialog box from opening.

Question by:johnqtr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 29

Expert Comment

ID: 13611748
Are you trying to send mail using MAPI? Is this the dialog you are asking about?

Author Comment

ID: 13611811
No, I'm not trying to send any mail, just curious if I can prevent the famous Windows XP "Send" "Don't Send" error box that comes up when a program has errored.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 29

Accepted Solution

nffvrxqgrcfqvvc earned 1000 total points
ID: 13611946
'You can programatically I mean this isn't very good but It will work.
'I can't right the FindWindow Code for you because I don't have the Error Dialoge to find the window but what you can do is just us SPY and findthe window of the error report dialogue then issure a postmessage API to close the dialog . Basically Add this to a timer.

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, lParam As Any) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const WM_CLOSE = &H10
Private Sub Form_Load()
    Dim WinWnd As Long, Ret As String, RetVal As Long, lpClassName As String
    Ret = "Untitled - Notepad" ' Something like "Send Error Report"
    WinWnd = FindWindow(vbNullString, Ret)
    lpClassName = Space(256)
    RetVal = GetClassName(WinWnd, lpClassName, 256)
    PostMessage WinWnd, WM_CLOSE, 0&, 0&

End Sub
LVL 29

Expert Comment

ID: 13611998
I just want to state that I beleive when the Error Dialogue appears the caption is the caption of the Program which caused the error so Finding the Window is Better then Using the caption to close it. But That is a example of how it can be done above.

Author Comment

ID: 13612156
Yes, that worked fine.


Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question