Please help!

I can restore a minimized window by calling ShowWindow(SW_SHOWNORMAL), but i just can't
bring a window from the back to foreground. I tried using pFirstWnd->BringWindowToTop(), also tried using
SetActiveWindow(), pFirstWnd->GetLastActivePopup(); etc etc....but non of it seemed to be working,
what is wrong with it??