Upgrade Pains

Started by mstefka, February 06, 2014, 02:56:55 PM

Previous topic - Next topic

mstefka

I've been out of the Winbatch world for a couple of years now, but am faced with a program problem I need a little guidance on.  We have a relatively simple program that fills a field in a windows program and pushes buttons and the exits (this was cobbled together from roboscripter).  It was compiled with Winbatch 2006D but we have a compiler license for 2012.  The script works perfectly as it was designed running on WinXP.  Now we jump a decade or so to running Win7 64 bit (apps are still 32 bit) and while the program still works, it is painfully slow.  If we wait long enough the actions do happen, but it's like there are 30+ sec. time delays between the actions.  All it does is activate an already open program, does a few sendkeys, pastes some text in a field and then pushes an Inquire button.  You'll wait 20-30 sec for the window to activate, then 20 sec to paste the text, then 20 sec for it push the inquire button.  All of which happen instantly on the WinXP machine.  So is there some gotcha since I've been away so long that I'm unaware of that could be causing this.  I thought there was some issue with SendKeys once aupon time but it's not just the sendkeys.  Each action takes like 20-30 sec. to execute on Win7 machine.  I'll attach the script so you can see it doesn't really do much.  Any insight would be greatly appreciated and like I said previously, we do have 2012 vintage compiler, we just never needed until now maybe??  Thanks.




Deana

Many functions in WinBatch that deal with windows (i.e. WinExist, SendKey and cWndByWndSpec) have built-in functionality that wait for windows to exist and be ready to accept input.

Specifically cWndByWndSpec, to put it simple cWndByWndSpec has a lot more work to do. Among other things the function may have to access the registry for each top-level window currently on the desktop. First,
I recommend replacing the cWndByWndSpec with DllHwnd. See if that speeds up the script.

If you are still having slowdowns, it would be a good idea to find out exactly which function is causing the slowdown. DebugTrace can be useful. It contains the number of milliseconds it takes to execute each line of code. Feel free to post the trace file here if you need further recommendations.
Deana F.
Technical Support
Wilson WindowWare Inc.