From e47baca4f23db43ec91fbf64d5d06d7c0dbee495 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 6 Apr 2019 07:39:49 +0800 Subject: *misc --- source/tests/win32/01-window/03_sub_menu.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/tests/win32/01-window/03_sub_menu.cpp') 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; -- cgit v1.1-26-g67d0