⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wordpad.c

📁 ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机理和API函数调用几乎相同。甚至可以兼容XP的程序。喜欢研究系统内核的人可以看一看。
💻 C
字号:
#include "precomp.h"

HINSTANCE hInstance;
HANDLE ProcessHeap;

int WINAPI
_tWinMain(HINSTANCE hThisInstance,
        HINSTANCE hPrevInstance,
        LPTSTR lpCmdLine,
        int nCmdShow)
{
    LPTSTR lpAppName, lpVersion, lpTitle;
    HWND hMainWnd;
    MSG Msg;
    BOOL bRet;
    int Ret = 1;
    size_t len;
    INITCOMMONCONTROLSEX icex;

    hInstance = hThisInstance;
    ProcessHeap = GetProcessHeap();

    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
    icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
    InitCommonControlsEx(&icex);

    if (!AllocAndLoadString(&lpAppName, hInstance, IDS_APPNAME) ||
        !AllocAndLoadString(&lpVersion, hInstance, IDS_VERSION) )
    {
        MessageBox(NULL,
                   _T("Error loading resource "),
                   NULL,
                   0);
        return 1;
    }

    len = _tcslen(lpAppName) + _tcslen(lpVersion);
    lpTitle = (TCHAR*) HeapAlloc(ProcessHeap,
                        0,
                        (len + 2) * sizeof(TCHAR));

    wsprintf(lpTitle,
             _T("%s %s"),
             lpAppName,
             lpVersion);

    if (InitMainWindowImpl())
    {
        if (InitEditWindowImpl())
        {
            hMainWnd = CreateMainWindow(lpTitle,
                                        nCmdShow);
            if (hMainWnd != NULL)
            {
                /* pump the message queue */
                while((bRet = GetMessage(&Msg,
                                         NULL,
                                         0,
                                         0) != 0))
                {
                    if (bRet != (BOOL)-1)
                    {
                        if (!MainWndTranslateMDISysAccel(hMainWnd,
                                                         &Msg))
                        {
                            TranslateMessage(&Msg);
                            DispatchMessage(&Msg);
                        }
                    }
                }

                Ret = 0;
            }

            UninitEditWindowImpl();
        }

        UninitMainWindowImpl();
    }

    LocalFree((HLOCAL)lpAppName);

    return Ret;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -