PDA

View Full Version : window woes


sferguson
11-14-2003, 10:24 PM
alright, i've been fighting with this thing for a while now, see if anyone knows the correct APM5 method for getting this done. trying to find the window "Reporter Base 7 - BI" -- I put in a dialog to alert when the window is found, which it has been. i run into problems when i try to bring it to the front. i have included the code i am running, any help is much appreciated. (ps. this is just the current window.show iteration i tried, i've been through a couple of possibilities.)

--

tabCurWins = Window.EnumerateProcesses();

iLoop = 1;
iMax = Table.Count(tabCurWins);
bWinFound = false;

while (iLoop < iMax) do
if (tabCurWins[iLoop]) == "Reporter Base 7 - BI" then
iLoop = iLoop + 1;
else
bWinFound = true;
result = Dialog.Message("Notice", "Found it!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Window.Show(iLoop.GetWndHandle());
iLoop = 100;
end
end

Darryl
11-14-2003, 10:54 PM
Instead of Window.EnumerateProcesses(), take a look at Window.EnumerateTitles() and instead of Window.Show(), look at Window.SetOrder().

I believe that should accomplish what you are trying to do. Take a look at the Window.EnumerateTitles() example because it is similar to what you are trying to accomplish, but also use the Window.SetOrder() action instead of the Close for that example.

Hope that helps.