Questions tagged [winmain]

WinMain is the user provided entry point for graphical Windows based applications.

WinMain is the user provided entry point for graphical Windows based applications. It is used as an entry point in every such Windows application. WinMain is used to initialize the application, display its main window, and enter a message retrieval-and-dispatch loop that is the top-level control structure for the remainder of the application's execution.

125 questions
2
votes
1 answer

WinMain/Win32 Window not displaying, but shows up in Processes tab of Task Manager

I'm a newbie to c++, and I'm stuck on displaying the window. I'm not getting any errors, but my Window is not displaying on the desktop. When I open the task manager, it appears under the 'Proccesses' tab. I haven't been finding any solutions to…
2
votes
1 answer

How to add a wrapper to the MFC WinMain?

I want to add a wrapper to the MFC WinMain in order to be able to make a MFC application be able run as GUI application or as a service. Can I add a wrapper to WinMail from MFC without modifying MFC source code?
sorin
  • 161,544
  • 178
  • 535
  • 806
2
votes
1 answer

Create Windows Program with GUI but use 'main()' (in D)?

Is it possible, to in Windows, create a GUI program, which has it's entry point in 'main()'? How do I do this? My use for this is that I want a cross-platform application, with one uniform entry point.
Jeroen
  • 15,257
  • 12
  • 59
  • 102
2
votes
3 answers

system() without prompt, c++, winmain

I am using c++ and i have a program that works with winmain. I do not want the system() call to open and close a window. example: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { system("dir >…
Guy Yagev
  • 31
  • 5
2
votes
3 answers

LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup error when using WinMain

I've been following this tutorial to learn some DirectX programming: http://www.rastertek.com/dx11tut02.html I'd gotten to the end, tried to build and it threw this error when I compiled: MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external…
Ryan Butt
  • 21
  • 1
  • 1
  • 2
2
votes
2 answers

How do I set the WINDOWCLASSX hbrBackground alpha channel? (C++)

So, I have a WINDOWCLASSX that I want to set the background to, including the alpha channel, but I only saw an "RGB" macro; no RGBA. So how do I set alpha on hbrBackground? Here is my code: WNDCLASSEX wincl; wincl.hInstance =…
BananasGoMoo
  • 68
  • 2
  • 10
1
vote
2 answers

How to create a windows application in C++ showing just a TaskDialog

I need to create a windows application in C++ and it has to show just a TaskDialog (see http://msdn.microsoft.com/en-us/library/windows/desktop/bb760540(v=vs.85).aspx ). The TaskDialog should show a text passed as parameter to the command line. I…
Alessandro Jacopson
  • 18,047
  • 15
  • 98
  • 153
1
vote
3 answers

winmain() function / c++

can you please explain to me the significance of this statement generally written at the end of the WinMain() function: return (int) msg.wParam; Im used to ending my console applications with return 0; is it wrong for windows applications? Thank…
Anon
  • 1,274
  • 4
  • 17
  • 44
1
vote
3 answers

Issues running WinMain in C

Currently I'm having issues with WinMain in C (specifically in Visual Studio). For instance... #include #include int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) { …
JamesD
  • 13
  • 4
1
vote
0 answers

WINAPI WinMain returns 0 but the process hangs about in Windows background processes

We have a suite of unit tests for our application, divided up into projects and individual executables, that are part of our build system. One of the executables has started hanging about even after completion which means it's holding onto some of…
Dave Stott
  • 33
  • 5
1
vote
0 answers

make g++ use main as entry point instead of winmain

I'm pretty new to this stuff, and solutions from similar threads aren't working for me, so I'm asking again with my specific problem I'm trying to compile a C++ program with a main() function on windows OS. So I used g++ -std=c++11 -o hw2 *.cpp but…
Uriyasama
  • 31
  • 2
1
vote
2 answers

GCC - Compiling C undefined reference to `wWinMain'

I'm trying to compile C with gcc in command prompt but I'm getting this undefined reference to `wWinMain' error. I was getting undefined reference to `WinMain' first but I fixed that by adding the argument: -municode Now `wWinMain' is undefined.…
Xayris
  • 47
  • 7
1
vote
1 answer

programming with NASM in Windows XP

I have the following code which assembles and runs fine on Windows XP 32 bit, 2.09.08 NASM: ; how to compile: nasm -f elf test.asm ; how to link: ld -o test.exe test.o section .data section .text ;global _WinMain@16 ;_WinMain@16: ;global…
TheFuzz
  • 2,607
  • 6
  • 29
  • 48
1
vote
1 answer

Cross compile with i686-w64-mingw32-g++ and use main() as entry point

I am compiling for Linux in a make target using plain g++ for my linux executable and for windows in a separate make target using i686-w64-mingw32-g++. If I use main(), the g++ target builds and the windows target fails…
1
vote
1 answer

WM_KILLFOCUS logic

I have the following code, see below. Why is the code case WM_KILLFOCUS in WinMain() never reached? If I remove case WM_KILLFOCUS from WndProc(), the one in WinMain() is still not reached. Case WM_KEYDOWN works just fine. How do I fix code so that…
1 2
3
8 9