PDA

View Full Version : VBA API Trying to use FindWindowEx to find a window with duplicate ClassNme & WinNme



cgunter3
02-11-2016, 08:49 PM
15395
I'm using the FindWindowEx to search for Window 00150548 "" Static (the very last window in my Spy++ picture). When using the FindWindowEx it finds a window but not the correct window. Because there are many windows in the parent window with the same Class Name and Window Caption. I can't get it to find the correct Window. Is there any other way? Or are there any other specification I can make when using the FindWindowEx?



hwnd = FindWindow(vbNullString, "* GL-Burgers of Beaumont I, Ltd. - Sage 50 Accounting") SaRoF = FindWindow(vbNullString, "Select a Report or Form")
PAPPC = FindWindow(vbNullString, "Preview and Print Payroll Checks")
r = FindWindowEx(PAPPC, SaROD, "Static", "")'NOT FINDING CORRECT WINDOW