这是一个minigui程序,请大家帮帮忙!
#include<minigui/common.h>#include<minigui/minigui.h>#include<minigui/window.h>#inclu...
#include<minigui/common.h>
#include<minigui/minigui.h>
#include<minigui/window.h>
#include<minigui/control.h>
#define IDC_DISP1 1001
HWND hMainWnd;
static DLGTEMPLATE DlgInitProgress=
{
WS_BORDER|WS_CAPTION,
WS_EX_NONE,
100,100,200,130,
"Dlg demo",
0,
0,
3,
NULL,
0
};
/*dingyikongjian*/
static CTRLDATA CtrlInitData[]=
{
{
"static",
WS_VISIBLE|SS_SIMPLE,
50,30,100,16,
IDC_DISP1,
"THIS IS MINIGUI DLG!",
0,
WS_EX_NONE},
{"button",
WS_TABSTOP|WS_VISIBLE|BS_DEFPUSHBUTTON,
40,70,50,25,
IDOK,
"OK",
0,
WS_EX_NONE},
{"button",
WS_TABSTOP|WS_VISIBLE,
110,70,50,25,
IDCANCEL,
"CANCEL",
0,
WS_EX_NONE}};
/*DLGPROCESSFUN*/
static int DialogBoxProc(HWND hdlg,int message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{case MSG_INITDIALOG:
RETURN(1);
case MSG_COMMAND:
switch(wParam){
case IDOK:
case IDCANCEL:
EndDialog(hdlg,wParam);
DestroyAllControls(hdlg);
break;
}
break;}
return(DefaultDialogProc(hdlg,message,wParam,lParam));
}
/*initialdiabox*/
static void InitDialogBox(HWND hWnd)
{DlgInitProgress.controls=CtrlInitData;
DialogBoxIndirectParam(&DlgInitProgress,hWnd,DialogBoxProc,0L);
}
static int WinProc(HWND hWnd,int message,WPARAM wParam,LPARAM lParam)
{HDC hdc ;
switch(message){
case MSG_PAINT:
hdc=BeginPaint(hWnd);
TextOut(hdc,50,100,"this is minigui window!");
EndPaint(hWnd,hdc);
break;
case MSG_CLOSE:
DestroyMainWindow(hWnd);
PostQuitMessage(hWnd);
break;
case MSG_LBUTTONDOWN:
InitDialogBox(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.spCaption="www.ZLGMCU.COM";
window_info.hMenu=0;
window_info.hCursor=GetSystemCursor(0);
window_info.hIcon=0;
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 -o dlgdemo dlgdemo.c -lpthread -lminigui -ljpeg -lpng -lz
dlgdemo.c: 在函数‘InitMainWindow’中:
dlgdemo.c:101: 错误:‘COLOR_lightwhite’未声明(在此函数内第一次使用)
dlgdemo.c:101: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
dlgdemo.c:101: 错误:所在的函数内也只报告一次。)
dlgdemo.c: 在函数‘MiniGUIAppMain’中:
dlgdemo.c:124: 错误:expected declaration or statement at end of input 展开
#include<minigui/minigui.h>
#include<minigui/window.h>
#include<minigui/control.h>
#define IDC_DISP1 1001
HWND hMainWnd;
static DLGTEMPLATE DlgInitProgress=
{
WS_BORDER|WS_CAPTION,
WS_EX_NONE,
100,100,200,130,
"Dlg demo",
0,
0,
3,
NULL,
0
};
/*dingyikongjian*/
static CTRLDATA CtrlInitData[]=
{
{
"static",
WS_VISIBLE|SS_SIMPLE,
50,30,100,16,
IDC_DISP1,
"THIS IS MINIGUI DLG!",
0,
WS_EX_NONE},
{"button",
WS_TABSTOP|WS_VISIBLE|BS_DEFPUSHBUTTON,
40,70,50,25,
IDOK,
"OK",
0,
WS_EX_NONE},
{"button",
WS_TABSTOP|WS_VISIBLE,
110,70,50,25,
IDCANCEL,
"CANCEL",
0,
WS_EX_NONE}};
/*DLGPROCESSFUN*/
static int DialogBoxProc(HWND hdlg,int message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{case MSG_INITDIALOG:
RETURN(1);
case MSG_COMMAND:
switch(wParam){
case IDOK:
case IDCANCEL:
EndDialog(hdlg,wParam);
DestroyAllControls(hdlg);
break;
}
break;}
return(DefaultDialogProc(hdlg,message,wParam,lParam));
}
/*initialdiabox*/
static void InitDialogBox(HWND hWnd)
{DlgInitProgress.controls=CtrlInitData;
DialogBoxIndirectParam(&DlgInitProgress,hWnd,DialogBoxProc,0L);
}
static int WinProc(HWND hWnd,int message,WPARAM wParam,LPARAM lParam)
{HDC hdc ;
switch(message){
case MSG_PAINT:
hdc=BeginPaint(hWnd);
TextOut(hdc,50,100,"this is minigui window!");
EndPaint(hWnd,hdc);
break;
case MSG_CLOSE:
DestroyMainWindow(hWnd);
PostQuitMessage(hWnd);
break;
case MSG_LBUTTONDOWN:
InitDialogBox(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.spCaption="www.ZLGMCU.COM";
window_info.hMenu=0;
window_info.hCursor=GetSystemCursor(0);
window_info.hIcon=0;
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 -o dlgdemo dlgdemo.c -lpthread -lminigui -ljpeg -lpng -lz
dlgdemo.c: 在函数‘InitMainWindow’中:
dlgdemo.c:101: 错误:‘COLOR_lightwhite’未声明(在此函数内第一次使用)
dlgdemo.c:101: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
dlgdemo.c:101: 错误:所在的函数内也只报告一次。)
dlgdemo.c: 在函数‘MiniGUIAppMain’中:
dlgdemo.c:124: 错误:expected declaration or statement at end of input 展开
Storm代理
2023-07-25 广告
2023-07-25 广告
StormProxies是一家提供动态代理服务器服务的企业,旨在帮助用户更好地管理网络访问和安全。以下是一些关于StormProxies的IP动态代理服务的特点:1. 高匿名性:StormProxies的动态代理服务器具有高匿名性,可以有效...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询