views:

51

answers:

2

I am trying to debug a win32 windows-mobile app that I am largely unfamiliar with.

I am forcing a periodic InvalidateRect(hWnd,NULL,FALSE) and each time I do the WM_PAINT method is being called, but the GetUpdateRect() returns 0,0,0,0, and obviously nothing that is drawn is visible. GetWindowRect() and GetClientRect() show the window is there and is not zero sized.

I am guessing that the window is completely obscured by its children. Its a maze trying to find these children in the code, however.

How should I approach debugging this? E.g. can I list these children and their positions?

A: 

I'd start with Remote Spy++ to see what's going on. You could also call FindWindowEx to look at siblings, etc.

ctacke
A: 

I imagine you're aware of this already, but just in case, if your call to GetUpdateRect is following a call to BeginPaint while processing WM_PAINT then receiving an empty rect is the expected behavior. See the remarks in the docs for GetUpdateRec:

The update rectangle retrieved by the BeginPaint function is identical to that retrieved by GetUpdateRect.

BeginPaint automatically validates the update region, so any call to GetUpdateRect made immediately after the call to BeginPaint retrieves an empty update region.

You can enumerate child windows with EnumChildWindows.

imaginaryboy