Advertisement
Garey

Win32_Test1

Feb 20th, 2019
696
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.84 KB | None | 0 0
  1. // WindowsProject3.cpp : Defines the entry point for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "WindowsProject3.h"
  6.  
  7. #define MAX_LOADSTRING 100
  8.  
  9. // Global Variables:
  10. HINSTANCE hInst;                                // current instance
  11. WCHAR szTitle[MAX_LOADSTRING];                  // The title bar text
  12. WCHAR szWindowClass[MAX_LOADSTRING];            // the main window class name
  13.  
  14. // Forward declarations of functions included in this code module:
  15. ATOM                MyRegisterClass(HINSTANCE hInstance);
  16. BOOL                InitInstance(HINSTANCE, int);
  17. LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
  18. INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
  19. INT_PTR CALLBACK    Calc(HWND, UINT, WPARAM, LPARAM);
  20.  
  21. int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
  22.     _In_opt_ HINSTANCE hPrevInstance,
  23.     _In_ LPWSTR    lpCmdLine,
  24.     _In_ int       nCmdShow)
  25. {
  26.     UNREFERENCED_PARAMETER(hPrevInstance);
  27.     UNREFERENCED_PARAMETER(lpCmdLine);
  28.  
  29.     // TODO: Place code here.
  30.  
  31.     // Initialize global strings
  32.     LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
  33.     LoadStringW(hInstance, IDC_WINDOWSPROJECT3, szWindowClass, MAX_LOADSTRING);
  34.     MyRegisterClass(hInstance);
  35.  
  36.     // Perform application initialization:
  37.     if (!InitInstance(hInstance, nCmdShow))
  38.     {
  39.         return FALSE;
  40.     }
  41.  
  42.     HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINDOWSPROJECT3));
  43.  
  44.     MSG msg;
  45.  
  46.     // Main message loop:
  47.     while (GetMessage(&msg, nullptr, 0, 0))
  48.     {
  49.         if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
  50.         {
  51.             TranslateMessage(&msg);
  52.             DispatchMessage(&msg);
  53.         }
  54.     }
  55.  
  56.     return (int)msg.wParam;
  57. }
  58.  
  59.  
  60.  
  61. //
  62. //  FUNCTION: MyRegisterClass()
  63. //
  64. //  PURPOSE: Registers the window class.
  65. //
  66. ATOM MyRegisterClass(HINSTANCE hInstance)
  67. {
  68.     WNDCLASSEXW wcex;
  69.  
  70.     wcex.cbSize = sizeof(WNDCLASSEX);
  71.  
  72.     wcex.style = CS_HREDRAW | CS_VREDRAW;
  73.     wcex.lpfnWndProc = WndProc;
  74.     wcex.cbClsExtra = 0;
  75.     wcex.cbWndExtra = 0;
  76.     wcex.hInstance = hInstance;
  77.     wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINDOWSPROJECT3));
  78.     wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
  79.     wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
  80.     wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_WINDOWSPROJECT3);
  81.     wcex.lpszClassName = szWindowClass;
  82.     wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
  83.  
  84.     return RegisterClassExW(&wcex);
  85. }
  86.  
  87. //
  88. //   FUNCTION: InitInstance(HINSTANCE, int)
  89. //
  90. //   PURPOSE: Saves instance handle and creates main window
  91. //
  92. //   COMMENTS:
  93. //
  94. //        In this function, we save the instance handle in a global variable and
  95. //        create and display the main program window.
  96. //
  97. BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
  98. {
  99.     hInst = hInstance; // Store instance handle in our global variable
  100.  
  101.     HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
  102.         CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
  103.  
  104.     if (!hWnd)
  105.     {
  106.         return FALSE;
  107.     }
  108.  
  109.     ShowWindow(hWnd, nCmdShow);
  110.     UpdateWindow(hWnd);
  111.  
  112.     return TRUE;
  113. }
  114.  
  115. //
  116. //  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
  117. //
  118. //  PURPOSE: Processes messages for the main window.
  119. //
  120. //  WM_COMMAND  - process the application menu
  121. //  WM_PAINT    - Paint the main window
  122. //  WM_DESTROY  - post a quit message and return
  123. //
  124. //
  125. LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  126. {
  127.     HMENU hRightMenu;
  128.     hRightMenu = CreatePopupMenu();
  129.  
  130.     switch (message)
  131.     {
  132.  
  133.     case WM_COMMAND:
  134.     {
  135.         int wmId = LOWORD(wParam);
  136.         // Parse the menu selections:
  137.         switch (wmId)
  138.         {
  139.         case IDM_ABOUT:
  140.             DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
  141.             break;
  142.  
  143.         case IDM_EXIT:
  144.             DestroyWindow(hWnd);
  145.             break;
  146.  
  147.             /* Roles Sub-menu Events Handling */
  148.         case ID_ROLES_USER: {
  149.             auto status_user = GetMenuState(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND) & MF_CHECKED;
  150.             auto status_admin = GetMenuState(GetMenu(hWnd), ID_ROLES_ADMIN, MF_BYCOMMAND) & MF_CHECKED;
  151.  
  152.             /*! Get the sub-menu */
  153.             hRightMenu = GetSubMenu(hRightMenu, 0);
  154.  
  155.             if (status_user) {
  156.                 /*! Gray-out the Update & Calc items in Actions */
  157.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_UPDATE, FALSE);
  158.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_CALC, FALSE);
  159.  
  160.                 /*! Check button */
  161.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_ADMIN, MF_BYCOMMAND | (status_admin ? MF_UNCHECKED : MF_CHECKED));
  162.                 CheckMenuItem(hRightMenu, 1, MF_BYPOSITION | (status_admin ? MF_UNCHECKED : MF_CHECKED));
  163.  
  164.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND | MF_UNCHECKED);
  165.                 CheckMenuItem(hRightMenu, 0, MF_BYPOSITION | MF_UNCHECKED);
  166.             }
  167.             else {
  168.                 /*! Enable the Update & Calc items in Actions */
  169.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_UPDATE, TRUE);
  170.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_CALC, TRUE);
  171.  
  172.                 /*! Check button */
  173.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_ADMIN, MF_BYCOMMAND | MF_UNCHECKED);
  174.                 CheckMenuItem(hRightMenu, 1, MF_BYPOSITION | MF_UNCHECKED);
  175.  
  176.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND | MF_CHECKED);
  177.                 CheckMenuItem(hRightMenu, 0, MF_BYPOSITION | MF_CHECKED);
  178.             }
  179.             break;
  180.         }
  181.  
  182.         case ID_ROLES_ADMIN: {
  183.  
  184.             /*! Get Menu Items' States */
  185.             auto status_user = GetMenuState(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND) & MF_CHECKED;
  186.             auto status_admin = GetMenuState(GetMenu(hWnd), ID_ROLES_ADMIN, MF_BYCOMMAND) & MF_CHECKED;
  187.  
  188.             if (status_admin) {
  189.                 /*! Enable the Update & Calc items in Actions */
  190.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_UPDATE, TRUE);
  191.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_CALC, TRUE);
  192.  
  193.                 /*! Check button */
  194.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND | (status_user ? MF_UNCHECKED : MF_CHECKED));
  195.                 CheckMenuItem(hRightMenu, 0, MF_BYPOSITION | (status_user ? MF_UNCHECKED : MF_CHECKED));
  196.  
  197.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_ADMIN, MF_BYCOMMAND | MF_UNCHECKED);
  198.                 CheckMenuItem(hRightMenu, ID_ROLES_ADMIN, MF_BYPOSITION | MF_UNCHECKED);
  199.             }
  200.             else {
  201.                 /*! Gray-out the Update & Calc items in Actions */
  202.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_UPDATE, FALSE);
  203.                 EnableMenuItem(GetMenu(hWnd), ID_ACTION_CALC, FALSE);
  204.  
  205.                 /*! Check button */
  206.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND | MF_UNCHECKED);
  207.                 CheckMenuItem(hRightMenu, ID_ROLES_USER, MF_BYPOSITION | MF_UNCHECKED);
  208.  
  209.                 /*! With Right Click Menu */
  210.                 CheckMenuItem(GetMenu(hWnd), ID_ROLES_ADMIN, MF_BYCOMMAND | MF_CHECKED);
  211.                 CheckMenuItem(hRightMenu, ID_ROLES_ADMIN, MF_BYPOSITION | MF_CHECKED);
  212.             }
  213.  
  214.             break;
  215.         }
  216.  
  217.                              /*! Adding new role, named 'Special Role' */
  218.         case ID_ROLES_NEW:
  219.         {
  220.             auto hMainMenu = GetMenu(hWnd);
  221.  
  222.             if (GetMenuState(hMainMenu, ID_ROLES_SPECIAL, MF_BYCOMMAND) == -1) {
  223.                 MENUITEMINFO mii;
  224.                 ZeroMemory(&mii, sizeof(MENUITEMINFO));
  225.  
  226.                 mii.cbSize = sizeof(MENUITEMINFO);
  227.                 mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
  228.                 mii.fState = MFS_ENABLED;
  229.                 mii.fType = MFT_STRING;
  230.                 mii.wID = ID_ROLES_SPECIAL;
  231.                 mii.dwTypeData = const_cast<LPWSTR>(L"Special Role");
  232.  
  233.                 auto mHandler = MessageBoxW(hWnd, L"Are you sure?", L"WARNING", MB_YESNO | MB_ICONWARNING);
  234.  
  235.                 if (mHandler == IDYES) {
  236.                     MessageBoxW(hWnd, L"The 'Special Role' has been created successfully!!", L"INFORMATION", MB_OK | MB_ICONINFORMATION);
  237.                     InsertMenuItem(hMainMenu, ID_ROLES_USER + 1, FALSE, &mii);
  238.                 }
  239.                 else
  240.                     MessageBoxW(hWnd, L"Unexpected error occurred!\nThe role has not been added!", L"ERROR", MB_OK | MB_ICONERROR);
  241.             }
  242.             else {
  243.                 MessageBoxW(hWnd, L"The 'Special Role' was already created!", L"ERROR", MB_OK | MB_ICONERROR);
  244.             }
  245.  
  246.             break;
  247.         }
  248.  
  249.         /*! Deleting the 'Old Role' menu item*/
  250.         case ID_ROLES_DELETE: {
  251.             if (DeleteMenu(GetMenu(hWnd), ID_ROLES_OLDROLE, MF_BYCOMMAND))
  252.                 MessageBoxW(hWnd, L"Successfully deleted 'Old Role' !", L"INFORMATION", MB_OK | MB_ICONINFORMATION);
  253.             else
  254.                 MessageBoxW(hWnd, L"The role has already been deleted!", L"ERROR", MB_OK | MB_ICONERROR);
  255.  
  256.             break;
  257.         }
  258.  
  259.                               /*! Right-click Menu Events Handling */
  260.         case ID_POPUP_END: {
  261.             MessageBoxW(hWnd, L"Goodbye!", L"Goodbye!", MB_OK | MB_ICONINFORMATION);
  262.             SendMessage(hWnd, WM_CLOSE, wParam, lParam);
  263.  
  264.             break;
  265.         }
  266.  
  267.                            /*! Accelerator Handling*/
  268.         case IDM_HOTKEY: {
  269.             auto status_user = GetMenuState(GetMenu(hWnd), ID_ROLES_USER, MF_BYCOMMAND) & MF_CHECKED;
  270.  
  271.             if (!status_user)
  272.                 DialogBox(hInst, MAKEINTRESOURCE(IDD_CALC), hWnd, Calc);
  273.             else
  274.                 MessageBoxW(hWnd, L"You have no permissions to open this dialog!", L"WARNING", MB_OK | MB_ICONWARNING);
  275.             break;
  276.         }
  277.  
  278.                          /*! Actions Menu Handling */
  279.         case ID_ACTION_UPDATE:
  280.             MessageBoxW(hWnd, L"You pressed the update menu item!", L"INFORMATION", MB_OK | MB_ICONINFORMATION);
  281.             break;
  282.  
  283.         case ID_ACTION_SEARCH:
  284.             MessageBoxW(hWnd, L"You pressed the search menu item!", L"INFORMATION", MB_OK | MB_ICONINFORMATION);
  285.             break;
  286.  
  287.         case ID_ACTION_CALC:
  288.             DialogBox(hInst, MAKEINTRESOURCE(IDD_CALC), hWnd, Calc);
  289.             break;
  290.  
  291.  
  292.  
  293.             /*! If none of the above is met */
  294.         default:
  295.             return DefWindowProc(hWnd, message, wParam, lParam);
  296.         }
  297.     }
  298.     break;
  299.  
  300.     case WM_RBUTTONUP: {
  301.  
  302.         POINT cPoint;
  303.  
  304.         cPoint.x = LOWORD(lParam);
  305.         cPoint.y = HIWORD(lParam);
  306.  
  307.         ClientToScreen(hWnd, &cPoint);
  308.  
  309.         AppendMenuW(hRightMenu, MF_STRING, ID_ROLES_USER, L"&User");
  310.         AppendMenuW(hRightMenu, MF_STRING, ID_ROLES_ADMIN, L"&Admin");
  311.         AppendMenuW(hRightMenu, MF_SEPARATOR, 0, NULL);
  312.         AppendMenuW(hRightMenu, MF_STRING, ID_POPUP_END, L"&End");
  313.  
  314.         TrackPopupMenu(hRightMenu, TPM_RIGHTBUTTON, cPoint.x, cPoint.y, 0, hWnd, NULL);
  315.  
  316.         break;
  317.     }
  318.  
  319.     case WM_DESTROY:
  320.         DestroyMenu(hRightMenu);
  321.         PostQuitMessage(0);
  322.         break;
  323.  
  324.     default:
  325.         DestroyMenu(hRightMenu);
  326.         return DefWindowProc(hWnd, message, wParam, lParam);
  327.     }
  328.     return 0;
  329. }
  330.  
  331. // Message handler for about box.
  332. INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  333. {
  334.     UNREFERENCED_PARAMETER(lParam);
  335.     switch (message)
  336.     {
  337.     case WM_INITDIALOG:
  338.         return (INT_PTR)TRUE;
  339.  
  340.     case WM_COMMAND:
  341.         if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
  342.         {
  343.             EndDialog(hDlg, LOWORD(wParam));
  344.             return (INT_PTR)TRUE;
  345.         }
  346.         break;
  347.     }
  348.     return (INT_PTR)FALSE;
  349. }
  350.  
  351. // Message handler for calc box.
  352. INT_PTR CALLBACK Calc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  353. {
  354.     UNREFERENCED_PARAMETER(lParam);
  355.     switch (message)
  356.     {
  357.     case WM_INITDIALOG:
  358.         return (INT_PTR)TRUE;
  359.  
  360.     case WM_COMMAND:
  361.     {
  362.         auto wmId = LOWORD(wParam);
  363.  
  364.         switch (wmId) {
  365.         case IDB_CALC_FLOAT: {
  366.             std::string value1, value2, value3;
  367.  
  368.             auto hEdit1 = GetDlgItem(hDlg, IDC_EDIT1);
  369.             auto hEdit2 = GetDlgItem(hDlg, IDC_EDIT2);
  370.             auto hEdit3 = GetDlgItem(hDlg, IDC_EDIT3);
  371.  
  372.             value1.resize(GetWindowTextLength(hEdit1) + 1, '\0');
  373.             value2.resize(GetWindowTextLength(hEdit2) + 1, '\0');
  374.             value3.resize(GetWindowTextLength(hEdit3) + 1, '\0');
  375.  
  376.             GetWindowTextA(hEdit1, (LPSTR)value1.c_str(), GetWindowTextLength(hEdit1) + 1);
  377.             GetWindowTextA(hEdit2, (LPSTR)value2.c_str(), GetWindowTextLength(hEdit2) + 1);
  378.             GetWindowTextA(hEdit3, (LPSTR)value3.c_str(), GetWindowTextLength(hEdit3) + 1);
  379.  
  380.             auto fVal1 = atof(value1.c_str());
  381.             auto fVal2 = atof(value2.c_str());
  382.             auto fVal3 = atof(value3.c_str());
  383.  
  384.             if (IsDlgButtonChecked(hDlg, IDC_RADIO1) == BST_CHECKED) {
  385.  
  386.                 /*! Calculate the result */
  387.                 auto temp = fVal1 + fVal2 + fVal3;
  388.  
  389.                 /*! Set the result to the result edit control */
  390.                 SetDlgItemText(hDlg, IDC_RESULT1, std::to_wstring(temp).c_str());
  391.  
  392.                 /*! Check if radio button2 is checked */
  393.             }
  394.             else if (IsDlgButtonChecked(hDlg, IDC_RADIO2) == BST_CHECKED) {
  395.  
  396.                 /*! Check if the first and the second values are different than zero */
  397.                 if ((fVal1 != 0 && fVal2 != 0)) {
  398.  
  399.                     /*! Check if the third value is different than zero */
  400.                     if (fVal3 != 0) {
  401.  
  402.                         /*! Calculate the result */
  403.                         auto temp = ((fVal1 * fVal1) + (fVal2 * fVal2)) / fVal3;
  404.  
  405.                         /*! Set the result to the result edit control */
  406.                         SetDlgItemText(hDlg, IDC_RESULT1, std::to_wstring(temp).c_str());
  407.                     }
  408.                     else {
  409.                         MessageBoxW(hDlg, L"The divisor is 0", L"WARNING", MB_OK | MB_ICONWARNING);
  410.                     }
  411.                 }
  412.                 else {
  413.                     MessageBoxW(hDlg, L"Both of the numbers are 0", L"WARNING", MB_OK | MB_ICONWARNING);
  414.                 }
  415.             }
  416.             else {
  417.                 MessageBoxW(hDlg, L"Please check one of the radio buttons!", L"WARNING", MB_OK | MB_ICONWARNING);
  418.             }
  419.  
  420.             break;
  421.         }
  422.  
  423.         case IDB_CALC: {
  424.  
  425.             /*! Get status checks about checkboxes */
  426.             auto status_check1 = SendDlgItemMessage(hDlg, IDC_CHECK1, BM_GETCHECK, 0, 0);
  427.             auto status_check2 = SendDlgItemMessage(hDlg, IDC_CHECK2, BM_GETCHECK, 0, 0);
  428.             auto status_check3 = SendDlgItemMessage(hDlg, IDC_CHECK3, BM_GETCHECK, 0, 0);
  429.  
  430.             /*! Get Values */
  431.             auto value1 = status_check1 ? GetDlgItemInt(hDlg, IDC_EDIT5, NULL, TRUE) : 1;
  432.             auto value2 = status_check2 ? GetDlgItemInt(hDlg, IDC_EDIT6, NULL, TRUE) : 1;
  433.             auto value3 = status_check3 ? GetDlgItemInt(hDlg, IDC_EDIT7, NULL, TRUE) : 1;
  434.  
  435.             SetDlgItemInt(hDlg, IDC_RESULT2, (2 * value1 - value2) * value3, TRUE);
  436.  
  437.             break;
  438.         }
  439.         }
  440.  
  441.         break;
  442.     }
  443.  
  444.     case WM_CLOSE:
  445.  
  446.         EndDialog(hDlg, 0);
  447.         break;
  448.     }
  449.     return (INT_PTR)FALSE;
  450. }
  451.  
  452. -----------------
  453. // Microsoft Visual C++ generated resource script.
  454. //
  455. #include "resource.h"
  456.  
  457. #define APSTUDIO_READONLY_SYMBOLS
  458. /////////////////////////////////////////////////////////////////////////////
  459. //
  460. // Generated from the TEXTINCLUDE 2 resource.
  461. //
  462. #ifndef APSTUDIO_INVOKED
  463. #include "targetver.h"
  464. #endif
  465. #define APSTUDIO_HIDDEN_SYMBOLS
  466. #include "windows.h"
  467. #undef APSTUDIO_HIDDEN_SYMBOLS
  468.  
  469. /////////////////////////////////////////////////////////////////////////////
  470. #undef APSTUDIO_READONLY_SYMBOLS
  471.  
  472. /////////////////////////////////////////////////////////////////////////////
  473. // Bulgarian (Bulgaria) resources
  474.  
  475. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_BGR)
  476. LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
  477.  
  478. /////////////////////////////////////////////////////////////////////////////
  479. //
  480. // Dialog
  481. //
  482.  
  483. IDD_CALC DIALOGEX 0, 0, 309, 194
  484. STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
  485. CAPTION "Calculator"
  486. FONT 8, "MS Shell Dlg", 400, 0, 0x1
  487. BEGIN
  488.     DEFPUSHBUTTON   "Calculate Float",IDB_CALC_FLOAT,102,66,68,14
  489.     EDITTEXT        IDC_EDIT1,24,30,40,14,ES_AUTOHSCROLL | ES_NUMBER
  490.     EDITTEXT        IDC_EDIT2,78,30,40,14,ES_AUTOHSCROLL | ES_NUMBER
  491.     EDITTEXT        IDC_EDIT3,132,30,40,14,ES_AUTOHSCROLL | ES_NUMBER
  492.     EDITTEXT        IDC_RESULT1,48,66,40,14,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER
  493.     CONTROL         "a + b + c",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,234,30,46,10
  494.     CONTROL         "a^2 + b^2 / c",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,234,42,62,10
  495.     LTEXT           "________________________________________________________________________________________________",IDC_STATIC,7,90,295,8
  496.     EDITTEXT        IDC_EDIT5,60,108,40,14,ES_AUTOHSCROLL | ES_NUMBER
  497.     EDITTEXT        IDC_EDIT6,60,132,40,14,ES_AUTOHSCROLL | ES_NUMBER
  498.     EDITTEXT        IDC_EDIT7,60,156,40,14,ES_AUTOHSCROLL | ES_NUMBER
  499.     EDITTEXT        IDC_RESULT2,186,132,70,14,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER
  500.     CONTROL         "M",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,30,108,21,16,WS_EX_RIGHT
  501.     CONTROL         "N",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,30,132,21,16,WS_EX_RIGHT
  502.     CONTROL         "P",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,30,156,21,16,WS_EX_RIGHT
  503.     DEFPUSHBUTTON   "Calculate Integer",IDB_CALC,186,156,72,14
  504.     LTEXT           "(2 * M - N) * P",IDC_STATIC,197,120,66,12
  505. END
  506.  
  507.  
  508. /////////////////////////////////////////////////////////////////////////////
  509. //
  510. // DESIGNINFO
  511. //
  512.  
  513. #ifdef APSTUDIO_INVOKED
  514. GUIDELINES DESIGNINFO
  515. BEGIN
  516.     IDD_CALC, DIALOG
  517.     BEGIN
  518.         LEFTMARGIN, 7
  519.         RIGHTMARGIN, 302
  520.         TOPMARGIN, 7
  521.         BOTTOMMARGIN, 187
  522.     END
  523. END
  524. #endif    // APSTUDIO_INVOKED
  525.  
  526. #endif    // Bulgarian (Bulgaria) resources
  527. /////////////////////////////////////////////////////////////////////////////
  528.  
  529.  
  530. /////////////////////////////////////////////////////////////////////////////
  531. // English (United States) resources
  532.  
  533. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  534. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  535.  
  536. /////////////////////////////////////////////////////////////////////////////
  537. //
  538. // Dialog
  539. //
  540.  
  541. IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62
  542. STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
  543. CAPTION "About WindowsProject3"
  544. FONT 8, "MS Shell Dlg", 0, 0, 0x1
  545. BEGIN
  546.     ICON            IDR_MAINFRAME,IDC_STATIC,14,14,21,20
  547.     LTEXT           "WindowsProject3, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
  548.     LTEXT           "Copyright (c) 2019",IDC_STATIC,42,26,114,8
  549.     DEFPUSHBUTTON   "OK",IDOK,113,41,50,14,WS_GROUP
  550. END
  551.  
  552.  
  553. /////////////////////////////////////////////////////////////////////////////
  554. //
  555. // DESIGNINFO
  556. //
  557.  
  558. #ifdef APSTUDIO_INVOKED
  559. GUIDELINES DESIGNINFO
  560. BEGIN
  561.     IDD_ABOUTBOX, DIALOG
  562.     BEGIN
  563.         LEFTMARGIN, 7
  564.         RIGHTMARGIN, 163
  565.         TOPMARGIN, 7
  566.         BOTTOMMARGIN, 55
  567.     END
  568. END
  569. #endif    // APSTUDIO_INVOKED
  570.  
  571.  
  572. /////////////////////////////////////////////////////////////////////////////
  573. //
  574. // Accelerator
  575. //
  576.  
  577. IDC_WINDOWSPROJECT3 ACCELERATORS
  578. BEGIN
  579.     VK_OEM_2,       IDM_ABOUT,              VIRTKEY, ALT, NOINVERT
  580.     "?",            IDM_ABOUT,              ASCII,  ALT, NOINVERT
  581.     "C",            IDM_HOTKEY,             VIRTKEY, CONTROL, NOINVERT
  582. END
  583.  
  584.  
  585. /////////////////////////////////////////////////////////////////////////////
  586. //
  587. // Icon
  588. //
  589.  
  590. // Icon with lowest ID value placed first to ensure application icon
  591. // remains consistent on all systems.
  592. IDI_WINDOWSPROJECT3     ICON                    "WindowsProject3.ico"
  593.  
  594. IDI_SMALL               ICON                    "small.ico"
  595.  
  596.  
  597. /////////////////////////////////////////////////////////////////////////////
  598. //
  599. // Menu
  600. //
  601.  
  602. IDC_WINDOWSPROJECT3 MENU
  603. BEGIN
  604.     POPUP "&File"
  605.     BEGIN
  606.         MENUITEM "E&xit",                       IDM_EXIT
  607.     END
  608.     POPUP "&Roles"
  609.     BEGIN
  610.         MENUITEM "User",                        ID_ROLES_USER, CHECKED
  611.         MENUITEM "Admin",                       ID_ROLES_ADMIN
  612.         MENUITEM SEPARATOR
  613.         MENUITEM "New",                         ID_ROLES_NEW
  614.         MENUITEM "Delete",                      ID_ROLES_DELETE
  615.         MENUITEM "Old Role",                    ID_ROLES_OLDROLE
  616.     END
  617.     POPUP "&Action"
  618.     BEGIN
  619.         MENUITEM "Search",                      ID_ACTION_SEARCH
  620.         MENUITEM "Update",                      ID_ACTION_UPDATE, INACTIVE
  621.         MENUITEM "Calc",                        ID_ACTION_CALC, INACTIVE
  622.     END
  623.     POPUP "&Help"
  624.     BEGIN
  625.         MENUITEM "&About ...",                  IDM_ABOUT
  626.     END
  627. END
  628.  
  629.  
  630. #ifdef APSTUDIO_INVOKED
  631. /////////////////////////////////////////////////////////////////////////////
  632. //
  633. // TEXTINCLUDE
  634. //
  635.  
  636. 1 TEXTINCLUDE
  637. BEGIN
  638.     "resource.h\0"
  639. END
  640.  
  641. 2 TEXTINCLUDE
  642. BEGIN
  643.     "#ifndef APSTUDIO_INVOKED\r\n"
  644.     "#include ""targetver.h""\r\n"
  645.     "#endif\r\n"
  646.     "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
  647.     "#include ""windows.h""\r\n"
  648.     "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
  649.     "\0"
  650. END
  651.  
  652. 3 TEXTINCLUDE
  653. BEGIN
  654.     "\r\n"
  655.     "\0"
  656. END
  657.  
  658. #endif    // APSTUDIO_INVOKED
  659.  
  660.  
  661. /////////////////////////////////////////////////////////////////////////////
  662. //
  663. // String Table
  664. //
  665.  
  666. STRINGTABLE
  667. BEGIN
  668.     IDS_APP_TITLE           "Test 1"
  669.     IDC_WINDOWSPROJECT3     "WINDOWSPROJECT3"
  670. END
  671.  
  672. #endif    // English (United States) resources
  673. /////////////////////////////////////////////////////////////////////////////
  674.  
  675.  
  676.  
  677. #ifndef APSTUDIO_INVOKED
  678. /////////////////////////////////////////////////////////////////////////////
  679. //
  680. // Generated from the TEXTINCLUDE 3 resource.
  681. //
  682.  
  683.  
  684. /////////////////////////////////////////////////////////////////////////////
  685. #endif    // not APSTUDIO_INVOKED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement