{"id":498,"date":"2014-12-21T18:17:44","date_gmt":"2014-12-21T23:17:44","guid":{"rendered":"http:\/\/jaewon.hwang.info\/jaewon\/?p=498"},"modified":"2014-12-21T20:06:02","modified_gmt":"2014-12-22T01:06:02","slug":"wxwidgets-add-about-to-the-system-menu","status":"publish","type":"post","link":"https:\/\/jaewon.hwang.info\/jaewon\/2014\/12\/wxwidgets-add-about-to-the-system-menu\/","title":{"rendered":"[wxWidgets] Add &#8220;About&#8230;&#8221; to the system menu"},"content":{"rendered":"<p>Original post: <a href=\"https:\/\/forums.wxwidgets.org\/viewtopic.php?f=20&#038;t=13921\" target=\"_blank\">https:\/\/forums.wxwidgets.org\/viewtopic.php?f=20&#038;t=13921<br \/>\n<\/a><br \/>\nMyDialog.h<\/p>\n<pre class=\"brush: cpp; toolbar: false;\">class MyDialog : public wxDialog\r\n{\r\n\t...\r\n\r\n\t\/\/ Override MSWTranslateMessage\r\n\tbool MSWTranslateMessage(WXMSG* pMsg);\r\n};<\/pre>\n<p>MyDialog.cpp<\/p>\n<pre class=\"brush: cpp; toolbar: false;\">\/\/ Include aboutdlg.h\r\n#include &lt;wx\/aboutdlg.h&gt;\r\n\r\nMyDialog::MyDialog(wxWindow* parent)\r\n{\r\n\t...\r\n\r\n\t\/\/ Add the menu item, \"About...\", to the system menu\r\n\tHMENU hSystemMenu = ::GetSystemMenu((HWND__*)GetHWND(), FALSE);\r\n\t::AppendMenu(hSystemMenu, MF_SEPARATOR, 0, wxT(\"\"));\r\n\t::AppendMenu(hSystemMenu, MF_STRING, wxID_ABOUT, wxT(\"About...\"));\r\n\t::DrawMenuBar((HWND__*)GetHWND());\r\n}\r\n\r\n\/\/ implement the message handler\r\nbool MyDialog::MSWTranslateMessage(WXMSG* pMsg)\r\n{\r\n\tif (WM_SYSCOMMAND==pMsg->message && wxID_ABOUT==pMsg->wParam)\r\n\t{\r\n\t\twxAboutDialogInfo di;\r\n\t\tdi.SetName(wxT(\"My App\"));\r\n\t\tdi.SetVersion(wxT(\"1.00\"));\r\n\t\tdi.SetDescription(wxT(\"This app does cool trix!\"));\r\n\r\n\t\twxAboutBox(di);\r\n\r\n\t\treturn true; \/\/ Message processed\r\n\t}\r\n\r\n\treturn wxDialog::MSWTranslateMessage(pMsg);\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Original post: https:\/\/forums.wxwidgets.org\/viewtopic.php?f=20&#038;t=13921 MyDialog.h class MyDialog : public wxDialog { &#8230; \/\/ Override MSWTranslateMessage bool MSWTranslateMessage(WXMSG* pMsg); }; MyDialog.cpp \/\/ Include aboutdlg.h #include &lt;wx\/aboutdlg.h&gt; MyDialog::MyDialog(wxWindow* parent) { &#8230; \/\/ Add the menu item, &#8220;About&#8230;&#8221;, to the system menu HMENU hSystemMenu = ::GetSystemMenu((HWND__*)GetHWND(), FALSE); ::AppendMenu(hSystemMenu, MF_SEPARATOR, 0, wxT(&#8220;&#8221;)); ::AppendMenu(hSystemMenu, MF_STRING, wxID_ABOUT, wxT(&#8220;About&#8230;&#8221;)); ::DrawMenuBar((HWND__*)GetHWND()); } \/\/ implement [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[90],"class_list":["post-498","post","type-post","status-publish","format-standard","hentry","category-computer","tag-wxwidgets"],"_links":{"self":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts\/498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/comments?post=498"}],"version-history":[{"count":0,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}