WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Control Manager
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

cWndByWndSpec is processor intensive

 Keywords: cWndByWndSpec FindWindow

Question:

SAMPLE1 causes constantly 95 % utilisation on all my Win2000 / NT4 Workstations (not only in Taskmanager, they are really slow) and SAMPLE2 is fine and ran for 24 hours now.

Does anyone know why?

SAMPLE 1
:Loop
window1=cWndByWndSpec("#32770","FriFon32",0)
if window1 > 0
;...blabla
endif
TimeDelay(2)
Goto Loop

SAMPLE 2
:Loop
If FindWindow("#32770") == "FRITZ!fon"
;...blabla
endif
TimeDelay(2)
Goto Loop

Answer:

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. It is definitely not something that one should use in a background loop.



Article ID:   W14764
File Created: 2017:07:28:12:58:25
Last Updated: 2001:11:08:11:39:53