00001
00002 #include "resource.h"
00003
00004 #include <basis/convert_utf.h>
00005 #include <basis/istring.h>
00006 #include <basis/portable.h>
00007 #include <data_struct/static_memory_gremlin.h>
00008 #include <win_ext/basic_window.h>
00009
00010 HOOPLE_STARTUP_CODE;
00011
00012
00013
00014 int APIENTRY WinMain(application_instance instance,
00015 application_instance prev_instance, LPSTR lpCmdLine, int nCmdShow)
00016 {
00017 istring win_title = portable::rc_string(IDS_APP_TITLE);
00018 istring win_class = portable::rc_string(IDC_SIMPLE_WINDOW);
00019
00020 basic_window win(instance, win_title, win_class);
00021 win.register_class((u_int *)IDI_SIMPLE_WINDOW, (u_int *)IDC_SIMPLE_WINDOW);
00022 if (!win.create(nCmdShow)) {
00023 MessageBox(0, to_unicode_temp("failed to init window"), to_unicode_temp("argh"), MB_OK);
00024 return false;
00025 }
00026
00027 HACCEL hAccelTable = LoadAccelerators(instance, (LPCTSTR)IDC_SIMPLE_WINDOW);
00028
00029
00030 MSG msg;
00031 while (GetMessage(&msg, NULL, 0, 0)) {
00032 if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
00033 TranslateMessage(&msg);
00034 DispatchMessage(&msg);
00035 }
00036 }
00037
00038 return int(msg.wParam);
00039 }
00040