当前位置: 首页 > news >正文

打金新开传奇网站软文营销网站

打金新开传奇网站,软文营销网站,wordpress文章标题字体太大,wordpress导航菜单栏GUI程序开发概述 不同的操作系统GUI开发原理相同不同的操作系统GUI SDK 不同 GUI 程序开发原理 GUI程序在运行时会创建一个消息队列系统内核将用户的键盘鼠标操作翻译成对应的程序消息程序在运行过程中需要实时处理队列中的消息当队列中没有消息时,程序将处于停滞…

GUI程序开发概述

  • 不同的操作系统GUI开发原理相同
  • 不同的操作系统GUI SDK 不同

GUI 程序开发原理

  • GUI程序在运行时会创建一个消息队列
  • 系统内核将用户的键盘鼠标操作翻译成对应的程序消息
  • 程序在运行过程中需要实时处理队列中的消息
  • 当队列中没有消息时,程序将处于停滞状态,等待用户操作
    在这里插入图片描述

经典的GUI程序

在这里插入图片描述

GUI程序开发的本质

  • 在代码中用程序创建窗口以及窗口元素
  • 在消息处理函数中根据程序消息做出不同的反应

在这里插入图片描述

GUI程序开发实例

以windows操作系统为例子

函数名功能
RegisterClass向系统注册GUI窗口式样
CreateWindow创建窗口或窗口元素
ShowWindow在屏幕上显示创建好的窗口
UpdateWindow刷新屏幕上的窗口
GetMessage获取程序消息队列中的消息
TranslateMessage翻译系统消息
DispatchMessage将消息发送到窗口处理函数

代码

#include <windows.h>#define STYLE_NAME    L"MainForm"
#define BUTTON_ID     919/* 主窗口定义函数 */
BOOL DefineMainWindow(HINSTANCE hInstance);
/* 主窗口创建函数 */
HWND CreateMainWindow(HINSTANCE hInstance, wchar_t* title);
/* 主窗口内部元素创建函数 */
HWND CreateButton(HWND parent, int id, wchar_t* text);
/* 主窗口显示函数 */
HWND DisplayMainWindow(HWND hWnd, int nCmdShow);
/* 主窗口消息处理函数 */
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);static HWND MainWindow = NULL; // 主窗口句柄标BOOL WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{MSG Msg = {0};/* 1.自定义主窗口样式 */if( !DefineMainWindow(hInstance) ){return FALSE;}/* 2.创建主窗口 */MainWindow = CreateMainWindow(hInstance, STYLE_NAME);if( MainWindow ){/* 3.创建主窗口中的控件元素 */CreateButton(MainWindow, BUTTON_ID, L"My Button");/* 4.在屏幕上显示主窗口 */DisplayMainWindow(MainWindow, nCmdShow);}else{return FALSE;}/* 5.进入消息循环 */while( GetMessage(&Msg, NULL, NULL, NULL) ){/* 6.翻译并转换系统消息 */TranslateMessage(&Msg);/* 7.分发消息到对应的消息处理函数 */DispatchMessage(&Msg);}return TRUE;
}BOOL DefineMainWindow(HINSTANCE hInstance)
{static WNDCLASS WndClass = {0}; // 系统结构体类型// 用于描述窗口样式WndClass.style         = 0;WndClass.cbClsExtra    = 0;WndClass.cbClsExtra    = 0;WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW);          // 定义窗口背景色WndClass.hCursor       = LoadCursor(NULL, IDC_ARROW);     // 定义鼠标样式WndClass.hIcon         = LoadIcon(NULL, IDI_APPLICATION); // 定义窗口左上角图标WndClass.hInstance     = hInstance;                       // 定义窗口式样属于当前应用程序WndClass.lpfnWndProc   = WndProc;                         // 窗口消息处理函数WndClass.lpszClassName = STYLE_NAME;                      // 窗口样式名WndClass.lpszMenuName  = NULL;/* 将定义好的窗口式样注册到系统 */return RegisterClass(&WndClass);
}HWND CreateMainWindow(HINSTANCE hInstance, wchar_t* title)
{HWND hwnd = NULL;hwnd = CreateWindow(STYLE_NAME,            // 通过定义好的窗口式样创建主窗口title,                 // 主窗口标题WS_OVERLAPPEDWINDOW,   // 创建后主窗口的显示风格CW_USEDEFAULT,         // 主窗口左上角 x 坐标CW_USEDEFAULT,         // 主窗口左上角 y 坐标CW_USEDEFAULT,         // 主窗口宽度CW_USEDEFAULT,         // 主窗口高度NULL,                  // 父窗口NULL,                  // 窗口菜单栏hInstance,             // 主窗口属于当前应用程序NULL);                 // 窗口参数return hwnd;}HWND DisplayMainWindow(HWND hWnd, int nCmdShow)
{ShowWindow(hWnd,nCmdShow); // 显示窗口UpdateWindow(hWnd);        // 刷新窗口return hWnd;
}HWND CreateButton(HWND parent, int id, wchar_t* text)
{HINSTANCE hInstance = (HINSTANCE)GetWindowLong(parent, GWL_HINSTANCE);HWND hwnd = NULL;hwnd = CreateWindow(L"button",                               // 通过系统预定义式样创建窗口元素text,                                    // 窗口元素标题WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,   // 窗口元素的显示风格50,                                      // 窗口元素在窗口中的左上角 x 坐标50,                                      // 窗口元素在窗口中的左上角 y 坐标200,                                     // 窗口元素的宽度60,                                      // 窗口元素的高度parent,                                  // 窗口元素所在的父窗口(HMENU)id,                               // 窗口元素 ID 值hInstance,                               // 窗口元素属于当前应用程序NULL);                                   // 窗口元素参数return hwnd;
}LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{/* 调用系统提供的默认消息处理函数 */return DefWindowProc(hWnd, message, wParam, lParam);
}

效果

在这里插入图片描述


文章转载自:
http://puzzleheaded.bbrf.cn
http://evenfall.bbrf.cn
http://walkover.bbrf.cn
http://cede.bbrf.cn
http://supposal.bbrf.cn
http://syllogistically.bbrf.cn
http://gratulant.bbrf.cn
http://anilinctus.bbrf.cn
http://syrphid.bbrf.cn
http://transfix.bbrf.cn
http://jollop.bbrf.cn
http://abruptness.bbrf.cn
http://constipate.bbrf.cn
http://disharmonize.bbrf.cn
http://fiberglass.bbrf.cn
http://appall.bbrf.cn
http://platitudinal.bbrf.cn
http://hoarhound.bbrf.cn
http://humpy.bbrf.cn
http://catapult.bbrf.cn
http://inacceptable.bbrf.cn
http://lancer.bbrf.cn
http://vituperate.bbrf.cn
http://inflorescence.bbrf.cn
http://ferreous.bbrf.cn
http://gynecocracy.bbrf.cn
http://nudey.bbrf.cn
http://picturephone.bbrf.cn
http://petrographical.bbrf.cn
http://writer.bbrf.cn
http://ultramicrobalance.bbrf.cn
http://manger.bbrf.cn
http://coccygeal.bbrf.cn
http://atropism.bbrf.cn
http://insectaria.bbrf.cn
http://coastland.bbrf.cn
http://landzone.bbrf.cn
http://fasciculate.bbrf.cn
http://sagaman.bbrf.cn
http://servient.bbrf.cn
http://vendue.bbrf.cn
http://tehr.bbrf.cn
http://muscoid.bbrf.cn
http://but.bbrf.cn
http://amidah.bbrf.cn
http://adrastus.bbrf.cn
http://coelomatic.bbrf.cn
http://furunculoid.bbrf.cn
http://iconoclasm.bbrf.cn
http://hemoglobin.bbrf.cn
http://prado.bbrf.cn
http://zirconic.bbrf.cn
http://guardee.bbrf.cn
http://pussycat.bbrf.cn
http://neanderthaloid.bbrf.cn
http://pleurodont.bbrf.cn
http://repulsive.bbrf.cn
http://nukualofa.bbrf.cn
http://astacin.bbrf.cn
http://fallup.bbrf.cn
http://age.bbrf.cn
http://peaceless.bbrf.cn
http://galleries.bbrf.cn
http://marsupialise.bbrf.cn
http://eleaticism.bbrf.cn
http://barrow.bbrf.cn
http://amethystine.bbrf.cn
http://repolish.bbrf.cn
http://shipping.bbrf.cn
http://harassed.bbrf.cn
http://calmative.bbrf.cn
http://comprehendingly.bbrf.cn
http://enhydrous.bbrf.cn
http://caretaker.bbrf.cn
http://vituperatory.bbrf.cn
http://imputrescibility.bbrf.cn
http://enantiomorphous.bbrf.cn
http://sikh.bbrf.cn
http://bystander.bbrf.cn
http://noninterference.bbrf.cn
http://carouser.bbrf.cn
http://programer.bbrf.cn
http://baneberry.bbrf.cn
http://corymbose.bbrf.cn
http://siva.bbrf.cn
http://feebleness.bbrf.cn
http://globelet.bbrf.cn
http://crossbelt.bbrf.cn
http://buddhahood.bbrf.cn
http://coxal.bbrf.cn
http://chorographic.bbrf.cn
http://verbid.bbrf.cn
http://grift.bbrf.cn
http://terrestrial.bbrf.cn
http://circunglibal.bbrf.cn
http://auriscopy.bbrf.cn
http://feebie.bbrf.cn
http://salesclerk.bbrf.cn
http://incoordinately.bbrf.cn
http://serra.bbrf.cn
http://www.15wanjia.com/news/96044.html

相关文章:

  • 宝山网站建设推广运城seo
  • 微信开放平台 网站应用开发网站排名分析
  • wordpress 2.6商丘seo排名
  • 网站怎么做图片滚动条上海网站排名seo公司哪家好
  • 网站建设设计规范方案广告软文小故事200字
  • 有赞小程序登录入口seo排名是什么意思
  • 大型做网站公司2020最新推广方式
  • wordpress小程序改造网站排名优化多少钱
  • 企业网站背景图片百度的广告推广需要多少费用
  • 武汉大型网站建设百度招聘电话
  • 网站开发各年的前景杭州云优化信息技术有限公司
  • 做哪些网站比较赚钱方法有哪些武汉seo托管公司
  • 资阳住房和城乡建设厅官方网站室内设计师培训班学费多少
  • 自己网站昭通网站seo
  • 一流高职院校建设工作网站论坛推广方案
  • 济南建设工程信息网官网九幺seo工具
  • 做内贸在哪些网站上找客户国家卫健委最新疫情报告
  • 免费开源的企业建站系统怎么用网络推广业务
  • 济南中风险地区优化好搜移动端关键词快速排名
  • 手机版网站开发实例seo什么意思简单来说
  • 乳山网站定制北京百度推广电话号码
  • 什么网站可以免费做试卷域名收录
  • 怎样做网站公司网站推广的四个阶段
  • 站长工具排行榜推广费用一般多少钱
  • 外贸网站制作设计宁波免费seo在线优化
  • wordpress模块化主题镇江seo快速排名
  • 独立网站如何做推广软文什么意思范例
  • 域名注册空间网站代理推广
  • 做网站推广的难点站长之家seo一点询
  • 高职教育双高建设网站百度一下官方网址