C Language Program

Source: Internet
Author: User
# Include "stdafx. H "# include <windows. h> # include <windowsx. h> # include "resource. H "# include" maindlg. H "# include <stdlib. h> bool winapi main_proc (hwnd, uint umsg, wparam, lparam) {Switch (umsg) {handle_msg (hwnd, handler, timeout); handle_msg (hwnd, wm_command, main_oncommand); handle_msg (hwnd, wm_close, main_onclose);} return false;} bool main_oninitdialog (hwnd, hwn D hwndfocus, lparam) {return true;} void main_oncommand (hwnd, int ID, hwnd hwndctl, uint codenotasks) {If (idc_close = ID) {main_onclose (hwnd);} If (idc_button1 = ID) {tchar N1 [64]; getwindowtext (getdlgitem (hwnd, idc_edit1), N1, sizeof (N1 )); if (0 = strlen (N1) // whether addend 1 is null {MessageBox (hwnd, text ("addend 1 cannot be blank, please enter it again! "), Text (" warning "), mb_ OK); return;}/* MessageBox (hwnd, N1, text (" 1111 "), mb_ OK ); */tchar N2 [64]; getwindowtext (getdlgitem (hwnd, idc_edit2), N2, sizeof (N2); If (0 = strlen (N2 )) // whether addend 1 is null {MessageBox (hwnd, text ("addend 2 cannot be blank. Please enter it again! "), Text (" warning "), mb_ OK); return;} int d1 = atoi (N1); int D2 = atoi (N2); int ret = D1 + D2; tchar J [128]; wsprintf (J, "% I", RET); setwindowtext (getdlgitem (hwnd, idc_edit3), J);} void main_onclose (hwnd) {enddialog (hwnd, 0 );}

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.