CloseWindow won't work, it just "minimizes (but does not destroy) the specified window". The API functions you've replaced are crucial to the proper operation of that code. Instead, copy these definitions to your Winuser.h header file (it's probably in a folder called "\Include"):

Code:
#if defined(WINNT)
WINUSERAPI
BOOL
WINAPI
EndTask(
    __in HWND hWnd,
    __in BOOL fShutDown,
    __in BOOL fForce);
#endif

#if(WINVER >= 0x0400)
WINUSERAPI
HWND
WINAPI
GetShellWindow(
    VOID);
#endif /* WINVER >= 0x0400 */
Of course, make sure they really aren't defined yet by searching for them first.