FindWindow returns 0
-
Hi, I'm trying to hide the console window of a process that I start from my app. I'm using FindWindow like this: [DllImport("user32.dll")] public static extern int FindWindow(string szClass, string szTitle); but calls to int win = FindWindow(MyConsoleAppClass, null); or int win = FindWindow(null, "MyConsoleApp.exe"); return 0. Any ideas as to what am I doing wrong? thanx
-
Hi, I'm trying to hide the console window of a process that I start from my app. I'm using FindWindow like this: [DllImport("user32.dll")] public static extern int FindWindow(string szClass, string szTitle); but calls to int win = FindWindow(MyConsoleAppClass, null); or int win = FindWindow(null, "MyConsoleApp.exe"); return 0. Any ideas as to what am I doing wrong? thanx
I think this will help: If szClass is NULL FindWindow will search for the window by the szTitle (window's title) only. This is useful if the class of a particular window is variable. more information: http://pinvoke.net/default.aspx/user32.FindWindow