I'm working on an app that has a few controls. In both my listview and treeview controls while clicking the mouse, I lose a good chunk of the display. I tried sending an invalidate region to the controls but I just can't seem to get the hang of it. It will happen 100% of the time if I double click the header field in the listview to extend the size.Can someone give me hint as to what message I should check to be able to refresh this properly. I'm trying to attach an image but I really don't post alot.
Attachments:
Posted on 2013-03-20 14:46:04 by Cprompt
Is the control being used from a 3rd party library?  If so, then you'll have to ask them.

If you wrote the control then you need to ensure that when drawing the strings you take into account the font sizing from the appropriate structure in order to calculate the appropriate display length. Either that or you're not providing a rect struct large enough to account for the entire field width/height when doing an invalidate.

My .02 cents...
Posted on 2013-03-20 15:09:49 by p1ranha
Thanks for the input p1ranha. I'm not using 3rd party libraries. I'm using "plug in" resources for the controls from Radasm (version 2.2.2.0). I used the dialogasmain template and the include files are from the MASM32 package. The includes are probably a couple years old but I hate change :-P All fonts in use are system defaults. The invalidates I tried were:

invoke InvalidateRgn,hTab1,NULL,FALSE
invoke InvalidateRgn,hList,NULL,FALSE

with hTab1 being the handle for the tab control that my treeview and listview are sitting on and hList being the handle for the listview. Now that I think of it, I didn't have any of these refresh problems when the controls were solo. It just started when I put them in/on the tab control.

Everything is cool as long as I'm updating the information in the controls. It's when I double click the header (automatically size the column) that the control goes south. And it doesn't really go south. If I click another tab and then come back, it's fine. So I'm pretty sure it's just a refresh message somewhere. I'd like to hook into it somewhere and tell it to refresh but I haven't found the right message to intercept yet.

I guess I should also add in that the OS is windows 7 64 bit. Just in case it has a bearing.
Posted on 2013-03-20 15:45:00 by Cprompt
OK. Looks like my problem was PIBKAC. I made my tab control pretty much the size of my parent window. I also resized it when sizing the parent. Windows was drawing the tab control on top of my listbox and treeview. I resized my tab control to just be the size of the tabs themselves (not overlapping the other controls) and now I have no re-draw problems.

For other hobby programmers: PIBKAC = Problem Is Between Keyboard And Chair
Posted on 2013-03-21 10:09:59 by Cprompt
Closure :)

Posted on 2013-06-11 05:27:36 by Homer