mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-11-03 17:24:24 +00:00 
			
		
		
		
	Examples: Win32: Always use RegisterClassW() to ensure windows are Unicode. (#5725)
This commit is contained in:
		@@ -24,15 +24,15 @@ int main(int, char**)
 | 
			
		||||
{
 | 
			
		||||
    // Create application window
 | 
			
		||||
    //ImGui_ImplWin32_EnableDpiAwareness();
 | 
			
		||||
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, _T("ImGui Example"), NULL };
 | 
			
		||||
    ::RegisterClassEx(&wc);
 | 
			
		||||
    HWND hwnd = ::CreateWindow(wc.lpszClassName, _T("Dear ImGui DirectX9 Example"), WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL);
 | 
			
		||||
    WNDCLASSEXW wc = { sizeof(wc), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"ImGui Example", NULL };
 | 
			
		||||
    ::RegisterClassExW(&wc);
 | 
			
		||||
    HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"Dear ImGui DirectX9 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL);
 | 
			
		||||
 | 
			
		||||
    // Initialize Direct3D
 | 
			
		||||
    if (!CreateDeviceD3D(hwnd))
 | 
			
		||||
    {
 | 
			
		||||
        CleanupDeviceD3D();
 | 
			
		||||
        ::UnregisterClass(wc.lpszClassName, wc.hInstance);
 | 
			
		||||
        ::UnregisterClassW(wc.lpszClassName, wc.hInstance);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -161,7 +161,7 @@ int main(int, char**)
 | 
			
		||||
 | 
			
		||||
    CleanupDeviceD3D();
 | 
			
		||||
    ::DestroyWindow(hwnd);
 | 
			
		||||
    ::UnregisterClass(wc.lpszClassName, wc.hInstance);
 | 
			
		||||
    ::UnregisterClassW(wc.lpszClassName, wc.hInstance);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user