Not sure why it didn't work for you. Replacing main and MSGProc with your first code on page 1 worked here but as Rev said just the ret to exit can be a little naughty. With ExitProcess you should hopefully see the created(s) thread cleaned up as well where as with just ret the created thread(s) might be left running still.
If your interested in hooking just to set the window position you could unhook as soon as you capture the activate command by placing the UnhookWindowsHookEx just before the SetWindowPos call.
Good to see your making progress.
