OSDN Git Service

36ca35219ae76a0867186bcbb8b3a8554bf21117
[winaudioj/async.git] / async / application.h
1 #pragma once
2 /*
3   ==============================================================================
4
5    This file is part of the mini timer
6    Copyright 2005-10 by Satoshi Fujiwara.
7
8    mini timer can be redistributed and/or modified under the terms of the
9    GNU General Public License, as published by the Free Software Foundation;
10    either version 2 of the License, or (at your option) any later version.
11
12    mini timer is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with mini timer; if not, visit www.gnu.org/licenses or write to the
19    Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
20    Boston, MA 02111-1307 USA
21
22   ==============================================================================
23 */
24 #include "singleton.h"
25 #include "exception.h"
26 namespace sf {
27 class application : public singleton<application>
28 {
29 public:
30   struct exception
31     : public sf::win32_error_exception 
32   {
33     exception(uint32_t hr) : win32_error_exception(hr) {};
34     exception() : win32_error_exception() {} ;
35   };
36
37   application();
38   ~application(){};
39   
40   int execute(HINSTANCE hInstance,
41                      HINSTANCE hPrevInstance,
42                      LPTSTR    lpCmdLine,
43                      int       nCmdShow);
44   
45
46   std::wstring& app_id(){return app_id_;};
47   HINSTANCE instance_handle() {return instance_handle_;};
48
49 private:
50   static std::wstring app_id_;
51   HINSTANCE instance_handle_;
52   int return_code_;
53 };
54 }
55