john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Win CE draw text

/* convert a char string to wchar and Display it on the screen */
#define DRAWTEXTMAX 128


VOID drawText( HWND hwnd, int x , int y  , char ansistring[ DRAWTEXTMAX ]  )
{   
    HDC  hdc;
    wchar_t widestring[ DRAWTEXTMAX ] ;
    hdc = GetDC( hwnd ); 
    memset( widestring , 0, sizeof( widestring ));
    mbstowcs( widestring , ansistring , strlen( ansistring ) );

     ExtTextOutW( hdc , x , y , NULL , NULL ,
 widestring , wcslen( widestring ), NULL);

     ReleaseDC(hwnd, hdc);
}/* end function drawText */


VOID drawTextW(  HWND hwnd , int x , int y , wchar_t string[ DRAWTEXTMAX ] )
{   
     HDC hdc = GetDC( hwnd );

     ExtTextOutW( hdc, x, y, NULL, NULL,
 string , wcslen( string ), NULL);

     ReleaseDC(hwnd, hdc);
}/* end function drawTextW */

  • « Win CE configure menu
  • Hyper v manage from windows 7 pro »

Published

Aug 1, 2010

Category

c

~89 words

Tags

  • convert-to-win32 13
  • drawtext 2
  • win-ce 40