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

📄 跑马灯.c

📁 minigui窗口编程 主要是关于minigui的一些串口编程的一些案例
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <minigui/common.h>#include <minigui/minigui.h>#include <minigui/gdi.h>#include <minigui/window.h>#include <minigui/control.h>#define _ID_TIMER 160#define  ID_text  161static HWND text=0;static DLGTEMPLATE DlgYourTaste ={    WS_BORDER | WS_CAPTION,    WS_EX_NONE,    0, 0, 370, 280,    "Dialogbox",   0, 0,    2, NULL,    0};static CTRLDATA CtrlYourTaste[] ={     {        "button",        WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP,        70, 220, 70, 28,        IDOK,         "OK",        0    },    {        "button",        WS_VISIBLE | BS_PUSHBUTTON | WS_TABSTOP,        200, 220, 70, 28,        IDCANCEL,        "Cancel",        0    },};static int DialogBoxProc(HWND hDlg, int message, WPARAM wParam, LPARAM lParam){    static int x=0;    switch (message) {    case MSG_CREATE:         SetTimer (hDlg, _ID_TIMER, 1);         break;            case MSG_COMMAND:        switch (wParam) {        case IDOK:        case IDCANCEL:            KillTimer (hDlg, _ID_TIMER);            EndDialog (hDlg, wParam);            break;        }        break;        case MSG_TIMER:        if(text==0){        text=         CreateWindowEx (CTRL_STATIC, "hello!",                          WS_CHILD | WS_VISIBLE, WS_EX_TRANSPARENT,                          ID_text,                          x++, 35, 420, 45, hDlg, (DWORD) (0));        }else        {         DestroyWindow(text);         text=         CreateWindowEx (CTRL_STATIC, "hello!",                          WS_CHILD | WS_VISIBLE, WS_EX_TRANSPARENT,                          ID_text,                          x++, 35, 420, 45, hDlg, (DWORD) (0));          if(x==300)x=0;        }     }        return DefaultDialogProc (hDlg, message, wParam, lParam);}int MiniGUIMain (int argc, const char* argv[]){#ifdef _LITE_VERSION    SetDesktopRect(0, 0, 1024, 768);#endif        DlgYourTaste.controls = CtrlYourTaste;    DialogBoxIndirectParam (&DlgYourTaste, HWND_DESKTOP, DialogBoxProc, 0L);    return 0;}#ifndef _LITE_VERSION#include <minigui/dti.c>#endif

⌨️ 快捷键说明

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