最近几天在学MiniGui,最好的学习方法就是实践,先写个练练笔。其实只是一个界面,不知道什么时候才能真正写个完整的程序。初次写GUI程序,感觉写得不好,还请高手来指教。//======================================================================////MiniQQGUIver1.0////作者:YoYoChan////Email:czy1000@126////Blog:hi.baidu/chenzhuoyou////MiniGUI版本:1.3.3////==================================================================//#include<stdio.h>#include<minigui/common.h>#include<minigui/minigui.h>#include<minigui/gdi.h>#include<minigui/windoh>#include<minigui/control.h>#ifndef_LITE_VERSION#include<minigui/dti.c>#endif#defineIDC_BUTTON0100#defineIDC_BUTTON1100+1#defineIDC_BUTTON2100+2#defineIDC_BUTTON3100+3#defineIDC_CHECKBOX0110#defineIDC_CHECKBOX1110+1#defineIDC_CHECKBOX2110+2#defineIDC_TEXT0120#defineIDC_TEXT1120+1#defineIDC_TEXT2120+2#defineIDC_TEXT3120+3#defineIDC_TEXT4120+4#defineIDC_EDIT0130#defineIDC_EDIT1130+1#defineIDC_EDIT2130+2#defineIDC_EDIT3130+3#defineIDC_EDIT4130+4#defineIDC_LISTBOX0140//==========================Dialog代码开始==============================////======================================================================//staticDLGTEMPLATEDlgInitProgress={WS_BORDER|WS_CAPTION,WS_EX_NONE,0,0,320,240,"Thisisadialog!",0,0,3,NULL,0};staticCTRLDATACtrlInitProgress[]={{CTRL_STATIC,WS_VISIBLE|SS_SIMPLE,50,50,250,30,IDC_TEXT4,"欢迎到我的BLOG做客:",0},{CTRL_STATIC,WS_VISIBLE|SS_SIMPLE,50,80,250,30,IDC_TEXT4,"HI.BAIDU/CHENZHUOYOU",0},{CTRL_BUTTON,WS_TABSTOP|WS_VISIBLE|BS_DEFPUSHBUTTON,120,150,80,30,IDOK,"关闭",0}};staticintInitDialogBoxProc(HWNDhDlg,intmessage,WPARAMwParam,LPARAMlParam){switch(message){caseMSG_INITDIALOG:return1;caseMSG_COMMAND:switch(wParam){caseIDOK:EndDialog(hDlg,wParam);break;}return0;caseMSG_CLOSE:EndDial---本文来源于网络,仅供参考,勿照抄,如有侵权请联系删除---og(hDlg,wParam);return0;}returnDefaultDialogProc(hDlg,message,wParam,lParam);}staticintInitDialogBox(HWNDhWnd){DlgInitProgress.controls=CtrlInitProgress;DialogBoxIndirectParam(DlgInitProgress,hWnd,InitDialogBoxProc,0L);}//=======================Dialog代码结束=================================////========================Login代码开始=================================////======================================================================//intMiniGUIMain(intargc,constchar*argv[]){staticintLoginWinProc();MSGMsg;HWNDhMainWnd;MAINWINCREATECreateInfo;#ifdef_LITE_VERSIONSetDesktopRect(0,0,800,600);#endifchar*p="这是YoYo的第一个MiniGUI程序!";CreateInfo.dwStyle=WS_VISIBLE|WS_BORDER|WS_CAPTION;CreateInfo.dwExStyle=WS_EX_NONE;CreateInfo.spCaption="MiniQQver0.1Author:YoYoChan";CreateInfo.hMenu=0;CreateInfo.hCursor=GetSystemCursor(0);CreateInfo.hIcon=0;CreateInfo.MainWindowProc=LoginWinProc;CreateInfo.lx=0;CreateInfo.ty=0;CreateInfo.rx=320;CreateInfo.by=240;CreateInfo.iBkColor=COLOR_lightwhite;CreateInfo.dwAddData=p;CreateInfo.hHosting=HWND_DESKTOP;hMainWnd=CreateMainWindow(CreateInfo);if(hMainWnd==HWND_INVALID)return-1;ShowWindow(hMainWnd,SW_SHOWNORMAL);while(GetMessage(Msg,hMainWnd)){TranslateMessage(Msg);DispatchMessage(Msg);}MainWindowThreadCleanup(hMainWnd);printf("TheMainWinhasbeenclose!\n");return0;}staticintLoginWinProc(HWNDhWnd,intmessage,WPARAMwParam,LPARAMlParam){staticintQQWin();char*str1=(char*)GetWindowAdditionalData(hWnd);switch(message){caseMSG_CREATE:CreateWindow(CTRL...