{"id":4705,"date":"2013-10-10T05:13:15","date_gmt":"2013-10-09T18:13:15","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4705"},"modified":"2013-10-10T05:13:15","modified_gmt":"2013-10-09T18:13:15","slug":"codeblocks-c-wingui32-frame-menu-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/codeblocks-c-wingui32-frame-menu-primer-tutorial\/","title":{"rendered":"Code::Blocks C++ Win32 API Frame Menu Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Win32GUIFrame\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Code::Blocks C++ Win32 API Frame Menu Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Win32GUIFrame\/CodeBlocks_WinGUI32_Primer-99of.jpg\" title=\"Code::Blocks C++ Win32 API Frame Menu Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Code::Blocks C++ Win32 API Frame Menu Primer Tutorial<\/p><\/div>\n<p>The tutorial today is about a programming IDE called Code::Blocks, and we use this to create a project to create a C++ Windows 32bit GUI frame application (<a target=_blank title='Windows API information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Windows_API'>Win32 API<\/a>) with two simple submenus.<\/p>\n<p>Programming <a target=_blank title='IDE information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/IDE\u200e'>IDE<\/a>s take a lot of the hard work out of tasks such as compiling and linking in languages such as D, Matlab, Fortran (Code::Blocks) or Java, C, C++, VB.Net and C# (NetBeans) &#8230; and please know that there are many other languages and many other IDEs.   In the case of Code::Blocks IDE, which this blog reintroduces to you today (its customary to shake hands, and no <a target=_blank title='pardon?' href='http:\/\/www.youtube.com\/watch?v=SGZV6fsotYo'>Klingon<\/a> is necessary), it can create a C++ Win32  GUI  project environment.   To cut a long story short, there aint nothin&#8217; wrong with a good ol&#8217; IDE, but beware of IDEs in <a target=_blank title='Ides of March' href='https:\/\/www.youtube.com\/watch?v=Je0gTnheVe4'>March<\/a>.<\/p>\n<p>In saying that about IDEs, and how they make programming easier, often with Open Source programming, it is advantageous to know what goes on &#8220;under the hood&#8221; (or even &#8220;in the &#8216;hood&#8221; &#8230; chortle, chortle).   So if you ever get an opportunity to get helped creating your own makefile (or make it yourself, even with the <a target=_blank title='Sweet Green Icing' href='http:\/\/www.youtube.com\/watch?v=CPMpeNDIGdk'>Sweet Green Icing<\/a> &#8230; knew it could be worked in!) for something, take the opportunity to learn how to do this, as the Open Source world will become a little easier to navigate with such types of knowledge.   You&#8217;ve got to admire those early designers of computer languages, and those days when all you had was this tiny bit of memory (<a target=_blank title='64k' href='http:\/\/www.crashonline.org.uk\/39\/z88.htm'>64k<\/a> or <a target=_blank title='Voyager computer system' href='http:\/\/www.activeastronomy.org\/Home\/daniel'>&#8220;into the heliosphere on 8,000 bytes of memory&#8221;<\/a>) to play with to create your program.   <\/p>\n<p>In today&#8217;s <a target=_blank title='click on picture' href=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Win32GUIFrame\/\">tutorial<\/a> we write a simple C++ Windows 32bit GUI frame application with submenus.   Digital Mars compilers were used here and an additional rcc.exe needed to be downloaded for the compilation of resource *.rc files required here, that is not included in a default Digital Mars installation.<\/p>\n<p>Points of some interest are:<\/p>\n<ul>\n<li>Use of <a target=_blank title='set' href='http:\/\/www.computerhope.com\/sethlp.htm'>Windows Environment variables<\/a> where possible<\/li>\n<li>Use of <a target=_blank title='short names' href='http:\/\/www.youtube.com\/watch?v=uGFYiJTjMVM'>short names<\/a> for non-8dot3 file names &#8230; rule of thumb for 90%+ of cases is short name = (first six of non-8dot3) + &#8220;~1&#8221; (if a file, rather than directory, add file extension as well, here &#8230; eg. &#8220;%ProgramFiles%intern~1iexplo~1.exe&#8221; points at Internet Explorer web browser application on lots of people&#8217;s Windows computers)<\/li>\n<li>Use of C(++) <a target=_blank title='system' href='http:\/\/www.cplusplus.com\/reference\/cstdlib\/system\/'>system<\/a> function<\/li>\n<li>Use of <a target=_blank title='cmd' href='http:\/\/www.computerhope.com\/cmd.htm'>cmd<\/a>.exe \/c to call Internet Explorer to display a web page<\/li>\n<\/ul>\n<p>Code::Blocks can be an IDE for much more than C++ and C &#8230; it can supervise D, Matlab, Fortran, ARM, AVR, Direct\/X, FLTK, GLFW, GLUT, GTK+, Irrlicht, Lightfeather, MCS51, Ogre, OpenGL, PowerPC, QT4, SDL, SFML, STL port, SmartWin, TriCore and wxWidgets projects.<\/p>\n<p>Link to Code::Blocks &#8220;spiritual home&#8221; download page at <a target=_blank title='Code::Blocks download page' href='http:\/\/www.codeblocks.org\/downloads'>Code::Blocks<\/a>.<\/p>\n<p>Link to Digital Mars (extras) download page at <a target=_blank title='Digital Mars (extras) download page' href='http:\/\/www.digitalmars.com\/download\/freecompiler.html'>Digital Mars<\/a>.<\/p>\n<p>Link to very good tutorial <a target=_blank href='http:\/\/www.winprog.org\/tutorial\/menus.html' title='Reference tutorial'>here<\/a> &#8230; thanks &#8230; was followed very closely for this tutorial.<\/p>\n<p>Link to some downloadable C++ code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Win32GUIFrame\/main.cpp_GETME' title='main.cpp'>main.cpp<\/a><br \/>\nLink to some downloadable C++ header code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Win32GUIFrame\/resource.h_GETME' title='resource.h'>resource.h<\/a><br \/>\nLink to some downloadable C++ resource file code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Win32GUIFrame\/resource.rc_GETME' title='resource.rc'>resource.rc<\/a>\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d4705' onclick='var dv=document.getElementById(\"d4705\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Digital+Mars\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4705' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The tutorial today is about a programming IDE called Code::Blocks, and we use this to create a project to create a C++ Windows 32bit GUI frame application (Win32 API) with two simple submenus. Programming IDEs take a lot of the &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/codeblocks-c-wingui32-frame-menu-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,12,17,37],"tags":[88,176,220,460,770,997,1319,1435,1436],"class_list":["post-4705","post","type-post","status-publish","format-standard","hentry","category-codeblocks","category-elearning","category-gui","category-tutorials","tag-api","tag-c","tag-codeblocks","tag-frame","tag-menu","tag-programming","tag-tutorial","tag-windows","tag-windows-32bit-gui"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4705"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=4705"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4705\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=4705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=4705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=4705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}