Link to home
Start Free TrialLog in
Avatar of stormist
stormist

asked on

Simple unmanaged C++ code to show a messagebox in windows

I'm familiar with C# but now I'm trying to understand unmanaged C++. What would be the shortest code for an unmanaged, non-dependent on .net framework, win32 program that simply shows a messagebox and exits when ok is pressed?
ASKER CERTIFIED SOLUTION
Avatar of UrosVidojevic
UrosVidojevic
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stormist
stormist

ASKER

In VS2005, which is the proper way to open a project of this sort without it inserting all that extra code? Is a win32 console app ok?
You may do that if you don't want extra code, but console window will also appear when you execute program.

So maybe best solution is to create Win32 application and then insert this code in

int APIENTRY WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow) {}

function.