minigui程序
这是一段minigui程序#include<minigui/common.h>#include<minigui/minigui.h>#include<minigui/gd...
这是一段minigui程序#include<minigui/common.h>
#include<minigui/minigui.h>
#include<minigui/gdi.h>
#include<minigui/window.h>
#include<minigui/control.h>
HWND hMainWnd;
static WinProc(HWND hWnd,int message,WPARAM wParam,LPARAM lParam)
{HDC hdc;
static char disp_buf[50];
static int no=0;
switch(message)
{case MSG_PAINT:
hdc=BeginPaint(hWnd);
no++;
sprintf(disp_buf,"MSG_PAINT 消息次数:%",no);
TextOut(hdc,10,100,disp_buf);
EndPaint(hWnd,hdc);
break;
case MSG_LBUTTONDOWN:
Invalidate(hWnd,NULL,TRUE);
break;
case MSG_CLOSE:
DestroyMainWindow(hWnd);
break;
default:
return(defaultMainWinProc(hWnd,message,wParam,lParam));
}
return(0);
}
int InitMainWindow(void)
{MAINWINCREATE window_info;
window_info.dwStyle=WS_VISIBLE|WS_BORDER|WS_CAPTION;
window_info.dwExStyle=WS_EX_NONE;
window_info.hMenu=0;
window_info.hCursor=GetSystemCursor(0);
window_info.hIcon=GetSmallSystemIcon(IDI_APPLICATION);
window_info.MainWindowProc=WinProc;
window_info.lx=0;
window_info.ty=0;
window_info.rx=320;
window_info.by=240;
window_info.iBkColor=COLOR_lightwhite;
window_info.dwAddData=0;
window_info.hHosting=HWND_DESKTOP;
hMainWnd=CreateMainWindow(&window_info);
if(hMainWnd==HWND_INVALID)
return(0);
else return(1);
}
int MiniGUIMain(int argc,const char *argv[])
{MSG Msg;
#ifdef _LITE_VERSION
SetDesktopRect(0,0,800,600);
#endif
InitMainWindow();
ShowWindow(hMainWnd,SW_SHOWNORMAL);
while(GetMessage(&Msg,hMainWnd))
{TranslateMessage(&Msg);
DispatchMessage(&Msg);
MainWindowThreadCleanup(hMainWnd);
return(0);
}
#ifndef _LITE_VERSION
#include<minigui/dti.c>
#endif
gcc编译运行时总是报错错:paint.c:65: 错误:expected declaration or statement at end of input
源程序就是这个样子的 展开
#include<minigui/minigui.h>
#include<minigui/gdi.h>
#include<minigui/window.h>
#include<minigui/control.h>
HWND hMainWnd;
static WinProc(HWND hWnd,int message,WPARAM wParam,LPARAM lParam)
{HDC hdc;
static char disp_buf[50];
static int no=0;
switch(message)
{case MSG_PAINT:
hdc=BeginPaint(hWnd);
no++;
sprintf(disp_buf,"MSG_PAINT 消息次数:%",no);
TextOut(hdc,10,100,disp_buf);
EndPaint(hWnd,hdc);
break;
case MSG_LBUTTONDOWN:
Invalidate(hWnd,NULL,TRUE);
break;
case MSG_CLOSE:
DestroyMainWindow(hWnd);
break;
default:
return(defaultMainWinProc(hWnd,message,wParam,lParam));
}
return(0);
}
int InitMainWindow(void)
{MAINWINCREATE window_info;
window_info.dwStyle=WS_VISIBLE|WS_BORDER|WS_CAPTION;
window_info.dwExStyle=WS_EX_NONE;
window_info.hMenu=0;
window_info.hCursor=GetSystemCursor(0);
window_info.hIcon=GetSmallSystemIcon(IDI_APPLICATION);
window_info.MainWindowProc=WinProc;
window_info.lx=0;
window_info.ty=0;
window_info.rx=320;
window_info.by=240;
window_info.iBkColor=COLOR_lightwhite;
window_info.dwAddData=0;
window_info.hHosting=HWND_DESKTOP;
hMainWnd=CreateMainWindow(&window_info);
if(hMainWnd==HWND_INVALID)
return(0);
else return(1);
}
int MiniGUIMain(int argc,const char *argv[])
{MSG Msg;
#ifdef _LITE_VERSION
SetDesktopRect(0,0,800,600);
#endif
InitMainWindow();
ShowWindow(hMainWnd,SW_SHOWNORMAL);
while(GetMessage(&Msg,hMainWnd))
{TranslateMessage(&Msg);
DispatchMessage(&Msg);
MainWindowThreadCleanup(hMainWnd);
return(0);
}
#ifndef _LITE_VERSION
#include<minigui/dti.c>
#endif
gcc编译运行时总是报错错:paint.c:65: 错误:expected declaration or statement at end of input
源程序就是这个样子的 展开
2个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询