Here is my problem: we have an automated build process for our product. When compiling one of the VB6 projects, a message box appears that requires the user to click the OK button before he can move on. Being an automated process is bad because it can sit there for hours without moving until someone clicks normally. We looked at VB6 code to try to suppress the message box, but no one can figure out how to do it right now. Since the temp fix, I am working on a program that will run in the background and when the message box appears, closes it. So far I can detect when a message appears, but I cannot find a function to close it properly. The program is written in C #, and I use the FindWindow function in user32.dll to get a window pointer. So far I have tried closeWindow, endDialog and postMessage to try to close it, but none of them seem to work. closeWindow simply minimizes it, endDialog appears with a memory error, and postMessage does nothing. Does anyone know of any other features that will take care of this, or any other way to get rid of this message? Thanks in advance.
here is the code i have:
class Program { [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); static void Main(string[] args) { IntPtr window = FindWindow(null, "Location Browser Error"); while(window != IntPtr.Zero) { Console.WriteLine("Window found, closing...");
Pyroesque
source share