aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-28 20:17:03 +0800
committercrupest <crupest@outlook.com>2019-03-28 20:17:03 +0800
commit32314dd3d9aa01f929ee6d158d6f6ac2e0e22ed5 (patch)
treec0a5829e63f11b4b2f223bdf3f53a201cecbe0b4 /src
parent8199bbb3130812e5c8fac6254de6971ef6b9c17e (diff)
downloadcru-32314dd3d9aa01f929ee6d158d6f6ac2e0e22ed5.tar.gz
cru-32314dd3d9aa01f929ee6d158d6f6ac2e0e22ed5.tar.bz2
cru-32314dd3d9aa01f929ee6d158d6f6ac2e0e22ed5.zip
...
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/main.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index da488e08..b4097d63 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -32,6 +32,6 @@ target_link_libraries(cru_ui PRIVATE D3D11 D2d1 DWrite)
target_compile_definitions(cru_ui PUBLIC UNICODE _UNICODE) # use unicode
endif()
-add_executable(demo main.cpp)
+add_executable(demo WIN32 main.cpp)
target_link_libraries(demo PRIVATE cru_ui)
diff --git a/src/main.cpp b/src/main.cpp
index a787fbca..c35213f7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,12 +16,13 @@ using cru::ui::controls::Button;
using cru::ui::controls::FlexLayout;
using cru::ui::controls::TextBlock;
-int main() {
+int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+ LPWSTR lpCmdLine, int nCmdShow) {
#ifdef CRU_DEBUG
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
- Application application(::GetModuleHandleW(nullptr));
+ Application application(hInstance);
const auto window = Window::CreateOverlapped();