You may split your
GetTCPConn()
function into two functions:
- An init function that initializes the controls to be called upon
WM_INITDIALOG
. - An update function that fills the controls with content to be called upon
IDREFRESH
.
Call the update function at the end of the init function for initial filling of the controls.