Quote Originally Posted by savage
The second parameter to the SDL_WM_SetCaption should be a pointer to an Icon structure, not text. Unfortunately I don't have D2009, so can't confirm or deny this issue or suggest a workaround.
Like Srki_82 writes, the second parameter is a text, not a pointer to any structure. See docs, http://sdl.beuc.net/sdl.wiki/SDL_WM_SetCaption. Just change all PChar to PAnsiChar (if you want to keep D2009 compat).