![]() ![]() '* Windows API function to get IDispatch COM pointer via Accessibility interface (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long ![]() Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hWnd1 As Long, ByVal hwnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _ '* Windows API function to traverse windows and grab attributes However, I wanted to share the meta code because yet another use case may turn up in the future. ![]() Code to reach all those three applications via their windows handles are in the previous post. One can also imagine a future question wanted similar for PowerPoint. On StackOverflow, a questioner wanted something similar for Word. So I had some code to generate an illustrative tree of Excel window handles as a by-product for some code to get a pointer to Excel via its window handle using the Accessibility API. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |