I have a loop i need to show the text szMsg(like x of n files completed....) and i am calling another application in that loop using shellexecute which runs for 2 mins...and continues the loop....

for the 2 rounds it is changing the text correctly for the 3rd round onwards it is not changing it...when i was testing in the debug it is changing the szMsg correctly....what do i need to do here...??any solutions!!!! I have tried sleep also.....