【C++开源】GuiLite:超轻量UI框架-入门

开发环境说明

使用visual Studio 2022进行开发
在这里插入图片描述

下载源码

从如下的网址进行源码和示例代码的下载:

使用方法

GuiLite是一个仅有头文件的一个库,使用的时候直接include到自己的UIcode.cpp文件中即可

#define GUILITE_ON	// Do not define this macro upon GuiLite.h once more
#include "GuiLite.h"

// your code here:

通过研究示例来学习使用该开源库

说明

在下载示例代码以后,以【HelloFont】的MFC工程进行入门学习,效果如下:
在这里插入图片描述

工程代码结构说明

下载HelloFont的代码结构如下,打开则MFC的工程则进入BuildMFC目录,打开【HelloFont.sln】文件
在这里插入图片描述项目依赖关系如下
在这里插入图片描述

MFC的执行流程说明

标准的入口函数wWinMain(), 然后执行如下步骤:

  1. 注册窗体类实例
ATOM  MyRegisterClass(HINSTANCE hInstance);
  1. 初始化程序,创建窗体
BOOL  InitInstance(HINSTANCE, int);
  1. 消息循环,用于针对点击事件进行响应
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   
    switch (message)
    {
   
    case WM_PAINT:
        {
   
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hWnd, &ps);
            // TODO: Add any drawing code that uses hdc here....
            EndPaint(hWnd, &ps);
        }
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
	case WM_LBUTTONDOWN:
		UIblock.OnLButtonDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(

相关推荐

  1. 开源Vue UI框架

    2024-07-18 06:12:04       49 阅读
  2. C/C++ fmt 格式化字符串实现(

    2024-07-18 06:12:04       55 阅读
  3. 11 开源鸿蒙OpenHarmony系统源码分析

    2024-07-18 06:12:04       36 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 06:12:04       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 06:12:04       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 06:12:04       58 阅读
  4. Python语言-面向对象

    2024-07-18 06:12:04       69 阅读

热门阅读

  1. ubuntu 通讯学习笔记

    2024-07-18 06:12:04       15 阅读
  2. Python的安装方法

    2024-07-18 06:12:04       21 阅读
  3. cython加速python代码

    2024-07-18 06:12:04       19 阅读
  4. Python 文件读写

    2024-07-18 06:12:04       21 阅读
  5. PHP + Swoole 与 Go 技术选型对比调研报告

    2024-07-18 06:12:04       17 阅读
  6. Spring Boot 注解 @PostConstruct 介绍

    2024-07-18 06:12:04       23 阅读
  7. 从零手写实现 nginx-31-load balance 负载均衡介绍

    2024-07-18 06:12:04       24 阅读