Struct (C language basics)

Source: Internet
Author: User

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.






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.