Recent evilC LanguageAnd then click the MiniGUI source code.
# Include <stdio. h> <br/> # include <stdlib. h> </P> <p> # include <MiniGUI/Common. h> <br/> # include <MiniGUI/MiniGUI. h> <br/> # include <MiniGUI/GDI. h> <br/> # include <MiniGUI/window. h> <br/> # include <MiniGUI/control. h> </P> <p> static dlgtemplate dlginput = <br/> {<br/> ws_border | ws_caption, <br/> ws_ex_none, <br/> 120,150,300,100, <br/> "input Chinese Character Test", <br/> 0, 0, <br/> 4, null, <br/> 0 <br/> }; </P> <p> # define idc_input 100 </P> <p> static ctrldata ctrlinput [] = <br/>{< br/> ctrl_sledit, <br/> ws_visible | ws_tabstop | ws_border, <br/> 50, 20,200, 34, <br/> idc_input, <br/> null, <br/> 0 <br/>}< br/>}; </P> <p> static int inputdlgproc (hwnd hdlg, int message, wparam, lparam) <br/>{< br/> switch (Message) {<br/> case msg_initdialog: <br/> gbimew.wex (hdlg, false ); <br/> break; <br/>}</P> <p> return defaultdialogproc (hdlg, message, wparam, lparam ); <br/>}</P> <p> int miniguimain (INT argc, const char * argv []) <br/>{< br/> # ifdef _ lite_version <br/> setinclutoprect (0, 0, 1024,768 ); </P> <p> # endif </P> <p> dlginput. controls = ctrlinput; <br/> dialogboxindirectparam (& dlginput, hwnd_desktop, inputdlgproc, 0l); <br/> return 0; <br/>}</P> <p> # ifndef _ lite_version <br/> # include <MiniGUI/Mhd. c> <br/> # endif <br/>
Then you can look at the redCodeIt's a bit silly. For example, after half a day, the initialization of the struct is more or less incorrect.
It turns out to be the initialization code of the struct array, except that there is only one array, which makes it easier to add controls later. Remember this. Do not forget.