• <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 閱讀(300) 評論(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 ;
                   
            }

            国产日韩久久免费影院| 亚洲美日韩Av中文字幕无码久久久妻妇| 伊人久久国产免费观看视频| 手机看片久久高清国产日韩| 久久99国产乱子伦精品免费| 久久国产免费直播| 色综合久久中文字幕综合网| 欧美日韩久久中文字幕| 久久黄色视频| 久久精品亚洲男人的天堂| A级毛片无码久久精品免费| 日韩AV毛片精品久久久| 久久久久久亚洲Av无码精品专口| 99精品国产99久久久久久97| 岛国搬运www久久| 人妻精品久久久久中文字幕69 | 色欲久久久天天天综合网精品| 久久国产香蕉一区精品| 无码人妻久久一区二区三区免费丨 | 无码精品久久久天天影视| 国产高潮国产高潮久久久91 | 国产亚洲色婷婷久久99精品| 日本加勒比久久精品| 久久99热精品| 26uuu久久五月天| 青春久久| 久久精品中文字幕第23页| 久久免费国产精品一区二区| 国产精品亚洲综合专区片高清久久久 | 久久久亚洲AV波多野结衣| 国产成人综合久久久久久| 97超级碰碰碰久久久久| 久久久久久久99精品免费观看| 精品久久久无码人妻中文字幕 | 国内精品久久久久影院网站| 久久九九免费高清视频| 久久99精品国产| 国内精品伊人久久久久网站| 欧美伊香蕉久久综合类网站| 亚洲国产精品久久| 久久九色综合九色99伊人|