My first complete Windows Application

Source: Internet
Author: User

I have been typing a few wrong words for a long time ~~~~~~

# Include <windows. h> <br/> lresult callback wndproc (hwnd, uint, wparam, lparam); <br/> int winapi winmain (hinstance, hinstance hprevinstance, <br/> lpstr lpcmdline, int ncmdshow) <br/>{< br/> hwndhwnd; <br/> msgmsg; <br/> wndclass. style = cs_hredraw | cs_vredraw; <br/> wndclass. lpfnwndproc = wndproc; <br/> wndclass. cbclsextra = 0; <br/> wndclass. cbwndextra = 0; <br/> wndclass. hinstance = 0; <br/> wndclass. hicon = loadicon (null, idi_application); <br/> wndclass. hcursor = loadcursor (null, idc_arrow); <br/> wndclass. hbrbackground = (hbrush) getstockobject (white_brush); <br/> wndclass. lpszmenuname = NULL; <br/> wndclass. lpszclassname = "hellowin"; <br/> If (! Registerclass (& wndclass) <br/>{< br/> MessageBox (null, "window registration failed! "," Hellowin ", 0); <br/> return 0; <br/>}< br/> hwnd = createwindow (" hellowin ", <br/>" Ah! C ++ ", <br/> ws_overlappedwindow, <br/> cw_usedefault, <br/> cw_usedefault, <br/> null, <br/> null, <br/> hinstance, <br/> null); <br/> showwindow (hwnd, ncmdshow ); <br/> updatewindow (hwnd); <br/> while (getmessage (& MSG, null, 0, 0) <br/>{< br/> translatemessage (& MSG ); <br/> dispatchmessage (& MSG); <br/>}< br/> return MSG. wparam; <br/>}</P> <p> lresult callback wndproc (hwnd, u Int message, <br/> wparam, lparam) <br/>{< br/> switch (Message) <br/>{< br/> case wm_create: <br/> return 0; <br/> case wm_lbuttondown: <br/> MessageBox (null, "where is spring? Where is spring ~~~~~ "," My spring is coming ", 0); <br/> return 0; <br/> case wm_destroy: <br/> postquitmessage (0 ); <br/> return 0; <br/>}< br/> return defwindowproc (hwnd, message, wparam, lparam); <br/>}

Continue to fuel

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.