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

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

?? main.c

?? minigui1.6.9增值板復雜應用的示例程序,看了這個用minigui就沒問題了
?? C
?? 第 1 頁 / 共 2 頁
字號:
        char rows [10];        char* newcols = cols;        char* newrows = rows;        myWINENTRY entries [] = {            { "列數:", &newcols, 0, 0 },            { "行數:", &newrows, 0, 0 },            { NULL, NULL, 0, 0 }        };        myWINBUTTON buttons[] = {            { "確認", IDOK, BS_DEFPUSHBUTTON },            { "取消", IDCANCEL, 0 },            { NULL, 0, 0}        };        int result;        sprintf (cols, "%d", pNoteInfo->cols);        sprintf (rows, "%d", pNoteInfo->rows);        result = myWinEntries (hWnd,                "新記事本大小",                "請指定新記事本的窗口大小",                240, 150, FALSE, entries, buttons);        col = atoi (newcols);        row = atoi (newrows);        free (newcols);        free (newrows);        if (result != IDOK)            return;        if (col < MIN_COLS || col > MAX_COLS                 || row < MIN_ROWS || row > MAX_ROWS) {            MessageBox (hWnd,                     "請指定有效的記事本大小值.",                    "記事本",                    MB_OK | MB_ICONINFORMATION);            return;        }        break;    }    default:        return;    }    pNoteInfo->winType = cmd_id;}static BOOL SetCharset (HWND hWnd, PNOTEINFO pNoteInfo, WPARAM cmd_id){    LOGFONT log_font;    PLOGFONT sys_font;    char* charset;    if (pNoteInfo->editCharset == cmd_id)        return FALSE;    switch (cmd_id) {    case IDM_ANSI:        charset = "ISO8859-1";        break;    case IDM_GB2312:        charset = "GB2312-80";        break;    case IDM_THAI:        charset = "ISO8859-11";        break;    case IDM_BIG5:        charset = "BIG5";        break;    case IDM_DEFAULT:        charset = NULL;        break;    default:        return FALSE;    }    if (cmd_id == IDM_DEFAULT)        pNoteInfo->log_font = NULL;    else {        sys_font = GetSystemFont (SYSLOGFONT_WCHAR_DEF);        memcpy (&log_font, sys_font, sizeof (LOGFONT));        if (pNoteInfo->log_font)            DestroyLogFont (pNoteInfo->log_font);        strcpy (log_font.charset, charset);        pNoteInfo->log_font = CreateLogFontIndirect (&log_font);    }    pNoteInfo->editCharset = cmd_id;    SetWindowFont (pNoteInfo->hMLEditWnd, pNoteInfo->log_font);    return TRUE;}//modified by leon to fix the saveas bugBOOL NBSaveAs (PNOTEINFO pNoteInfo, HWND hParent, HWND hMLEditWnd){    NEWFILEDLGDATA myWinFileData;    FILE * file;    int choise=0;    int reallength=0;    char buffer[102400];    strcpy (myWinFileData.filepath, pNoteInfo->filePath);    strcpy (myWinFileData.filter, "All file (*.*) |Text file (*.txt)");    myWinFileData.IsSave = TRUE;        choise = ShowOpenDialog (hParent, 0, 0, 320, 240, &myWinFileData);    if (choise == IDOK)    {        strcpy(pNoteInfo->fileFullName,myWinFileData.filefullname);        DivideFileFullName(pNoteInfo);        umask (S_IXGRP | S_IWOTH);        if ((file = fopen (pNoteInfo->fileFullName, "w+")) == NULL)        {             MessageBox (hParent,"文件打開失敗","記事簿", MB_OK | MB_ICONSTOP);             return FALSE;        }        reallength = GetWindowTextLength(hMLEditWnd);        GetWindowText(hMLEditWnd,buffer,102400);        //fprintf(stderr,"\n in saveas:\nreallength:%d\ntext:\n%s",reallength,buffer);        if (fwrite(buffer, 1, reallength, file) < 0)              MessageBox (hParent,"文件寫入錯","記事簿", MB_OK | MB_ICONEXCLAMATION);        pNoteInfo->isChanged = FALSE;        fclose (file);        return TRUE;    }    return FALSE;}BOOL NBSave (PNOTEINFO pNoteInfo, HWND hParent, HWND hMLEditWnd){    FILE *file;    char buffer[102400];    long reallength=0;    if (strcmp (pNoteInfo->fileName,"tmp.txt")==0)    {        return NBSaveAs (pNoteInfo, hParent, hMLEditWnd);    }    file = fopen(pNoteInfo->fileFullName, "w+");    if (file == NULL)    {         MessageBox (hParent, "文件打開失敗","記事簿", MB_OK | MB_ICONSTOP);         return FALSE;    }    reallength = GetWindowTextLength(hMLEditWnd);    GetWindowText(hMLEditWnd,buffer,102399);    if (fwrite(buffer, 1, reallength, file) < 0)          MessageBox (hParent, "文件寫入錯","記事簿", MB_OK | MB_ICONEXCLAMATION);    fclose (file);    pNoteInfo->isChanged = FALSE;    return TRUE;}BOOL NBOpen(PNOTEINFO pNoteInfo, HWND hParent, HWND hMLEditWnd){    FILEDLGDATA myWinFileData;    int choise=0,fd;    long reallength=0;    char buffer[102400];    strcpy (myWinFileData.filepath, ".");    myWinFileData.IsSave = FALSE;    if (pNoteInfo->isChanged) {         choise = MessageBox (hParent,                            "文檔正文已改動,是否保存?",                            "記事簿",                            MB_YESNOCANCEL | MB_ICONQUESTION);        if (choise == IDYES)            NBSave(pNoteInfo, hParent, hMLEditWnd);        else if (choise == IDCANCEL)            return FALSE;        pNoteInfo->isChanged = FALSE;    }//    else //        fprintf(stderr,"unchanged");    choise = OpenFileDialog (hParent, FALSE, &myWinFileData);    if(choise == IDOK)    {        HCURSOR old_cursor;//        fprintf(stderr,"Open File: %s \n",myWinFileData.filefullname);        if ( access (myWinFileData.filefullname, F_OK) < 0)            MessageBox (hParent, "文件不存在","記事簿", MB_OK | MB_ICONSTOP);        else if ( access (myWinFileData.filefullname, R_OK) < 0)            MessageBox (hParent, "文件不可讀","記事簿", MB_OK | MB_ICONSTOP);        else         {            if ( access (myWinFileData.filefullname, W_OK) < 0)                MessageBox (hParent, "文件不可寫","記事簿", MB_OK | MB_ICONEXCLAMATION);            fd = open(myWinFileData.filefullname,O_RDONLY);            if (fd <= 0)            {                 MessageBox (hParent, "文件打開失敗","記事簿", MB_OK | MB_ICONSTOP);                 return FALSE;            }            old_cursor = SetDefaultCursor (GetSystemCursor (IDC_WAIT));            if ((reallength=read(fd,buffer,102399)) >= 102399)                  MessageBox (hParent, "文件被截斷","記事簿", MB_OK | MB_ICONEXCLAMATION);            close (fd);            buffer[reallength]=0;            SetWindowText (hMLEditWnd, buffer);            SetDefaultCursor (old_cursor);            strcpy(pNoteInfo->fileFullName,myWinFileData.filefullname);            DivideFileFullName(pNoteInfo);            return TRUE;        }    }        return FALSE;}BOOL NBNew(PNOTEINFO pNoteInfo, HWND hParent, HWND hMLEditWnd){    if (pNoteInfo->isChanged)        NBSave(pNoteInfo, hParent, hMLEditWnd);    SetWindowText(hMLEditWnd,"");    strcpy(pNoteInfo->fileFullName,"tmp.txt");    return DivideFileFullName(pNoteInfo);}BOOL NBPrint(HWND hMLEditWnd){    char temp [255];    GetWindowTextLength (hMLEditWnd);     GetWindowText (hMLEditWnd, temp, 254);    return TRUE;}int NoteBookWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam){    HWND hMLEditWnd;    RECT client;    char title[NAME_MAX + 10];    PNOTEINFO pNoteInfo;    pNoteInfo = (PNOTEINFO) GetWindowAdditionalData(hWnd);    hMLEditWnd = pNoteInfo->hMLEditWnd;    GetClientRect(hWnd,&client);    switch (message) {    case MSG_CREATE:        pNoteInfo->hMLEditWnd = CreateWindow ("medit",                  "",  WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL,                IDC_MLEDIT, 0, 0, client.right,client.bottom , hWnd, 0);        strcpy(title,pNoteInfo->fileName);        strcat(title," - notebook");        SetWindowText(hWnd,title);        break;    case MSG_SHOWWINDOW:        if (hMLEditWnd != HWND_INVALID)            SetFocus (hMLEditWnd);        return 0;    case MSG_ACTIVEMENU:        if (wParam == 2) {                CheckMenuRadioItem ((HMENU)lParam,                    IDM_40X15, IDM_CUSTOMIZE,                    pNoteInfo->winType, MF_BYCOMMAND);                CheckMenuRadioItem ((HMENU)lParam,                    IDM_DEFAULT, IDM_BIG5,                    pNoteInfo->editCharset, MF_BYCOMMAND);        }        break;    case MSG_COMMAND:        switch (wParam) {        case IDM_NEW:            if(NBNew(pNoteInfo, hWnd, hMLEditWnd)) {                strcpy(title,pNoteInfo->fileName);                strcat(title," - notebook");                SetWindowText(hWnd,title);            }            break;        case IDM_OPEN:            if (NBOpen(pNoteInfo, hWnd, hMLEditWnd)) {                strcpy(title,pNoteInfo->fileName);                strcat(title," - notebook");                SetWindowText(hWnd,title);            };            break;        case IDM_SAVE:            if(NBSave(pNoteInfo, hWnd, hMLEditWnd)) {                strcpy(title,pNoteInfo->fileName);                strcat(title," - notebook");                SetWindowText(hWnd,title);            };            break;        case IDM_SAVEAS:            if(NBSaveAs(pNoteInfo, hWnd, hMLEditWnd))            {                strcpy(title,pNoteInfo->fileName);                strcat(title," - notebook");                SetWindowText(hWnd,title);            };            break;        case IDM_PRINT:            NBPrint(hMLEditWnd);            break;        case IDM_EXIT:             PostMessage (hWnd, MSG_CLOSE,0,0);        break;        case IDM_40X15 ... IDM_CUSTOMIZE:            SetWindowSize (hWnd, pNoteInfo, wParam);        break;        case IDM_DEFAULT... IDM_BIG5:            SetCharset (hWnd, pNoteInfo, wParam);            break;        case IDM_ABOUT:            AboutLaodan(hWnd);        break;        case IDM_ABOUT_THIS:            AboutNotebook(hWnd);        break;        };        if ((wParam>>16) == EN_CHANGE) {            if (hMLEditWnd ==(HWND)lParam) {                pNoteInfo->isChanged = TRUE;            }        };        return 0;    case MSG_CLOSE:        if (pNoteInfo->isChanged) {                int choise = MessageBox (hWnd,                            "保存修改內容嗎?",                            "記事簿",                            MB_YESNOCANCEL | MB_ICONQUESTION);                                            if ( choise == IDYES)                    NBSave(pNoteInfo, hWnd, hMLEditWnd);                else if ( choise == IDCANCEL)                    break;        }        DestroyWindow (hMLEditWnd);        pNoteInfo->hMLEditWnd = HWND_INVALID;        DestroyMainWindow (hWnd);        PostQuitMessage (hWnd);        return 0;    }    return DefaultMainWinProc (hWnd, message, wParam, lParam);}#if 0static HICON myLoadIcon (const char* filename){    static char res_dir [MAX_PATH + 1] = {'\0'};    char full_path [MAX_PATH + 1];    if (res_dir [0] == '\0') {        if (GetValueFromEtcFile (ETCFILEPATH, "appinfo", "apprespath",            res_dir, MAX_PATH) < 0)            strcpy (res_dir, "res/");    }        strcpy (full_path, res_dir);    if (full_path [strlen (full_path) - 1] != '/')        strcat (full_path, "/");    strcat (full_path, "notebook/");    strcat (full_path, filename);        return LoadIconFromFile (HDC_SCREEN, full_path, 0); }#endifstatic void InitNoteBookInfo (PMAINWINCREATE pCreateInfo, PNOTEINFO pNoteInfo){    pCreateInfo->dwStyle = WS_CAPTION | WS_BORDER |                        WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE | WS_SYSMENU;         pCreateInfo->dwExStyle = WS_EX_IMECOMPOSE;    pCreateInfo->spCaption = "記事簿";    pCreateInfo->hMenu = createmenu();    pCreateInfo->hCursor = GetSystemCursor(0);    pCreateInfo->hIcon = LoadIconFromFile (HDC_SCREEN, "res/notebook.ico", 0);     pCreateInfo->MainWindowProc = NoteBookWinProc;    pCreateInfo->lx = pNoteInfo->lx;     pCreateInfo->ty = pNoteInfo->ty;    pCreateInfo->rx        = pNoteInfo->lx + ClientWidthToWindowWidth (WS_CAPTION | WS_BORDER,                pNoteInfo->cols * GetSysCharWidth ());    pCreateInfo->by        = pNoteInfo->ty + ClientHeightToWindowHeight (WS_CAPTION | WS_BORDER,                pNoteInfo->rows * GetSysCharHeight (), TRUE);    pCreateInfo->iBkColor = COLOR_lightgray;     pCreateInfo->dwAddData = (DWORD)pNoteInfo;    pCreateInfo->hHosting = HWND_DESKTOP;}void* NoteBook (void* data){    MSG Msg;    MAINWINCREATE CreateInfo;    HWND hMainWnd;    PNOTEINFO pNoteInfo;    char currentpath [PATH_MAX + 1];    static int x = 0, y = 0;    getcwd(currentpath,PATH_MAX);    if (data == NULL)    {        if(!(pNoteInfo = malloc(sizeof(NOTEINFO)))) return NULL;//error!!        pNoteInfo->isChanged = FALSE;        strcpy(pNoteInfo->fileName , "tmp.txt");        strcpy(pNoteInfo->filePath , currentpath);        pNoteInfo->fileSize = 0;        pNoteInfo->Buffer = NULL;        pNoteInfo->hMLEditWnd = HWND_INVALID;        pNoteInfo->lx = x;        pNoteInfo->ty = y;        x += 20; y += 20;        pNoteInfo->cols = VGASTD_NUMBER_COLS;        pNoteInfo->rows = VGASTD_NUMBER_ROWS;        pNoteInfo->winType = IDM_80X25;        pNoteInfo->editCharset = IDM_DEFAULT;        pNoteInfo->log_font = NULL;    }    else        pNoteInfo = (PNOTEINFO) data;    if (pNoteInfo->filePath [strlen (pNoteInfo->filePath) - 1] != '/')        strcat (pNoteInfo->filePath, "/");    InitNoteBookInfo (&CreateInfo, pNoteInfo);    if ( !InitMiniGUIExt () ) return NULL;    hMainWnd = CreateMainWindow (&CreateInfo);    if (hMainWnd == HWND_INVALID)        return NULL;    while (GetMessage (&Msg, hMainWnd) ) {        TranslateMessage (&Msg);        DispatchMessage (&Msg);    }    MainWindowThreadCleanup (hMainWnd);    MiniGUIExtCleanUp ();    if (pNoteInfo->log_font)       DestroyLogFont (pNoteInfo->log_font);    free (pNoteInfo);    return NULL;}#ifndef _LITE_VERSIONvoid* NewNoteBook (PNOTEINFO pNoteInfo){    pthread_t th;        CreateThreadForMainWindow (&th, NULL, NoteBook, pNoteInfo);    return NULL;}int MiniGUIMain (int args, const char* arg[]){#ifdef _IME_GB2312    GBIMEWindow (HWND_DESKTOP);#endif    NoteBook(NULL);    return 0;}#include <minigui/dti.c>#elseint MiniGUIMain (int args, const char* arg[]){#ifndef _STAND_ALONE    int i;    const char* layer = NULL;    RECT max_rect = {0, 0, 0, 0};    for (i = 1; i < args; i++) {        if (strcmp (arg[i], "-layer") == 0) {            layer = arg[i + 1];            break;        }    }    GetLayerInfo (layer, &max_rect, NULL, NULL, NULL);    if (JoinLayer (layer, arg[0],                 max_rect.left, max_rect.top,                 max_rect.left + 1024,                 max_rect.top + 768) == INV_LAYER_HANDLE) {        printf ("JoinLayer: invalid layer handle.\n");        exit (1);    }#endif    NoteBook (NULL);    return 0;}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情久久久久久久久久久久久久久久| 美女mm1313爽爽久久久蜜臀| 午夜国产不卡在线观看视频| 亚洲永久精品大片| 久久99国产精品麻豆| 97成人超碰视| 欧美一级欧美三级| 亚洲精品国产成人久久av盗摄| 亚洲一区二区高清| 亚洲国产精品久久一线不卡| 国产日韩欧美一区二区三区乱码 | 欧美精品乱人伦久久久久久| 精品美女一区二区| 久久九九久久九九| 麻豆专区一区二区三区四区五区| 不卡一区二区在线| 亚洲国产精品久久久久秋霞影院 | 久久综合九色综合久久久精品综合 | 国产成人午夜电影网| 国产清纯在线一区二区www| 狠狠v欧美v日韩v亚洲ⅴ| 欧美最新大片在线看| 免费观看91视频大全| 国产精品美女久久久久久久久久久| 91网站黄www| 亚洲欧洲精品一区二区三区| 欧洲av一区二区嗯嗯嗯啊| 久久精品国产亚洲aⅴ| 2017欧美狠狠色| 色综合一个色综合| 另类欧美日韩国产在线| 国产+成+人+亚洲欧洲自线| 精品日韩欧美在线| 色综合久久99| 国模冰冰炮一区二区| 国产精品看片你懂得| 欧美日韩国产首页| 日韩毛片视频在线看| 欧美久久久久免费| 成人黄色小视频| 性欧美大战久久久久久久久| 国产精品网站在线观看| 欧美精品在线一区二区三区| 亚洲 欧美综合在线网络| 国产91色综合久久免费分享| 成人av片在线观看| 亚洲国产另类av| 国产人伦精品一区二区| 91精品国产免费| 国产成人久久精品77777最新版本| 亚洲线精品一区二区三区| 欧美激情资源网| 欧美电视剧在线观看完整版| 日本精品一级二级| 欧美吞精做爰啪啪高潮| 欧美肥大bbwbbw高潮| 日韩免费电影网站| 久久亚洲精华国产精华液| 国产欧美日韩亚州综合| 国产精品欧美极品| 悠悠色在线精品| 日韩中文字幕1| 狠狠狠色丁香婷婷综合激情| 国产成人免费在线观看不卡| 91小视频在线观看| 欧美酷刑日本凌虐凌虐| 久久蜜桃av一区二区天堂 | 亚洲精品在线观看网站| 中文字幕精品综合| 亚洲一区在线观看视频| 人妖欧美一区二区| 高清av一区二区| 在线免费精品视频| 日韩精品一区二区三区中文不卡| 久久精品人人做人人综合| 亚洲麻豆国产自偷在线| 偷拍一区二区三区| 国产麻豆成人精品| 欧美吻胸吃奶大尺度电影| 欧美浪妇xxxx高跟鞋交| 色综合天天综合网天天狠天天| 色狠狠桃花综合| 91精品在线免费| 国产精品欧美极品| 日本一区中文字幕| 丁香婷婷深情五月亚洲| 欧美三级中文字| 国产日韩亚洲欧美综合| 午夜婷婷国产麻豆精品| 成人午夜伦理影院| 在线播放/欧美激情| ㊣最新国产の精品bt伙计久久| 午夜精品福利一区二区三区蜜桃| 国产成人在线电影| 7777精品伊人久久久大香线蕉超级流畅 | 欧美日韩中文精品| 久久久久国产免费免费| 亚洲午夜一区二区三区| 国产成人啪午夜精品网站男同| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 久久久久青草大香线综合精品| 亚洲美女偷拍久久| 国产高清精品久久久久| 欧美久久高跟鞋激| 亚洲视频一区在线观看| 国产在线观看一区二区| 欧美日韩精品一二三区| 中文字幕人成不卡一区| 另类综合日韩欧美亚洲| 欧美探花视频资源| 亚洲日本va在线观看| 韩国av一区二区| 欧美一级一区二区| 亚洲五月六月丁香激情| jlzzjlzz亚洲女人18| 久久综合九色综合欧美98 | 国产白丝网站精品污在线入口| 欧美久久久影院| 亚洲伊人伊色伊影伊综合网| 处破女av一区二区| 欧美精品一区二区久久婷婷| 亚洲成人激情综合网| 99久久久久久| 国产精品亲子乱子伦xxxx裸| 韩国理伦片一区二区三区在线播放| 欧美日韩免费不卡视频一区二区三区| 亚洲国产精品精华液2区45| 韩国中文字幕2020精品| 欧美日韩欧美一区二区| 亚洲国产一区视频| 99精品久久只有精品| 中文字幕视频一区二区三区久| 麻豆91在线播放| 欧美喷潮久久久xxxxx| 亚洲综合色成人| 在线观看av不卡| 亚洲最新视频在线观看| 欧美专区日韩专区| 玉米视频成人免费看| 91视频免费观看| 亚洲欧美日韩国产成人精品影院 | 日本欧美久久久久免费播放网| 欧美性受极品xxxx喷水| 亚洲一区自拍偷拍| 欧美性高清videossexo| 亚洲午夜激情网站| 欧美久久久久久蜜桃| 视频在线观看国产精品| 欧美一区三区四区| 麻豆精品久久久| 久久中文字幕电影| 国产成人av一区| 亚洲欧洲国产日本综合| 色妞www精品视频| 亚洲在线视频一区| 欧美肥妇毛茸茸| 国产一区二区三区综合| 国产精品福利一区二区三区| 色综合激情五月| 亚洲国产精品久久一线不卡| 777午夜精品免费视频| 免费人成黄页网站在线一区二区 | 欧美极品少妇xxxxⅹ高跟鞋| 99视频国产精品| 亚洲电影你懂得| 日韩欧美亚洲国产另类| 91在线国产福利| 日韩一区精品视频| 久久蜜桃一区二区| 一本色道a无线码一区v| 视频在线观看一区| 国产日韩一级二级三级| 欧美性猛交xxxx黑人交| 久久疯狂做爰流白浆xx| 国产精品人妖ts系列视频| 欧美日韩中文另类| 国产精品亚洲а∨天堂免在线| 亚洲美女视频在线观看| 日韩一本二本av| 成人免费毛片aaaaa**| 亚洲成a天堂v人片| 国产三区在线成人av| 91成人国产精品| 国产精品99久久久| 亚洲gay无套男同| 国产精品视频线看| 欧美一区二视频| 91视频在线观看免费| 国产综合色在线视频区| 亚洲观看高清完整版在线观看 | 在线观看免费亚洲| 国产精品夜夜嗨| 亚洲图片自拍偷拍| 国产精品久久久久一区二区三区共| 91精品国产一区二区三区香蕉| 国产精品亚洲专一区二区三区| 午夜欧美一区二区三区在线播放| 国产精品色哟哟网站| 精品视频1区2区3区| 成人高清视频在线观看|