This code makes use of SendMsg to do extra IPC calls. It uses IPC_ISMAINWNDVISIBLE=900 to check if the main window is visible. It also sends a WM_COMMAND=273 to select the main window toggle command.
WM_COMMAND=273 WM_WA_IPC=1024 IPC_ISMAINWNDVISIBLE=900 WINAMP_MAIN_WINDOW=40258 'Show main window if (SendMsg(WM_WA_IPC, 0, IPC_ISMAINWNDVISIBLE) = 0) then SendMsg WM_COMMAND, WINAMP_MAIN_WINDOW, 0 end if 'Hide main window if (SendMsg(WM_WA_IPC, 0, IPC_ISMAINWNDVISIBLE)) then SendMsg WM_COMMAND, WINAMP_MAIN_WINDOW, 0 end if