亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? init.c

?? 英文版的 想要的話可以下載了 為大家服務
?? C
字號:
/*
 * INIT.C
 *
 * Application (not OLE) specific initialization code.
 *  FApplicationInit
 *  FFileInit
 *  HLoadAppStrings
 *  HListParse
 *  PszWhiteSpaceScan
 *
 * FApplicationInit makes some calls into OLEINST.C and OLEINIT.C
 *
 * Copyright(c) Microsoft Corp. 1992-1994 All Rights Reserved
 * Win32 version, January 1994
 */


#include <windows.h>
#include <ole.h>
#include "cosmo.h"
#include "oleinst.h"
#include "oleglobl.h"



/*
 * FApplicationInit
 *
 * Purpose:
 *  All application specific initialization including loading
 *  the stringtable, registering window classes, and calling any
 *  OLE specific initialziation code.
 *
 * Parameters:
 *  pGlob           LPGLOBALS to global variable block.
 *  hPrevInst       HINSTANCE to the previous application instance, if any.
 *
 * Return Value:
 *  BOOL            TRUE if everything succeeds, FALSE otherwise.
 *                  If FALSE is returned, allocated memory and objects
 *                  are not necessarily freed.  The caller should then
 *                  use the FApplicationExit function to perform cleanup.
 */

BOOL WINAPI FApplicationInit(LPGLOBALS pGlob, HINSTANCE hPrevInst)
    {
    HLOCAL      hMem;
    LPSTR FAR * ppszCmds;
    LPSTR FAR * ppszT;
    BOOL        fRet=TRUE;

#ifdef MAKEOLESERVER
    //Make sure this is NULLed in case we fail
    pOLE->pSvr=NULL;
#endif

    /*
     * InitApp allocates local memory for strings. WinMain must free.
     * If this fails, we should quit BEFORE we register any classes
     * or do anything else to suck up USER or GDI resources.
     */
    hMem=HLoadAppStrings(pGlob);

    if (NULL==hMem)
        return FALSE;

    pGlob->hStringMem=hMem;

    //Classes are only registered if hPrevInstance is NULL.
    if (!FClassRegister(pGlob, hPrevInst))
        {
        LocalFree(pGlob->hStringMem);
        return FALSE;
        }

    //Register a private clipboard format, same as the class name.
    pGlob->cfCosmo=RegisterClipboardFormat(rgpsz[IDS_CLASSCOSMO]);

    hMem=HListParse(pGlob->pszCmdLine);
    ppszCmds=(LPSTR FAR *)(PSTR)hMem;
    ppszT=ppszCmds;

    /*
     * Scan the command line list for the first thing without a
     * / or - which is out initial file.
     */

    while (*ppszT)
        {
        if ('-'!=**ppszT && '/'!=**ppszT)
            break;

        ppszT++;
        }

    //Copy this filename for later loading during WM_CREATE.
    if (NULL==*ppszT)
        pGlob->szFile[0]=0;
    else
        lstrcpy(pGlob->szFile, *ppszT);


#ifdef MAKEOLESERVER
    /*
     * Go do anything that deals with the registration database.
     * Installation could be moved to an installation program
     */
    if (!FRegDBInstall())
        {
        LocalFree(hMem);
        return FALSE;
        }

    //Initialize OLE specific data.  FOLEInstanceInit affects pGlob->fOLE
    if (FOLEInstanceInit(pOLE, pGlob->hInst, rgpsz[IDS_CLASSCOSMO]
        , ppszCmds, pGlob->nCmdShow))
        {
        //We will open any linked file later in WM_CREATE.

        //Copy the new ShowWindow parameter.
        pGlob->nCmdShow=pOLE->pSvr->nCmdShow;
        }
    else
        fRet=FALSE;

#endif //MAKEOLESERVER

    //Free the command-line string list in hMem.
    LocalFree(hMem);
    return fRet;
    }







/*
 * FClassRegister
 *
 * Purpose:
 *  Registers classes used by the application:  "Cosmo" the main
 *  window, and "Polyline" the editing window.
 *
 * Parameters:
 *  pGlob           LPGLOBALS to the global variables block.
 *  hPrevInst       HINSTANCE of any previous application instance.
 *
 * Return Value:
 *  BOOL            TRUE if all classes are successfully registered
 *                  (or if hPrevInstance is non-NULL).  FALSE is
 *                  any registration fails.
 *
 */

BOOL WINAPI FClassRegister(LPGLOBALS pGlob, HINSTANCE hPrevInst)
    {
    WNDCLASS        wc;

    if (hPrevInst)
        return TRUE;

    /*
     * Note that we do not need to unregister classes on a failure
     * since that's part of automatic app cleanup.
     */
    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = CosmoWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = pGlob->hInst;
    wc.hIcon         = LoadIcon(pGlob->hInst, "Icon");
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU);
    wc.lpszClassName = rgpsz[IDS_CLASSCOSMO];

    if (!RegisterClass(&wc))
        return FALSE;


    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = PolylineWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = CBPOLYLINEWNDEXTRA;
    wc.hInstance     = pGlob->hInst;
    wc.hIcon         = NULL;
    wc.hCursor       = LoadCursor(NULL, IDC_CROSS);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = rgpsz[IDS_CLASSPOLYLINE];

    if (!RegisterClass(&wc))
        return FALSE;

    return TRUE;
    }





/*
 * FFileInit
 *
 * Purpose:
 *  Loads a file specified on the command line and sets the polyline
 *  window data to reflect the contents of that file.  This is set
 *  in a different function instead of in FApplicationInit since
 *  it depends on the Polyline window being created which has not
 *  happened by FApplicationInit time.
 *
 * Parameters:
 *  pGlob           LPGLOBALS to global variable block.
 *
 * Return Value:
 *  BOOL            TRUE if everything succeeded, FALSE otherwise.
 *
 */

BOOL WINAPI FFileInit(LPGLOBALS pGlob)
    {
    POLYLINE        pl;

    /*
     * If there is a file to load, then load it and change the
     * window title.  If loading fails, then default to a new
     * untitled document.
     */
    if (0!=pGlob->szFile[0])
        {
        if (!FCosFileRead(pGlob, pGlob->szFile, &pl))
            {
            //If we're in OLE linking mode, return unsuccessful
            if (pGlob->fOLE)
                return FALSE;

            pGlob->szFile[0]=0;
            WindowTitleSet(pGlob->hWnd, rgpsz[IDS_UNTITLED]);
            pGlob->fOpenFile=FALSE;

            }
        else
            {
            SendMessage(pGlob->hWndPolyline, PLM_POLYLINESET, TRUE,
                        (LONG)(LPSTR)&pl);
            WindowTitleSet(pGlob->hWnd, pGlob->szFile);
            pGlob->fOpenFile=TRUE;
            }
        }

    return TRUE;
    }







/*
 * HLoadAppStrings
 *
 * Purpose:
 *  Allocates FIXED local memory and reads the applications
 *  string resources into that memory.  Each string's pointer
 *  is available with rgpsz[i] where i is the ID value of the
 *  string.  The strings must have sequential IDs.
 *
 * Parameters:
 *  pGlob           LPGLOBALS to global variable block.
 *
 * Return Value:
 *  HLOCAL          Handle to the local memory.  NULL if memory could
 *                  not be allocated.
 */

HLOCAL WINAPI HLoadAppStrings(LPGLOBALS pGlob)
    {
    HLOCAL      hLocalMem;
    char NEAR   *pch;
    UINT        cchUsed=0;
    UINT        cch;
    short       i;

    /*
     * Allocate memory and load strings.  NOTE!  The LPTR style
     * specifies FIXED memory.  This should not be a big deal
     * since this is an early allocation into the local heap.
     * But it should be watched if the number of strings becomes
     * large.
     */
    hLocalMem=LocalAlloc(LPTR, CSTRINGS*CCHSTRINGMAX);

    if (hLocalMem==NULL)
        return (HLOCAL)NULL;

    /*
     * This operation is only valid for FIXED memory.  Otherwise use
     * LocalLock.
     */
    pch=(char *)hLocalMem;


    /*
     * Load the strings into the memory and retain the specific
     * pointer to that string.
     */
    for (i=0; i<CSTRINGS; i++)
        {
        cch=LoadString(pGlob->hInst, i, (LPSTR)(pch+cchUsed), CCHSTRINGMAX-1);
        rgpsz[i]=(char *)(pch+cchUsed);

        /*
         * One is added to cch to include a NULL.  The memory was ZEROINITed
         * on allocation so by skipping a byte we get the NULL.
         */
        cchUsed +=cch+1;
        }

    /*
     * We are assuming that no string is over CCHSTRINGMAX, and therefore
     * we did not use all the allocated memory.  Therefore LocalReAlloc
     * will only SHRINK the block, never expand it.  So if it fails, we
     * don't care--all the strings are still there, we just wasted some
     * space.
     */
    LocalReAlloc(hLocalMem, cchUsed+1, LPTR);

    return hLocalMem;
    }








/*
 * HListParse
 *
 * Purpose:
 *  Parses any string containing text separated by whitespace into
 *  a list of pointers into that string as well as overwriting the
 *  whitespace with null terminators.  The result is that each
 *  pointer in the list points to its own null-terminated string,
 *  but those strings are not necessarily contiguous.
 *
 *  Since MS-DOS command lines are limited to 128 characters, this
 *  function limits the number of arguments to 64 separate strings.
 *
 * Parameters:
 *  psz             LPSTR to the string to parse.
 *
 * Return Value:
 *  HLOCAL          Local LMEM_FIXED memory handle containing the
 *                  list of LPSTRs to the list items.  NULL if memory
 *                  could not be allocated.
 */

HLOCAL WINAPI HListParse(LPSTR psz)
    {
    HLOCAL       hMem;
    LPSTR FAR   *ppsz;
    LPSTR        pszT;
    UINT         cp;

    //Allocate space for 64 pointers.
    hMem=LocalAlloc(LPTR, 64*sizeof(LPSTR));

    if (NULL==hMem)
        return NULL;

    ppsz=(LPSTR FAR *)(PSTR)hMem;
    cp=0;

    /*
     * For each string, scan for whitespace, save that pointer in
     * ppsz, and null-terminate that string.  If it was already
     * null-terminated, then there are no more pieces in the list.
     */

    while (0!=*psz)
        {
        //Skip to beginning of first item.
        psz=PszWhiteSpaceScan(psz, TRUE);

        //If it's a zero, stop here.
        if (0==*psz)
            break;

        //Find the end of this item.
        pszT=PszWhiteSpaceScan(psz, FALSE);

        //Null terminate this string and point to next character.
        if (0!=*pszT)
            *pszT++=0;

        //Save this string pointer.
        *ppsz++=psz;
        cp++;

        //Check our limit of 64.
        if (64 <= cp)
            break;

        //Check next item.
        psz=pszT;
        }

    return hMem;
    }






/*
 * PszWhiteSpaceScan
 *
 * Purpose:
 *  Skips characters in a string until a whitespace or non-whitespace
 *  character is seen.  Whitespace is defined as \n, \r, \t, or ' '.
 *
 * NOTE:  This function is not extremely well suited to localization.
 *        It assumes that an existing application seeking to become
 *        and OLE server probably already has such a string function
 *        available.
 *
 * Parameters:
 *  psz             LPSTR to string to manipulate
 *  fSkip           BOOL  TRUE if we want to skip whitespace.
 *                  FALSE if we want to skip anything but whitespace.
 *
 * Return Value:
 *  LPSTR           Pointer to first character in the string that either
 *                  non-whitespace (fSkip=TRUE) or whitespace (fSkip=FALSE),
 *                  which may be the null terminator.
 */

LPSTR PASCAL PszWhiteSpaceScan(LPSTR psz, BOOL fSkip)
    {
    char        ch;
    BOOL        fWhite;

    while (ch=*psz)
        {
        fWhite=('\n'==ch || '\r'==ch || '\t'==ch || ' '==ch);

        //Too bad C doesn't have a logical XOR (^^) operator.
        if ((fSkip && !fWhite) || (!fSkip && fWhite))
            break;

        psz++;
        }

    return psz;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲综合色一区二区三区| 91精品国产综合久久久久| 日韩精品一级二级| 中文字幕精品综合| 久久99国产精品免费网站| 国产精品久久久一区麻豆最新章节| 欧洲视频一区二区| 不卡一卡二卡三乱码免费网站| 一区二区三区日韩在线观看| 国产精品你懂的| 久久久一区二区三区| 欧美视频一区二| 国产99久久久国产精品潘金网站| 久久综合久久综合九色| 91精品国产综合久久精品| 99久久精品免费看| 成人爱爱电影网址| 99久久er热在这里只有精品15 | 国产一区二区伦理| 欧美aaa在线| 亚洲午夜在线视频| 亚洲精品国产成人久久av盗摄| 久久蜜桃av一区精品变态类天堂| 欧美日韩国产成人在线91| 精品视频全国免费看| 成人免费毛片aaaaa**| 久久国产人妖系列| 久久精品国产99国产精品| 久久99国产精品久久| 日本va欧美va精品发布| 国产伦精品一区二区三区免费迷 | 国产毛片精品视频| 国产精品综合在线视频| 国产精品一区二区三区乱码| 国内精品伊人久久久久影院对白| 免费高清不卡av| 日韩福利视频网| 国产在线看一区| 91在线观看污| 欧美一区在线视频| 欧美国产在线观看| 一区二区久久久| 国产精品一区二区不卡| 成人av网在线| 欧美精品v国产精品v日韩精品 | 欧洲日韩一区二区三区| 51精品国自产在线| 久久午夜色播影院免费高清 | 91精品国产aⅴ一区二区| 精品国产一区a| 久久久精品综合| 亚洲日本va午夜在线影院| 亚洲欧美成aⅴ人在线观看| 天天影视涩香欲综合网| 懂色av一区二区三区免费观看| 99视频一区二区三区| 日韩精品一区二区三区四区| 久久九九全国免费| 午夜国产不卡在线观看视频| 国产一区二区三区精品欧美日韩一区二区三区| av不卡免费在线观看| 亚洲国产精品传媒在线观看| 毛片不卡一区二区| 日韩精品一区二区在线| 亚洲大片精品永久免费| 粉嫩蜜臀av国产精品网站| 精品久久久三级丝袜| 亚洲综合在线五月| 成人中文字幕在线| 久久先锋影音av鲁色资源| 日av在线不卡| 日韩欧美一级在线播放| 亚洲成人在线免费| 91久久一区二区| 自拍偷自拍亚洲精品播放| 国产91精品久久久久久久网曝门| 欧美成人vr18sexvr| 美女任你摸久久| 欧美va亚洲va| 国产乱码精品一品二品| 国产亚洲欧美色| 亚洲美女偷拍久久| 欧美中文字幕亚洲一区二区va在线| 国产亚洲成av人在线观看导航 | 欧美日韩一区在线观看| 亚洲一区二区三区四区在线| 91黄色免费网站| 天堂成人国产精品一区| 日韩色视频在线观看| 国产一区二区三区免费播放| 亚洲国产精品精华液2区45| 99在线精品观看| 日本欧美一区二区在线观看| 2020日本不卡一区二区视频| av网站一区二区三区| 亚洲精品视频一区| 精品少妇一区二区三区 | 久久久另类综合| 97精品视频在线观看自产线路二| 夜夜嗨av一区二区三区四季av| 欧美精品亚洲一区二区在线播放| 精品亚洲成a人| 亚洲综合一区二区三区| 久久综合九色综合97_久久久| 91在线无精精品入口| 美国一区二区三区在线播放| 亚洲日本电影在线| 国产欧美一区二区精品秋霞影院| 欧美在线观看禁18| 福利电影一区二区| 精品一区二区三区在线观看| 亚洲一区二区三区视频在线播放 | 国产亚洲综合av| 欧美又粗又大又爽| 黄色成人免费在线| 国产在线精品一区二区夜色| 盗摄精品av一区二区三区| 91亚洲资源网| 91精品久久久久久蜜臀| 欧美一区三区四区| 久久久久国产精品人| 亚洲欧美色综合| 久久精品久久综合| 成人精品电影在线观看| 欧美日韩视频不卡| 亚洲国产成人自拍| 亚洲成av人片一区二区| 国产一区二区三区av电影| 色综合久久久久久久久| 欧美一级午夜免费电影| 亚洲女爱视频在线| 亚洲午夜久久久久| 中文字幕一区av| 亚洲视频狠狠干| 亚洲精品日韩综合观看成人91| 日韩美女久久久| 婷婷成人综合网| 久久精品国产99| 91网页版在线| 久久综合色一综合色88| 国产蜜臀97一区二区三区 | 日韩亚洲欧美高清| 26uuu久久综合| 亚洲高清视频在线| 国产精品小仙女| 91国内精品野花午夜精品| 777色狠狠一区二区三区| 精品sm捆绑视频| 亚洲最色的网站| 粉嫩蜜臀av国产精品网站| 在线播放/欧美激情| 国产精品美女久久久久aⅴ国产馆| 亚洲国产sm捆绑调教视频| 国产激情偷乱视频一区二区三区| 欧洲精品在线观看| 国产精品视频yy9299一区| 久久福利视频一区二区| 色一情一乱一乱一91av| 国产午夜亚洲精品午夜鲁丝片 | 国产在线精品一区二区不卡了 | 中文字幕av一区二区三区| 欧美一级艳片视频免费观看| 日本高清视频一区二区| 欧美图区在线视频| 欧美国产精品中文字幕| 日韩经典中文字幕一区| va亚洲va日韩不卡在线观看| 精品国产乱码久久| 强制捆绑调教一区二区| 不卡的电视剧免费网站有什么| 精品免费视频.| 人妖欧美一区二区| 欧美日本视频在线| 肉丝袜脚交视频一区二区| 91麻豆蜜桃一区二区三区| 亚洲欧洲av在线| 99久久99久久精品免费观看| 日本一区免费视频| 国产精品一区专区| 国产人成一区二区三区影院| 韩国精品一区二区| 久久久久久久久久久久久久久99 | 日韩视频免费直播| 免费观看一级欧美片| 精品奇米国产一区二区三区| 日韩va亚洲va欧美va久久| 777午夜精品免费视频| 另类人妖一区二区av| 国产亚洲欧美激情| 91浏览器打开| 日日夜夜一区二区| 精品少妇一区二区三区免费观看| 国产老女人精品毛片久久| 国产精品久线观看视频| 91久久精品一区二区| 日本sm残虐另类| 国产日产欧美精品一区二区三区| 99久久伊人精品| 日韩电影网1区2区| 国产精品国产三级国产专播品爱网|