gordonramp Posted April 2, 2013 Share Posted April 2, 2013 When a project is published and executed a black and white Dos screen precedes the program. It would be much better if this could be hidden. I'm also wondering if the program window can be centered on a screen. Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
AggrorJorn Posted April 2, 2013 Share Posted April 2, 2013 Is this a lua project or C++ project? Quote Link to comment Share on other sites More sharing options...
gordonramp Posted April 2, 2013 Author Share Posted April 2, 2013 Lua. Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
Josh Posted April 2, 2013 Share Posted April 2, 2013 There's a Visual Studio project setting to disable this, but I can't remember off the top of my head. Chris knows the answer. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted April 2, 2013 Share Posted April 2, 2013 target a win32gui app instead of a Win32 console app... under properties the linker page... linker /system /subsystem right now it probably reads /subsystem=Console(/SUBSYSTEM:CONSOLE) change it to properties /linker /system /subsystem=Windows(/SUBSYSTEM:WINDOWS) is that the setting you're looking for? --Mike Quote Link to comment Share on other sites More sharing options...
Josh Posted April 3, 2013 Share Posted April 3, 2013 Sounds familiar. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted April 5, 2013 Share Posted April 5, 2013 FYI, you also have to change "main" to "WinMain": int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted April 5, 2013 Share Posted April 5, 2013 There an much easier way, just insert this line into your source code, no need to change compiler settings or change the main function: #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") 2 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted April 5, 2013 Share Posted April 5, 2013 Nice. Will it accept the main() function, even though the arguments are different from WinMain()? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted April 5, 2013 Share Posted April 5, 2013 Yes, your main function will work as usual, including its command line parameters. Your main function should be always: int main(int argc, char* argv[]) Don't use variations of this, for example argv**, because they are not compatible with some 3rd party libs. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
NobbyVedania Posted July 31, 2014 Share Posted July 31, 2014 When a project is published and executed a black and white Dos screen precedes the program. It would be much better if this could be hidden. There an much easier way, just insert this line into your source code, no need to change compiler settings or change the main function: #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") Thanks, that's exactly what I was looking for! I've added a build target switch, so console window will only appear on debug build: #ifndef DEBUG #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") #endif I've put that on top of main.cpp. 1 Quote Link to comment Share on other sites More sharing options...
Vulcan Posted July 31, 2014 Share Posted July 31, 2014 Thanks, that's exactly what I was looking for! I've added a build target switch, so console window will only appear on debug build: #ifndef DEBUG #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") #endif I've put that on top of main.cpp. Wow that was lean code. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.