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

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

?? cmndlg32.c

?? THE DECISION TREE ALGORITHM USED VC
?? C
?? 第 1 頁 / 共 5 頁
字號:

/****************************************************************************
*
*
*    PROGRAM: cmndlg.c
*
*    PURPOSE: Sample demonstrating common dialogs in Windows Chicago
*
*    FUNCTIONS:
*
*        WinMain() - calls initialization function, processes message loop
*        InitApplication() - initializes window data and registers window
*        InitInstance() - saves instance handle and creates main window
*        MainWndProc() - processes messages
*        About() - processes messages for "About" dialog box
*        OpenNewFile() - opens a new file
*        SaveToFile() - saves the current text buffer to the current filename
*        SaveAs() - saves the current text buffer to a new file name
*        EnterNew() - to enter new text into the text buffer
*        FileOpenHookProc() - Hook procedure for GetOpenFileName() common dialog
*        FileSaveHookProc() - Hook procedure for GetSaveFileName() common dialog
*        ChooseFontHookProc() - Hook procedure for ChooseFont() common dialog
*        FindTextHookProc() - Hook procedure for FindText() common dialog
*        ReplaceTextHookProc() - Hook procedure for the ReplaceText() common dialog
*        PrintDlgHookProc() - Hook procedure for the PrintDlg() common dialog
*        PrintSetupHookProc() - Hook procedure for the PrintDlg() setup common dialog
*        SearchFile() - Searches for the specified text in the file buffer
*        ChooseNewFont() - chooses a new font for display
*        ChooseNewColor() - chooses a new color for display
*        PrintFile() - prints the current text in the file buffer
*        CallFindText() - calls the FindText() common dialog function
*        CallReplaceText() - calls the ReplaceText() common dialog function
*        ProcessCDError() - uses CommonDialogExtendedError() to output useful error messages
*
*    COMMENTS:
*
*
*        The common dialog APIs demonstrated in the sample include:
*
*            ChooseColor()
*            ChooseFont()
*            FindText()
*            GetOpenFileName()
*            GetSaveFileName()
*            PrintDlg()
*            ReplaceText()
*
*
*        Each dialog box is demonstrated being used in three different ways:
*        standard, using a modified template and using a hook function.
*
*
****************************************************************************/

#include <windows.h>    // includes basic windows functionality
#include <commdlg.h>    // includes common dialog functionality
#include <dlgs.h>       // includes common dialog template defines
#include <stdio.h>      // includes standard file i/o functionality
#include <string.h>     // includes string functions
#include <cderr.h>      // includes the common dialog error codes
#include <commctrl.h>
#include "resource.h"
#include "cmndlg32.h"     // includes my common dialog functions

HANDLE       hInst;
OPENFILENAME OpenFileName;
TCHAR         szDirName[256]   = "";
TCHAR         szFile[256]      = "\0";
TCHAR         szFileTitle[256];

// Filter specification for the OPENFILENAME struct
// This is portable for i386 and MIPS
// Leaving out the \0 terminator will cause improper DWORD alignment
// and cause a failure under MIPS
TCHAR szFilter[] = "Text Files (*.TXT)\0*.TXT\0All Files (*.*)\0*.*\0";
                                            
TCHAR         FileBuf[FILE_LEN];
DWORD        dwFileSize;
UINT         FindReplaceMsg;
TCHAR         szFindString[64]   = "";
TCHAR         szReplaceString[64]  = "";
FINDREPLACE  frText;
LPFINDREPLACE lpFR;
TCHAR *       lpBufPtr = FileBuf;
CHOOSEFONT   chf;
CHOOSECOLOR  chsclr;
COLORREF     crColor;
LOGFONT      lf;
WORD         wMode = IDM_STANDARD;
HWND         hDlgFR = NULL;
PRINTDLG     pd;
PAGESETUPDLG psDlg;
BOOL		 bNewShell;
HWND 		 hWndStatus;		// handle for status bar window

/****************************************************************************
*
*    FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
*
*    PURPOSE: calls initialization function, processes message loop
*
*    COMMENTS:
*
*
****************************************************************************/

int APIENTRY WinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow
    )
{

	DWORD dwVersion;
    MSG msg;                         /* message                      */

	dwVersion = GetVersion();
	if (dwVersion < 0x80000000)
		bNewShell = FALSE;
	else
		bNewShell = TRUE;

    if (!InitApplication(hInstance)) /* Initialize shared things */
            return (FALSE);              /* Exits if unable to initialize     */

    hInst = hInstance;
    lpBufPtr = &FileBuf[0];

	InitCommonControls();

    /* Perform initializations that apply to a specific instance */

    if (!InitInstance(hInstance, nCmdShow))
        return (FALSE);

    // register window message for FindText() and ReplaceText() hook procs
    FindReplaceMsg = RegisterWindowMessage( (LPTSTR) FINDMSGSTRING );

    /* Acquire and dispatch messages until a WM_QUIT message is received. */

    while (GetMessage(&msg,NULL,0,0))
        if ( !hDlgFR || !IsWindow(hDlgFR) || !IsDialogMessage( hDlgFR, &msg ) )
        {
            TranslateMessage(&msg);    /* Translates virtual key codes */
            DispatchMessage(&msg);     /* Dispatches message to window */
        }
    return (msg.wParam);           /* Returns the value from PostQuitMessage */

    // avoid compiler warnings at W3
    lpCmdLine;
}


/****************************************************************************
*
*    FUNCTION: InitApplication(HANDLE)
*
*    PURPOSE: Initializes window data and registers window class
*
*    COMMENTS:
*
*        In this function, we initialize a window class by filling out a data
*        structure of type WNDCLASS and calling the Windows RegisterClass()
*        function.
*
****************************************************************************/

BOOL InitApplication(HANDLE hInstance)       /* current instance             */
{
    WNDCLASS  wc;

    /* Fill in window class structure with parameters that describe the       */
    /* main window.                                                           */

    wc.style = 0;                       /* Class style(s).                    */
    wc.lpfnWndProc = (WNDPROC)MainWndProc;
    wc.cbClsExtra = 0;                  /* No per-class extra data.           */
    wc.cbWndExtra = 0;                  /* No per-window extra data.          */
    wc.hInstance = hInstance;           /* Application that owns the class.   */
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(WHITE_BRUSH); 
    wc.lpszMenuName =  "CmnDlgMenu";   /* Name of menu resource in .RC file. */
    wc.lpszClassName = "CmnDlgWClass"; /* Name used in call to CreateWindow. */

    /* Register the window class and return success/failure code. */

    return (RegisterClass(&wc));

}


/****************************************************************************
*
*    FUNCTION:  InitInstance(HANDLE, int)
*
*    PURPOSE:  Saves instance handle and creates main window
*
*    COMMENTS:
*
*        In this function, we save the instance handle in a static variable and
*        create and display the main program window.
*
****************************************************************************/

BOOL InitInstance(
    HANDLE          hInstance,          /* Current instance identifier.       */
    int             nCmdShow)           /* Param for first ShowWindow() call. */
{
    HWND            hWnd;               /* Main window handle.                */

    /* Save the instance handle in static variable, which will be used in  */
    /* many subsequence calls from this application to Windows.            */

    hInst = hInstance;

    /* Create a main window for this application instance.  */

    hWnd = CreateWindow(
        "CmnDlgWClass",
        "Common Dialogs Sample Application",
        WS_OVERLAPPEDWINDOW,            /* Window style.                      */
        CW_USEDEFAULT,                  /* Default horizontal position.       */
        CW_USEDEFAULT,                  /* Default vertical position.         */
        CW_USEDEFAULT,                  /* Default width.                     */
        CW_USEDEFAULT,                  /* Default height.                    */
        NULL,                           /* Overlapped windows have no parent. */
        NULL,                           /* Use the window class menu.         */
        hInstance,                      /* This instance owns this window.    */
        NULL                            /* Pointer not needed.                */
    );

    /* If window could not be created, return "failure" */

    if (!hWnd)
        return (FALSE);

    /* Make the window visible; update its client area; and return "success" */

    ShowWindow(hWnd, nCmdShow);  /* Show the window                        */
    UpdateWindow(hWnd);          /* Sends WM_PAINT message                 */
    return (TRUE);               /* Returns the value from PostQuitMessage */

}

/****************************************************************************
*
*    FUNCTION: MainWndProc(HWND, unsigned, WORD, LONG)
*
*    PURPOSE:  Processes messages
*
*    COMMENTS:
*
*        This function processes all messags sent to the window.  When the
*        user choses one of the options from one of the menus, the command
*        is processed here and passed onto the function for that command.
*        This function also processes the special "FindReplace" message that
*        this application registers for hook processing of the FindText()
*        and ReplaceText() common dialog functions.
*
****************************************************************************/

LONG APIENTRY MainWndProc(
        HWND hWnd,                /* window handle                   */
        UINT message,             /* type of message                 */
        UINT wParam,              /* additional information          */
        LONG lParam)              /* additional information          */
{
    HDC hDC;
    PAINTSTRUCT ps;
    INT nDrawX;
    INT nDrawY;
    HFONT hFont;
    HANDLE Handle;
    static BOOL NewFont;
    RECT rcl;

    switch (message) {


        case WM_CREATE:
            //initialize the output on the screen
            strcpy( FileBuf, "Hello World!");
            lpBufPtr = FileBuf;
            dwFileSize = strlen(FileBuf);
            crColor = 0;
            NewFont = FALSE;
			hWndStatus = CreateWindowEx( 
				0L,                                 // extended style
				STATUSCLASSNAME,                    // create a status bar
				"",                                 // Window name
				WS_CHILD | WS_BORDER | WS_VISIBLE | SBS_SIZEGRIP,  // window styles
				-100, -100, 10, 10,                 // x, y, Width, Height
				hWnd,                               // parent window
				(HMENU)10,                          // ID
				hInst,                              // instance
				NULL );                             // window data

			if (hWndStatus == NULL)
				MessageBox (NULL, "Status Bar not created!", NULL, MB_OK );

			if (bNewShell)
			{
                EnableMenuItem( GetMenu( hWnd ), IDM_PAGESETUP,
                            MF_BYCOMMAND | MF_ENABLED );
                DrawMenuBar( hWnd );
			}
            break;


        case WM_PAINT:
            /* Set up a display context to begin painting */
            hDC = BeginPaint (hWnd, &ps);

            GetClientRect(hWnd, &rcl);
            FillRect( hDC, &rcl, GetStockObject(WHITE_BRUSH));

            /* Initialize drawing position to 1/4 inch from the top  */
            /* and from the left of the top, left corner of the      */
            /* client area of the main windows.                      */
            nDrawX = GetDeviceCaps(hDC, LOGPIXELSX) / 4;   /* 1/4 inch */
            nDrawY = GetDeviceCaps(hDC, LOGPIXELSY) / 4;   /* 1/4 inch */

            if ( NewFont == TRUE )
            {
                hFont = CreateFontIndirect( &lf );
                Handle = SelectObject( hDC, hFont );
            }

            SetTextColor( hDC, crColor );
            TextOut (hDC, nDrawX, nDrawY, FileBuf, dwFileSize);


            // end painting and release hDC
            EndPaint( hWnd, &ps );
            break;


        case WM_COMMAND:           /* message: command from application menu */

            switch( LOWORD( wParam ))
            {
                case IDM_OPENFILE:
                    if ( OpenNewFile( hWnd ) == TRUE )
                    {
                        // enable the Save As and Print menu items
                        EnableMenuItem( GetMenu( hWnd ), IDM_SAVEFILE,
                            MF_BYCOMMAND | MF_ENABLED );
                        EnableMenuItem( GetMenu( hWnd ), IDM_PRINT,
                            MF_BYCOMMAND | MF_ENABLED );
                        DrawMenuBar( hWnd);
                        // reset the title in the title bar to reflect the
                        // new open file
                        SetWindowText( hWnd, OpenFileName.lpstrFile );
                        // reset the current color and current font to the
                        // default
                        crColor = 0;
                        NewFont = FALSE;
                        InvalidateRect( hWnd, NULL, TRUE );
                    }
                    break;

                case IDM_SAVEFILE:
                    OpenFileName.Flags = 0L;
                    SaveToFile( hWnd );
                    break;

                case IDM_SAVEFILEAS:
                    if ( SaveAs( hWnd ) == TRUE )
                    {
                        EnableMenuItem( GetMenu( hWnd ), IDM_SAVEFILE,
                            MF_BYCOMMAND | MF_ENABLED );
                        SetWindowText( hWnd, OpenFileName.lpstrFile );
                        DrawMenuBar( hWnd );
                    }
                    break;

                case IDM_EXIT:
                    PostQuitMessage(0);
                    break;

                case IDM_PRINT:
                    PrintFile( hWnd );
                    break;

				case IDM_PAGESETUP:
					PageSetup(hWnd);
					break;

                case IDM_CHOOSECOLOR:
                    if (ChooseNewColor( hWnd ))
                        InvalidateRect( hWnd, NULL, TRUE );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本三级亚洲精品| 亚洲国产精品av| 91女神在线视频| av毛片久久久久**hd| 色综合久久久久久久久久久| 色94色欧美sute亚洲13| 日韩一区二区在线观看视频播放| 欧美一区二区三区视频在线| 久久蜜桃av一区精品变态类天堂| 国产欧美一区二区三区沐欲| 亚洲欧美韩国综合色| 日韩成人一区二区三区在线观看| 国产一区二区h| 国产乱人伦精品一区二区在线观看| 91麻豆蜜桃一区二区三区| 91精品国产高清一区二区三区蜜臀| 国产亚洲一区二区在线观看| 成人午夜免费电影| 成人黄色大片在线观看| 91国偷自产一区二区开放时间| 国产午夜亚洲精品午夜鲁丝片 | 色综合久久中文综合久久牛| 91看片淫黄大片一级在线观看| 精品国产免费视频| 日韩高清在线电影| 欧美视频一区二区在线观看| 久久久一区二区三区捆绑**| 日韩电影在线免费观看| 欧美性受xxxx| 五月婷婷激情综合网| 色久综合一二码| 亚洲视频网在线直播| 国产99精品国产| 欧美国产欧美亚州国产日韩mv天天看完整| 人人爽香蕉精品| 欧美变态tickling挠脚心| 日韩二区在线观看| 日韩一区二区三区av| 日韩—二三区免费观看av| 日韩一级高清毛片| 成人午夜视频在线观看| 亚洲精品国产视频| 日韩一区二区免费高清| 美女在线一区二区| 欧美国产亚洲另类动漫| 91精品免费在线| 国产一区视频在线看| 亚洲人成精品久久久久久| 91精品久久久久久久91蜜桃| 奇米888四色在线精品| 久久久美女艺术照精彩视频福利播放| 国产综合色在线| 亚洲伦在线观看| 久久综合狠狠综合久久激情| 成人h动漫精品| 久久精品国产一区二区三| 亚洲蜜臀av乱码久久精品| 欧美成人乱码一区二区三区| jizzjizzjizz欧美| 麻豆免费精品视频| 一卡二卡三卡日韩欧美| 中文字幕第一区二区| 日韩精品一区二区三区在线| 在线观看免费视频综合| 成人综合婷婷国产精品久久蜜臀 | 色综合久久久久网| 国产精品一区二区在线观看不卡 | 欧美精品日韩精品| 91蜜桃网址入口| 成人av影视在线观看| 狠狠久久亚洲欧美| 青青草视频一区| 天天做天天摸天天爽国产一区| 亚洲欧洲一区二区在线播放| 久久综合色天天久久综合图片| 欧美精品久久99久久在免费线| 欧美三级视频在线| 777xxx欧美| 国产欧美日韩在线| 国产精品区一区二区三区| 中文字幕乱码一区二区免费| 亚洲欧洲美洲综合色网| 国产精品久久久久久久久免费桃花| 久久影视一区二区| 国产精品美女久久福利网站| 亚洲欧洲av色图| 亚洲国产中文字幕在线视频综合| 丝袜美腿高跟呻吟高潮一区| 免费高清在线一区| 国产成人在线视频网站| 99久久精品免费看国产| 欧美美女一区二区在线观看| 日韩亚洲欧美成人一区| 国产日韩欧美精品在线| 亚洲免费高清视频在线| 久久超碰97人人做人人爱| 91老司机福利 在线| 欧美成人a在线| 亚洲卡通动漫在线| 美美哒免费高清在线观看视频一区二区| 精品亚洲成av人在线观看| 91色婷婷久久久久合中文| 日韩精品一区二区三区视频| |精品福利一区二区三区| 毛片av一区二区| 91麻豆精品国产自产在线观看一区| 欧美激情一区二区三区在线| 一区二区三区中文字幕电影 | 国产精品三级电影| 日本特黄久久久高潮| 色综合久久88色综合天天6| 欧美成人a视频| 日日夜夜精品免费视频| 一本色道久久综合精品竹菊| 欧美videos中文字幕| 亚洲一区二区三区视频在线 | 亚洲综合久久av| 99国产精品国产精品久久| 亚洲精品一区二区精华| 久久99精品久久久久| 精品国产乱码久久久久久夜甘婷婷| 国产精品国产三级国产专播品爱网 | 日韩天堂在线观看| 一区二区在线观看视频在线观看| 精品一区二区在线免费观看| 日韩欧美中文一区二区| 免费看精品久久片| 欧美成人精品福利| 成人深夜福利app| 亚洲精品伦理在线| 欧美日韩一区在线| 三级在线观看一区二区| 久久综合网色—综合色88| 国产伦精一区二区三区| 欧美国产一区二区| 欧美亚洲丝袜传媒另类| 免费久久99精品国产| 国产日产欧美一区二区三区| 国产成人免费网站| 艳妇臀荡乳欲伦亚洲一区| 欧美三级视频在线观看| 国产真实精品久久二三区| 国产精品福利电影一区二区三区四区| 色综合咪咪久久| 蜜乳av一区二区三区| 亚洲欧美日韩国产成人精品影院| 欧美日韩欧美一区二区| 国产一区二区免费视频| 一区二区成人在线视频| 久久精品视频在线免费观看 | 亚洲精品国久久99热| 久久久久久久精| 欧美亚洲高清一区| fc2成人免费人成在线观看播放| 久久99这里只有精品| 最近中文字幕一区二区三区| 日韩免费看的电影| 欧美一区二区三区婷婷月色| 国产精品自在在线| 精品一区二区国语对白| 亚洲大尺度视频在线观看| 亚洲色图在线播放| 国产精品美女久久久久久| 亚洲精品一区二区三区福利| 日韩精品中文字幕一区| 欧美一区二区三区视频| 6080日韩午夜伦伦午夜伦| 欧美日韩一区二区三区在线| 91蜜桃网址入口| 欧美久久久久久久久久| 日韩欧美黄色影院| 久久亚洲影视婷婷| 亚洲国产综合在线| 美女尤物国产一区| 国产美女视频91| 96av麻豆蜜桃一区二区| 成人一区二区三区在线观看 | 国产精品欧美极品| 欧美高清一级片在线观看| 国产精品乱码妇女bbbb| 最好看的中文字幕久久| 亚洲一区自拍偷拍| 午夜精品久久久久| 国产一区在线观看麻豆| 91在线国产福利| 欧美电影一区二区三区| 久久毛片高清国产| 亚洲午夜一区二区| 国产在线播放一区三区四| 91香蕉视频在线| 日韩三级.com| 亚洲尤物在线视频观看| 国产精品一二三在| 在线视频欧美区| 欧美高清在线视频| 麻豆精品久久精品色综合| 91福利国产精品| 欧美国产日产图区| 美腿丝袜亚洲一区| 欧美午夜在线观看|