_WinAPI_InvalidateRgn() VS _WinAPI_RedrawWindow()

Recommended Posts

Iczer 13

Iczer 13

Somewhat strange question maybe... But _WinAPI_InvalidateRgn($hWndCtrl) VS _WinAPI_RedrawWindow($hWndCtrl) - wich function is better to use in wich case and why?

Assume I have some GUI in on-event mode wich use custom painting on ListView(s) and TreeView(s) and happen to run function wich change variables to choose icons, colours of items in those controls, boldness of text etc.

Share this post

Link to post

Share on other sites

LarsJ 661

LarsJ 661

For a ListView you should not use any of these functions but _GUICtrlListView_RedrawItems.

For a TreeView it doesn't matter which function to use. Personally, I prefer _WinAPI_RedrawWindow( $hTV, 0, 0, $RDW_INVALIDATE ) because it clearly tells what's going on: The TreeView window is invalidated and then redrawn.