Азбука программирования в Win32 API


Азбука программирования в Win32 API - стр. 94


(WPARAM) 0, (LPARAM) cMyMessage); i = LOWORD(wParam) - 208; uCheckBoxesState[i] = uCheckBoxesState[i] == MF_CHECKED ?

MF_UNCHECKED : MF_CHECKED;

CheckMenuItem(GetSubMenu(GetSubMenu(GetMenu(hWnd), 1), 1), LOWORD(wParam) - 103. uCheckBoxesState[i]); return FALSE; caseIDC_BUTTONl:

SendDlgItemMessage(hDlg,roC_STATUSBAR,SB_SETTEXT, (WPARAM) 0,

(LPARAM) "Message from PushButton"); return TRUE; case IDCJ3UTTON2: // Save the state of RadioButtons

i = IDC_RADIOBUTTON 1; while(!SendDlgItemMessage(hDlg, i, BM_GETCHECK, 0, ()))

nRadioButtonld = i; // Save the state of CheckButtons

for(i = RXJCHECKBOX1; i <= IDC_CHECKBOX3; i++) uCheckBoxesState[i - 208] = SendDlgltemMessagefhDlg, i, BM_GETCHECK, 0, 0) = 0 ? MF_UNCHECKED : MF_CHECKED; EndDialog(hDlg,0); return TRUE;

i /

break; return FALSE;

При линковании программы необходимо использовать фага ресурсов:

#include "buttons.h"

ButtonsExample DIALOG 50, 50, 154, 108

110

STYLE DS_MODALFRAME | DSJDLOOK | DS_CONTEXTHELP |

WS_POPUP | WS_VISIBLE | CAPTION "Buttons Example" FONT 8, "MS Sans Serif

WS CAPTION  WS SYSMENU

CONTROL "PushButton", IDC_BUTTONl. "button", BS_PUSHBUTTON |

BS_CENTER | BS_NOTIFY | WS_CHILD | WSJVISIBLE |

WS_TABSTOP, 8, 72, 64, 16 CONTROL "RadioButtonl", IDC_RADIOBUTTON 1, "button",

BS_AUTORADIOBUTTON | WS „CHILD | WS_VISIBLE |

WSJTABSTOP, 8, 12,64, 16 CONTROL "RadioButton2", IDCJRADIOBUTTON2, "button",

BS_AUTORADIOBUTTON | BS_FLAT | WS_CHILD

WSJVISIBLE | WSJTABSTOP, 8, 28, 64, 16 CONTROL "RadioButton3", IDC__RADIOBUTTON3, "button",

BS_AUTORADIOBUTTON | BS_LEFTTEXT | WS_CHILD |

WSJVISIBLE I WSJTABSTOP, 8, 44, 64, 16 CONTROL "Groupl", IDCJ3ROUPBOX1, "button", BS_GROUPBOX |

WS^CHILD | WSJVISIBLE | WS_GROUP, 4, 4, 72, 60 CONTROL "CheckBoxl", IDC_CHECKBOX1, "button", BS_AUTOCHECKBOX |

WS^CHILD | WS_VISIBLE | WS_TABSTOP, 82, 12, 64, 16 CONTROL "CheckBox2", IDC_CHECKBOX2, "button", BS_AUTOCHECKBOX |




Начало  Назад  Вперед



Книжный магазин