1

I have a console window which opens up together with my application. Can I somehow find its handle and hide it or at least minimize it? Suppose I can use any language (C++,C#,Visual Basic, Batch file, etc..)

I cannot remove the console, because every Matlab compiled application has one.

Nigel Davies
  • 1,640
  • 1
  • 13
  • 26
Andrey Rubshtein
  • 20,795
  • 11
  • 69
  • 104

2 Answers2

1

To find the handle see: How can I get a process handle by its name in C++?

Or if you are using cmd.exe to launch your program consider creating your own EXE from Visual Studio or using something like Python and www.py2exe.org to convert a Python script to an EXE.

Community
  • 1
  • 1
ozOli
  • 1,414
  • 1
  • 18
  • 26
1

I'm assuming that you're talking about an application that you compiled with inside MATLAB using mcc. If that's the case there is a flag that you can use.

Here's the blurb from the MATLAB documentation.

-e Suppress MS-DOS Command Window

Suppress appearance of the MS-DOS command window when generating a standalone application. Use -e in place of the -m option. This option is available for Windows only. Use with -R option to generate error logging as such:

mcc -e -R -logfile -R 'filename' -v function_name

When I deploy applications I usually leave the window open so when others see some kind of error they can report it to me. If you want to hide it definitely use the -R as suggested above to generate an error log.

JimInCO
  • 189
  • 1
  • 10