S Stoitcho Goutsev \(100\) [C# MVP] Mar 18, 2004 #2 Hi Holger, I don't know of any managed solution. You can try PInvoke and call GetWindowModuleFileName API
Hi Holger, I don't know of any managed solution. You can try PInvoke and call GetWindowModuleFileName API
H Holger Kasten Mar 19, 2004 #3 Hi I tried to include it the follwoing way: [DllImport("user32.dll")] public static extern int GetWindowModuleFileName(IntPtr hWnd, System.Text.StringBuilder title, int size); and to call it: System.Text.StringBuilder title = new System.Text.StringBuilder(256); HK.WIN32API.User32.GetWindowModuleFileName(hwnd, title, 256); Unfortunately title is an empty string all the time, besides I do this for a window handle of my own app. Any idea why? Best regards, Holger
Hi I tried to include it the follwoing way: [DllImport("user32.dll")] public static extern int GetWindowModuleFileName(IntPtr hWnd, System.Text.StringBuilder title, int size); and to call it: System.Text.StringBuilder title = new System.Text.StringBuilder(256); HK.WIN32API.User32.GetWindowModuleFileName(hwnd, title, 256); Unfortunately title is an empty string all the time, besides I do this for a window handle of my own app. Any idea why? Best regards, Holger