{"id":858,"date":"2009-07-26T09:20:36","date_gmt":"2009-07-26T00:20:36","guid":{"rendered":"https:\/\/www.iss.ai\/?p=858"},"modified":"2009-07-26T09:20:36","modified_gmt":"2009-07-26T00:20:36","slug":"%e7%8c%ab%e3%82%a6%e3%82%a3%e3%83%b3%e3%83%89%e3%82%a6%e3%82%af%e3%83%a9%e3%82%b9%e3%82%92%e4%bd%9c%e3%82%8b4","status":"publish","type":"post","link":"https:\/\/www.iss.ai\/?p=858","title":{"rendered":"\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u30af\u30e9\u30b9\u3092\u4f5c\u308b(4)"},"content":{"rendered":"\t\t\t\t<p>\u25cf\u732b\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3067\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u304c\u51fa\u308b\u3088\u3046\u306b\u3059\u308b<\/p>\n\t\t\t\t<p>\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u552f\u4e00\u63d0\u4f9b\u3059\u308b\uff27\uff35\uff29\u3067\u3042\u308b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u3092\u5b9f\u88c5\u3057\u307e\u3059\uff0e<br \/>\n\t\t\t\t\u305d\u3057\u3066\uff0c\u3053\u306e\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u3092\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\u624b\u6bb5\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\uff0e<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<hr \/>\n\t\t\t\t<p>\u00a0\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u25cf\u30e1\u30cb\u30e5\u30fc\u3092\u4f5c\u308b<\/p>\n\t\t\t\t<p>\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u306f::CreatePopupMenu()\u3067\u4f5c\u308a\uff0c::DestroyMenu()\u3067\u7834\u68c4\u3057\u307e\u3059\uff0e<br \/>\n\t\t\t\tWM_CREATE\u6642\u306b\u30e1\u30cb\u30e5\u30fc\u3092\u4f5c\u6210\u3057\uff0cWM_DESTROY\u6642\u306b\u7834\u68c4\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\uff0e<br \/>\n\t\t\t\tCCatWnd\u306b\uff0c\u4f5c\u3063\u305f\u30e1\u30cb\u30e5\u30fc\u306e\u30cf\u30f3\u30c9\u30eb\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306em_hPopupMenu\u3092\u8ffd\u52a0\u3057\uff0c\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067NULL\u306b\u521d\u671f\u5316\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n\t\t\t\t<pre>\r\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u4f5c\u6210\r\n\/\/\u203bCAT_WND_MENU_ID_EXIT\u306f\u9069\u5f53\u306a\u5024\u306e\u5b9a\u6570\r\nbool CCatWnd::CreateDefaultPopupMenu()\r\n{\r\n if( m_hPopupMenu != NULL )return true;\r\n m_hPopupMenu = ::CreatePopupMenu();\r\n if( m_hPopupMenu == NULL )return false;\r\n\r\n return InsertPopupMenuItem( 0, CAT_WND_MENU_ID_EXIT, std::string(&quot;Exit&quot;) );\r\n}\r\n\r\n\/\/\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u7834\u68c4\r\nbool CCatWnd::DestroyPopupMenu()\r\n{\r\n if( m_hPopupMenu )\r\n {\r\n  if( ::DestroyMenu( m_hPopupMenu ) )\r\n  {\r\n   m_hPopupMenu = NULL;\r\n   return true;\r\n  }\r\n  else\r\n  { return false; }\r\n }\r\n\r\n return true;\r\n}\r\n\r\n\/\/\u30e1\u30cb\u30e5\u30fc\u3078\u306e\u9805\u76ee\u8ffd\u52a0\r\nbool CCatWnd::InsertPopupMenuItem( UINT PosIndex, UINT ItemID, const std::string &amp;rItemString )\r\n{\r\n if( !m_hPopupMenu )return false;\r\n if( rItemString.empty() )return false;\r\n\r\n MENUITEMINFO miinfo = { 0 };\r\n miinfo.cbSize = sizeof( MENUITEMINFO );\r\n miinfo.fMask = MIIM_ID | MIIM_STRING;\r\n miinfo.wID = ItemID;\r\n miinfo.cch = (UINT)( rItemString.length() );\r\n std::vector&lt; char &gt; Data( rItemString.begin(), rItemString.end() ); \/\/\u203bconst\u3067\u306a\u3044\u3082\u306e\u3092\u8981\u6c42\u3055\u308c\u308b\u306e\u3067\u30b3\u30d4\u30fc\u3092\u751f\u6210\u3057\u3066\u5bfe\u5fdc\r\n Data.push_back( '' );\r\n miinfo.dwTypeData = &amp;( Data.at(0) );\r\n\r\n bool ret = ( ::InsertMenuItem( m_hPopupMenu, PosIndex, TRUE, &amp;miinfo ) != 0 );\r\n if( ret )\r\n { ::DrawMenuBar( m_hWnd ); }\r\n return ret;\r\n}\r\n<\/pre>\n\t\t\t\t<p>\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u306e\u9805\u76ee\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7d42\u4e86\u306e\u305f\u3081\u306e&#8221;Exit&#8221;\u306e\u307f\u3067\u3059\u304c\uff0c\u9805\u76ee\u3092\u8ffd\u52a0\u3059\u308bInsertPopupMenuItem()\u3092public\u306b\u3059\u308b\u3053\u3068\u3067\uff0c\u5229\u7528\u5074\u304b\u3089\u306e\u62e1\u5f35\u3092\u53ef\u80fd\u306b\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<hr \/>\n\t\t\t\t<p>\u00a0\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u25cf\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u306e\u8868\u793a\u3068\u51e6\u7406<\/p>\n\t\t\t\t<p>WndProc()\u5185\u3067\uff0c\u732b\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3089\u4f5c\u3063\u3066\u304a\u3044\u305f\u30e1\u30cb\u30e5\u30fc\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\uff0e<br \/>\n\t\t\t\t\uff08\u4e07\u304c\u4e00\u30e1\u30cb\u30e5\u30fc\u4f5c\u6210\u7b49\u306b\u5931\u6557\u3057\u3066\u3044\u305f\u5834\u5408\uff0c\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\u624b\u6bb5\u304c\u7121\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\uff0c\u305d\u306e\u305f\u3081\u306e\u5bfe\u7b56\u3064\u304d\uff09<\/p>\n\t\t\t\t<pre>\r\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ncase WM_RBUTTONUP:\r\n  {\r\n   \/\/\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u8868\u793a\r\n   bool bTrackPopup = false;\r\n   if( m_hPopupMenu )\r\n   {\r\n    \/\/\u5ea7\u6a19\u53d6\u5f97\r\n    int x=0 ,y=0;\r\n    {\r\n     POINT pos;\r\n     pos.x = LOWORD( lParam );\r\n     pos.y = HIWORD( lParam );\r\n     ::ClientToScreen( m_hWnd, &amp;pos );\r\n     x = pos.x;\r\n     y = pos.y;\r\n    }\r\n\r\n    \/\/\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\r\n    bTrackPopup = ( ::TrackPopupMenu( m_hPopupMenu, TPM_LEFTALIGN|TPM_BOTTOMALIGN, x,y, 0, m_hWnd, NULL ) != 0 );\r\n   }\r\n\r\n   \/\/\u30e1\u30cb\u30e5\u30fc\u95a2\u9023\u306b\u5931\u6557\u3057\u3066\u3044\u308b\u3068\u304d\u7528\u306e\u5ff5\u306e\u305f\u3081\u306e\u5bfe\u7b56\r\n   if( !bTrackPopup )\r\n   { DestroyWnd(); }\r\n  }\r\n  break;\r\n<\/pre>\n\t\t\t\t<p>\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u3092\u8868\u793a\u3059\u308b::TrackPopupMenu()\u95a2\u6570\u306f\uff0c\u300c\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u8868\u793a\u4e2d\u306f\u51e6\u7406\u304c\u8fd4\u3063\u3066\u3053\u306a\u3044\u306e\u306b\uff0c\u4ed6\u306e\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u306f\u305d\u306e\u9593\u3082\u52d5\u4f5c\u3057\u3066\u3044\u308b\u300d\u3068\u3044\u3046\u8b0e\u306e\u52d5\u4f5c\u3092\u3057\u3066\u3044\u3066\u4e0d\u5b89\u3092\u3042\u304a\u308a\u307e\u3059\u2026<br \/>\n\t\t\t\t\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u304c\u9078\u629e\u3055\u308c\u308b\u3068WM_COMMAND\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u304f\u308b\u306e\u3067\uff0c\u305d\u3053\u306b\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3059\uff0e<br \/>\n\t\t\t\t\u30e1\u30cb\u30e5\u30fc\u306e\u30a4\u30d9\u30f3\u30c8\u6642\u306b\u306fHIWORD(wParam)\u304c0\u306b\u306a\u308b\u3068\u306e\u3053\u3068\u306a\u306e\u3067\uff0c\u305d\u308c\u3067\u30e1\u30cb\u30e5\u30fc\u306e\u30a4\u30d9\u30f3\u30c8\u3067\u3042\u308b\u3053\u3068\u3092\u5224\u65ad\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n\t\t\t\t<pre>\r\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ncase WM_COMMAND:\r\n  {\r\n   if( HIWORD(wParam)==0 ) \/\/\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304b\uff1f\r\n   {\r\n    switch( LOWORD(wParam) )\r\n    {\r\n    case CAT_WND_MENU_ID_EXIT:\r\n     DestroyWnd();\r\n     break;\r\n\r\n    default:\r\n     break;\r\n    }\r\n   }\r\n  }\r\n  break;\r\n<\/pre>\n\t\t\t\t<p>\u3053\u308c\u3067\u3000\u53f3\u30af\u30ea\u30c3\u30af\u2192\u30e1\u30cb\u30e5\u30fc\u51fa\u308b\u2192&#8221;Exit&#8221;\u9078\u629e\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u9589\u3058\u308b\u3000\u304c\u9054\u6210\u3067\u304d\u307e\u3057\u305f\uff0e<br \/>\n\t\t\t\t\uff08\u3053\u306e\u307e\u307e\u3067\u306f\u307e\u3060\uff0c\u8ffd\u52a0\u3055\u308c\u305f\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306b\u3064\u3044\u3066\u306f\u51e6\u7406\u3067\u304d\u307e\u305b\u3093\u304c\uff0e\uff09<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<hr \/>\n\t\t\t\t<p>\u00a0\u00a0<\/p>\n\t\t\t\t<p>\u00a0<\/p>\n\t\t\t\t<p>\u25cf\u30a2\u30d7\u30ea\u7d42\u4e86\u3078\u5411\u304b\u308f\u3059\u306b\u306f\uff1f<\/p>\n\t\t\t\t<p>\u30a6\u30a3\u30f3\u30c9\u30a6\u306f\u9589\u3058\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\uff0c\u3053\u306e\u3068\u304d\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u7d42\u4e86\u306b\u5411\u304b\u308f\u305b\u308b\u304b\u3069\u3046\u304b\u306f\uff0c\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5f79\u3069\u3053\u308d\u306b\u3088\u3063\u3066\u5909\u308f\u3063\u3066\u304d\u307e\u3059\uff0e<br \/>\n\t\t\t\t\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u30e1\u30a4\u30f3\u30a6\u30a3\u30f3\u30c9\u30a6\u3068\u3057\u3066\u4f7f\u308f\u308c\u3066\u3044\u308b\u306a\u3089\uff0cWM_DESTROY\u6642\u306bPostQuitMessage()API\u3092\u547c\u3076\u3088\u3046\u306b\u3057\u307e\u3059\uff0e<\/p>\n\t\t\t\t<p>\/\/\u30e1\u30a4\u30f3\u30a6\u30a3\u30f3\u30c9\u30a6\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\uff0c\u30a2\u30d7\u30ea\u7d42\u4e86\u3078\u5411\u304b\u308f\u3059<br \/>\n\t\t\t\t\u00a0\u00a0\u00a0if( this-&gt;IsMainWnd() )\/\/\u203bIsMainWnd()\u306f\u30e1\u30a4\u30f3\u30a6\u30a3\u30f3\u30c9\u30a6\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u8fd4\u3059\u30e1\u30f3\u30d0\u95a2\u6570<br \/>\n\t\t\t\t\u00a0\u00a0\u00a0{\u00a0PostQuitMessage(0);\u00a0}<\/p>\n\t\t\t\t<p>\u30e1\u30a4\u30f3\u30a6\u30a3\u30f3\u30c9\u30a6\u3068\u3057\u3066\u4f7f\u3046\u304b\u5426\u304b\u306f\uff0c\u30a6\u30a3\u30f3\u30c9\u30a6\u751f\u6210\u6642\u306b\u5f15\u6570\u3067\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\uff0e<\/p>\n\t\t\t\t<p><a href=\"https:\/\/www.iss.ai\/?p=882\">\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u30af\u30e9\u30b9\u3092\u4f5c\u308b(5)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u25cf\u732b\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3067\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u304c\u51fa\u308b\u3088\u3046\u306b\u3059\u308b \u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u552f\u4e00\u63d0\u4f9b\u3059\u308b\uff27\uff35\uff29\u3067\u3042\u308b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u3092\u5b9f\u88c5\u3057\u307e\u3059\uff0e \u305d\u3057\u3066\uff0c\u3053\u306e\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc\u3092\u732b\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\u624b\u6bb5\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u306b [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[15],"class_list":["post-858","post","type-post","status-publish","format-standard","hentry","category-tech","tag-win32"],"_links":{"self":[{"href":"https:\/\/www.iss.ai\/index.php?rest_route=\/wp\/v2\/posts\/858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iss.ai\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iss.ai\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iss.ai\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iss.ai\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=858"}],"version-history":[{"count":10,"href":"https:\/\/www.iss.ai\/index.php?rest_route=\/wp\/v2\/posts\/858\/revisions"}],"predecessor-version":[{"id":924,"href":"https:\/\/www.iss.ai\/index.php?rest_route=\/wp\/v2\/posts\/858\/revisions\/924"}],"wp:attachment":[{"href":"https:\/\/www.iss.ai\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iss.ai\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iss.ai\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}