Uhmm you are supposed to have a loop somewhere, where you do the work, as that progresses, you want it to do:
SendMessage(hwndPB, PBM_STEPIT, 0, 0);
You only do this once in your code, you should do it many times to let it increment the value on the bar.
Show us your new code so we can help again. You don't have to give a special command in the WM_PAINT case.