結構體(c語言基礎)

來源:互聯網
上載者:User

最近在惡不c語言的基礎,就隨意搜了點minigui的源碼,看到這個

 

#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 /> "輸入漢字測試",<br /> 0, 0,<br />4, NULL,<br /> 0<br />};</p><p>#define IDC_INPUT 100</p><p>static CTRLDATA CtrlInput [] =<br />{<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 wParam, LPARAM lParam)<br />{<br />switch (message) {<br />case MSG_INITDIALOG:<br /> GBIMEWindowEx(hDlg,0,0,600,30,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 /> SetDesktopRect(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/dti.c><br />#endif<br />

 

然後就看著紅色的代碼有點犯傻了,像了半天,結構體的初始化,怎麼越看越不對

原來是結構體數組的初始化代碼,只不過是數組只有一項,為了以後增加控制項更方便。遂記於此,勿忘。






聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.