{"id":592,"date":"2008-05-15T12:15:16","date_gmt":"2008-05-15T12:15:16","guid":{"rendered":"http:\/\/6teen.ru\/?p=709"},"modified":"2008-05-15T12:15:16","modified_gmt":"2008-05-15T12:15:16","slug":"367","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=592","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 RadioButton \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 WinAPI"},"content":{"rendered":"<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 RadioButton \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 WinAPI<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 RadioButton \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 WinAPI\n\n\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: http:\/\/decoding.narod.ru\/api\/radiobutton\/radiobutton.html\n\n\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 RadioButton. RadioButton \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c\u044b\u0435 \u0432 \u0433\u0440\u0443\u043f\u043f\u044b. \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435, \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0430. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u043e\u0442 CheckBox?\u043e\u0432 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0449\u0435\u043b\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u0440\u0430\u0434\u0438\u043e-\u043a\u043d\u043e\u043f\u043a\u0435, \u0442\u043e \u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.\n\n\u041a\u043d\u043e\u043f\u043a\u0438 RadioButton \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0432\u0443\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 - BS_AUTORADIOBUTTON \u0438 BS_RADIOBUTTON. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 CheckBox?\u0430\u043c\u0438, \u0441\u0442\u0438\u043b\u044c BS_AUTORADIOBUTTON \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e Windows \u0441\u0430\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 (\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430\/\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430). \u0410 \u0435\u0441\u043b\u0438 \u0443 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441\u0442\u0438\u043b\u044c BS_RADIOBUTTON, \u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442.\n\nconst\nIDRBtn1 = 1;\nIDRBtn2 = 2;\nIDRBtn3 = 3;\n\nvar\nRBtn1: HWND;\nRBtn2: HWND;\nRBtn3: HWND;\nStatic1: HWND;\nStatic2: HWND;\nStatic3: HWND;\n\n\n\n\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0434\u043d\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0440\u0430\u0434\u0438\u043e-\u043a\u043d\u043e\u043f\u043e\u043a, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c Windows.\n\nRBtn1 := CreateWindowEx( 0, ?Button?, ?\u041e\u043f\u0446\u0438\u044f 1?,\nWS_CHILD or WS_VISIBLE or BS_AUTORADIOBUTTON,\n20, 15, 80, 20, Wnd, IDRBtn1, hInstance, nil );\nSendMessage( RBtn1, WM_SETFONT, GetStockObject( ANSI_VAR_FONT ), 0 );\n\nRBtn2 := CreateWindowEx( 0, ?Button?, ?\u041e\u043f\u0446\u0438\u044f 2?,\nWS_CHILD or WS_VISIBLE or BS_AUTORADIOBUTTON,\n110, 15, 80, 20, Wnd, IDRBtn2, hInstance, nil );\nSendMessage( RBtn2, WM_SETFONT, GetStockObject( ANSI_VAR_FONT ), 0 );\n\nRBtn3 := CreateWindowEx( 0, ?Button?, ?\u041e\u043f\u0446\u0438\u044f 3?,\nWS_CHILD or WS_VISIBLE or BS_AUTORADIOBUTTON,\n200, 15, 80, 20, Wnd, IDRBtn3, hInstance, nil );\nSendMessage( RBtn3, WM_SETFONT, GetStockObject( ANSI_VAR_FONT ), 0 );\n\n\n\n\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0440\u0430\u0434\u0438\u043e-\u043a\u043d\u043e\u043f\u043e\u043a, \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043c\u0435\u0442\u043a\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430.\n\nfunction WindowProc( Wnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM ): LRESULT; stdcall;\nbegin\ncase Msg of\nWM_DESTROY: begin\nPostQuitMessage( 0 );\nResult := 0;\nExit;\nend;\nWM_COMMAND: begin\ncase LoWord( wParam ) of\nIDRBtn1: begin\nSetWindowText( Static1, ?\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nSetWindowText( Static2, ?\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nSetWindowText( Static3, ?\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nend;\nIDRBtn2: begin\nSetWindowText( Static1, ?\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nSetWindowText( Static2, ?\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nSetWindowText( Static3, ?\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nend;\nIDRBtn3: begin\nSetWindowText( Static1, ?\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nSetWindowText( Static2, ?\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nSetWindowText( Static3, ?\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0430? );\nend;\nend;\nend;\nelse\nResult := DefWindowProc( Wnd, Msg, wParam, lParam );\nend;\nend;\n\n\n\n\u0418 \u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435. \u041a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u043e\u0434\u043d\u0430 \u0438\u0437 \u0440\u0430\u0434\u0438\u043e-\u043a\u043d\u043e\u043f\u043e\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0440\u0432\u0430\u044f). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0439 \u043d\u0430\u0434\u043e \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 BM_CLICK.\n\n\/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u043a\u043d\u043e\nShowWindow( Wnd, SW_SHOWNORMAL );\n\nSendMessage( RBtn1, BM_CLICK, 0, 0 );\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 RadioButton \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 WinAPI<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[431,454],"tags":[1930,602,322],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/592"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=592"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/592\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}