diff options
author | chai <chaifix@163.com> | 2019-04-06 07:39:49 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-04-06 07:39:49 +0800 |
commit | e47baca4f23db43ec91fbf64d5d06d7c0dbee495 (patch) | |
tree | 9e909413bbf61834570e7dbdbe37fc8705f12730 /source/tests/win32/01-window/03_sub_menu.cpp | |
parent | e13616b5c40f912853be99f0603f0e4c97b22062 (diff) |
*misc
Diffstat (limited to 'source/tests/win32/01-window/03_sub_menu.cpp')
-rw-r--r-- | source/tests/win32/01-window/03_sub_menu.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/tests/win32/01-window/03_sub_menu.cpp b/source/tests/win32/01-window/03_sub_menu.cpp index 24b9654..091db6d 100644 --- a/source/tests/win32/01-window/03_sub_menu.cpp +++ b/source/tests/win32/01-window/03_sub_menu.cpp @@ -20,6 +20,8 @@ void AddMenus(HWND); #define IDM_ASSET 20 +HWND wnd; + int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLine, int nCmdShow) { @@ -32,9 +34,9 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLin wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE); wc.lpfnWndProc = WndProc; wc.hCursor = LoadCursor(0, IDC_ARROW); - RegisterClassW(&wc); - CreateWindowW(wc.lpszClassName, L"Asura v0.1", + + wnd = CreateWindowW(wc.lpszClassName, L"Asura v0.1", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 200, 200, 550, 450, 0, 0, hInstance, 0); @@ -104,14 +106,14 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, imgdata->Decode(db); img = new Image(); - img->Update(imgdata); + img->Load(imgdata); wglMakeCurrent(hdc, glc); file2 = new File("root/img.png"); file2->Open(File::FILE_MODE_READ); file2->ReadAll(&db); imgdata->Decode(db); - img->Update(imgdata, {50, 100}); + img->Load(imgdata, {50, 100}); imgdata->Release(); break; @@ -121,7 +123,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, switch (LOWORD(wParam)) { case IDM_FILE_NEW: - MessageBoxW(NULL, L"New file selected", + MessageBoxW(wnd, L"New file selected", L"Information", MB_OK); break; |