3/1/2023 0 Comments Enumchildwindow getwindowtext![]() ![]() Private static bool EnumProc(IntPtr hWnd, ref SearchData data) SearchData sd = new SearchData ĮnumWindows(new EnumWindowsProc(EnumProc), ref sd) Public static bool SearchForWindow(string title) Private const string WINDOW_EXCEL7 = "XLMAIN" bool excelProofFound = WindowTitleSearcher.SearchForWindow("XLMAIN", "EXCEL7", "testfileopenedinEXCEL.xls", ref workbookTitle) īool excelProofFound = WindowTitleSearcher.SearchForWindow("icui-20110331.xls") Ĭonsole.Write(":)))))))) Proof File opened in an Excel process ") IntPtr hWnd = WndSearcher.SearchForWindow("XLMAIN", "EXCEL7", "icui-20110331.xls", ref workbookTitle) XLMAIN/EXCELDESK/EXCEL7 as seen by Spy++ VS 2010 utility What has changed? Can someone debug the issue since I don't have Windows 7. ![]() I did it by finding all XLMAIN IntPtr (pointers) and traversing children until I get a IntPtr with EXCEL7 window class at which point I can read child windows title and determine if a file is opened.īasically this works on Windows XP, but not on Windows 7. The goal is to find if a an excel workbook is being opened in any instances of Excel application. I am searching for windows titles of Excel main windows' child windows (Excel has an MDI window of class XLMAIN containing 0, 1 or more child windows with EXCEL7 window class). Private const string CHILDWINDOW_XLMAIN = "EXCEL7" ![]() private const string WINDOW_EXCEL7 = "XLMAIN" I am using 2 Windows API exported functions from c#.NET 4.0. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |