OSDN Git Service

windows/menu.hpp Add.
authorMyun2 <myun2@nwhite.info>
Fri, 15 Apr 2011 19:05:05 +0000 (04:05 +0900)
committerMyun2 <myun2@nwhite.info>
Fri, 15 Apr 2011 19:05:05 +0000 (04:05 +0900)
roast_ex/include/roast/windows/menu.hpp [new file with mode: 0644]

diff --git a/roast_ex/include/roast/windows/menu.hpp b/roast_ex/include/roast/windows/menu.hpp
new file mode 100644 (file)
index 0000000..e23d968
--- /dev/null
@@ -0,0 +1,41 @@
+//     Roast+ License
+/*
+
+*/
+#ifndef __SFJP_ROAST_EX__windows__menu_HPP__
+#define __SFJP_ROAST_EX__windows__menu_HPP__
+
+#include <windows.h>
+
+namespace roast
+{
+       namespace windows
+       {
+               class windows_exception : public ::std::string
+               {
+               public:
+                       windows_exception(const char* s) : ::std::string(s) {}
+                       windows_exception(const ::std::string& s) : ::std::string(s) {}
+               };
+
+               class menu
+               {
+               protected:
+                       ::HMENU m_hMenu;
+               public:
+                       menu(){
+                               m_hMenu = ::CreateMenu();
+                               if ( m_hMenu == NULL )
+                                       windows_exception("::CreateMenu() Returned Error.");
+                       }
+                       virtual ~menu(){
+                               if ( ::DestroyMenu(m_hMenu) == FALSE )
+                                       windows_exception("::DestroyMenu() Returned Error.");
+                       }
+               };
+               
+               ////////////////////////////////////////////////////////////////
+       }
+}
+
+#endif//__SFJP_ROAST_EX__windows__menu_HPP__