![]() ![]() ![]() HWndInt = FindWindowEx(hWndParent, ByVal 0&, sClassInt, vbNullString) Hence, the above code could be made to work by first determining the handle to this Intermediate window and using this handle as the parent handle in the FindWindowEx to return the Book1 Window: ![]() Subsequent playing around and using Winspector I noticed that there is an 'Intermediate' window between XLMAIN and EXCEL7 - this being XLDESK. MsgBox hWndChild 'this returns 0 ie the function didn't find the handleīut this didn't work, and I kept getting a return value of 0 indicating that the function was not finding the handle. HWndChild = FindWindowEx(hWndInt, ByVal 0&, sChildClassName, sChildWindow) ![]() SChildWindow = ActiveWindow.Caption 'in my case "Book1" 'Application.hWnd returns the same as above HWndParent = FindWindow(sParentClassName, vbNullString) Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, _īyVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Longĭim hWndParent As Long, sParentClassName As Stringĭim hWndChild As Long, sChildClassName As String, sChildWindow As String Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2023
Categories |