Compiled app doesn't work when opened with Visual Studio, but does with Windows Explorer

Pierro 0 Reputation points
2024-02-18T22:52:46.9133333+00:00

Hello, I'm building a C .exe that I somehow can't launch correctly anymore through Visual studio green arrow button (and CTRL+F5), but I'm able to launch it successfully from windows explorer. When launched from Visual Studio 2022, the Icon and the name in the taskbar is correct, but nothing is visible.
The preview on hover shows a blank image. No shortcut is working, like alt tab, shift up, alt enter ... etc .

When launched from Windows Explorer, or cmd, it's displayed correctly. I'm sure that I'm opening the correct .exe because its date is updated right after a successfull build, and the behaviour follows what I'm coding.

Local debugger doesn't help at all. It shows that the app seems to be running. For information, the code is based on a classical win32 api, ex :

hWnd = CreateWindow(WindowClass, Title, WS_SYSMENU|WS_CAPTION|WS_MINIMIZEBOX|WS_DLGFRAME, windowX, windowY, width, height, NULL, NULL, hInstance, NULL)

The app is correctly working in the background but the GUI doesn't show.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,031 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,575 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.