• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            q229817426@163.com

            q229817426@163.com45
            posts - 9, comments - 1, trackbacks - 0, articles - 0

            WINDOWN設計

            Posted on 2007-10-17 20:59 link 閱讀(307) 評論(0)  編輯 收藏 引用 所屬分類: c++編程
            1.wchar_t數據型態與無符號短整數型態相同,都是16位寬,相當與char的用法,wchar_t c = 'A' ;
            2.wcslen 和strlen用法相當
            3.#ifdef  UNICODE
            typedef WCHAR TCHAR, * PTCHAR ;
            typedef LPWSTR LPTCH, PTCH, PTSTR, LPTSTR ;
            typedef LPCWSTR LPCTSTR ;     
            #else
            typedef char TCHAR, * PTCHAR ; 
            typedef LPSTR LPTCH, PTCH, PTSTR, LPTSTR ;
            typedef LPCSTR LPCTSTR ;  
            #endif
            4.Windows函數呼叫

            int WINAPI MessageBox (HWND, LPCSTR, LPCSTR, UINT) ;
            注意,函數的第二個、第三個參數是指向常數字符串的指針
            5.Windows的字符串函數

            ILength = lstrlen (pString) ;
                   
            pString = lstrcpy (pString1, pString2) ;
                   
            pString = lstrcpyn (pString1, pString2, iCount) ;
                   
            pString = lstrcat (pString1, pString2) ;
                   
            iComp = lstrcmp (pString1, pString2) ;
                   
            iComp = lstrcmpi (pString1, pString2) ;
            6.在Windows中使用printf
            char szBuffer [100] ;
                   
            sprintf (szBuffer, "The sum of %i and %i is %i", 5, 3, 5+3) ;
                   
            puts (szBuffer)

            ASCII

            寬字符

            常規

            參數的變數個數

            標準版

            sprintf

            swprintf

            _stprintf

            最大長度版

            _snprintf

            _snwprintf

            _sntprintf

            Windows版

            wsprintfA

            wsprintfW

            wsprintf

            參數數組的指針

            標準版

            vsprintf

            vswprintf

            _vstprintf

            最大長度版

            _vsnprintf

            _vsnwprintf

            _vsntprintf

            Windows版

            wvsprintfA

            wvsprintfW

            wvsprintf


            格式化消息框
            程序2-1  SCRNSIZE
                   
            SCRNSIZE.C
                   
            /*---------------------------------------------------------------------------
                   
                SCRNSIZE.C -- Displays screen size in a message box
                   
                             (c) Charles Petzold, 1998
                   
            ----------------------------------------------------------------------------*/
                   
            #include <windows.h>
                   
            #include <tchar.h>  
                   
            #include <stdio.h>  
                   
            int CDECL MessageBoxPrintf (TCHAR * szCaption, TCHAR * szFormat, ...)
                   
            {
                   
                TCHAR   szBuffer [1024] ;
                   
                va_list pArgList ;
                   

                // The va_start macro (defined in STDARG.H) is usually equivalent to:
                   
                // pArgList = (char *) &szFormat + sizeof (szFormat) ;
                   

                va_start (pArgList, szFormat) ;
                   

                // The last argument to wvsprintf points to the arguments
                   

                _vsntprintf ( szBuffer, sizeof (szBuffer) / sizeof (TCHAR),
                   
                               szFormat, pArgList) ;
                   

                // The va_end macro just zeroes out pArgList for no good reason
                   
                va_end (pArgList) ;
                   
                return MessageBox (NULL, szBuffer, szCaption, 0) ;
                   
            }
                   
            int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   
                               PSTR szCmdLine, int iCmdShow)
                   
            {
                   
                int cxScreen, cyScreen ;
                   
                cxScreen = GetSystemMetrics (SM_CXSCREEN) ;
                   
                cyScreen = GetSystemMetrics (SM_CYSCREEN) ;
                   

                MessageBoxPrintf (    TEXT ("ScrnSize"),
                   
                               TEXT ("The screen is %i pixels wide by %i pixels high."),
                   
                               cxScreen, cyScreen) ;
                   
                return 0 ;
                   
            }

            久久成人18免费网站| 久久亚洲春色中文字幕久久久 | 久久精品国产亚洲av麻豆色欲| 久久午夜无码鲁丝片| 中文字幕亚洲综合久久| 蜜臀久久99精品久久久久久| 久久国产免费直播| 久久综合狠狠综合久久激情 | 国产精品成人久久久| 久久精品国产亚洲沈樵| 亚洲人AV永久一区二区三区久久| 日韩人妻无码精品久久久不卡 | 影音先锋女人AV鲁色资源网久久| 久久精品国产亚洲AV无码娇色| 久久久WWW成人| 久久精品国产亚洲精品2020| 色播久久人人爽人人爽人人片aV| 久久综合狠狠综合久久| 亚洲国产综合久久天堂| 欧美久久综合性欧美| 久久精品中文无码资源站| 亚洲国产精品无码久久九九| 秋霞久久国产精品电影院| 亚洲中文字幕无码久久2017 | 国产精品内射久久久久欢欢| 国产色综合久久无码有码| 日本久久中文字幕| 日本道色综合久久影院| 久久久无码人妻精品无码| 亚洲午夜久久久久久久久电影网| 日韩中文久久| 色婷婷综合久久久久中文字幕| 亚洲午夜久久影院| 色综合久久天天综合| 国产精品美女久久久免费| 97久久精品人人做人人爽| 婷婷综合久久中文字幕| 99久久国产免费福利| 国产精品无码久久四虎| 国产日韩欧美久久| 久久久黄片|