Advertisement
Guest User

Untitled

a guest
Jul 1st, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. void WIN_SetWMCaption(_THIS, const char *title, const char *icon)
  2. {
  3. #ifdef _WIN32_WCE
  4.     /* WinCE uses the UNICODE version */
  5.     LPWSTR lpszW = SDL_iconv_utf8_ucs2((char *)title);
  6.     SetWindowText(SDL_Window, lpszW);
  7.     SDL_free(lpszW);
  8. #else
  9.     Uint16 *lpsz = SDL_iconv_utf8_ucs2(title);
  10.     size_t len = WideCharToMultiByte(CP_ACP, 0, lpsz, -1, NULL, 0, NULL, NULL);
  11.     char *cvt = SDL_stack_alloc(char, len + 1);
  12.     WideCharToMultiByte(CP_ACP, 0, lpsz, -1, cvt, len, NULL, NULL);
  13.     SetWindowText(SDL_Window, cvt);
  14.     SDL_stack_free(cvt);
  15.     SDL_free(lpsz);
  16. #endif
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement