Imri Barr

Imri Barr

  • NA
  • 42
  • 69.1k

Control is visible but not loaded (winAPI Programming)

Oct 1 2011 4:41 AM
Hey,

I was trying to automate a program (AVI ReComp) using FindWindow and SendMessage. All is working just fine till I got to my next problem:

When I'm starting this application: AVI ReComp I only see 2 out of 5 tabs I'm supposed to see using the spy++ tool but when I actually look at the program I see all 5 tabs.

Weird?

Wait it gets even weirder...

When I click on the tab that's not been showing in spy++, when I refresh the windows in spy++ tool it suddenly appears with all its controls.

Also, the same thing happens when I'm trying to get the handle for that same tab.
If I put a breakpoint after the program is loaded but before the handle is created and click on the tab before I continue, the handle works fine and gets all the correct values.
BUT, if I don't the handle is empty.

What could be the problem?

PS. When I try to wait before I try to retrieve the handle for the other tab, it still doesn't change anything so I think that prevents the possibility that it has to do something with the loading of that element.

Answers (5)