How to prevent a command prompt to appear on a windowless program?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

How to prevent a command prompt to appear on a windowless program?

Post by ic2 »

I can't seem to find what I did in our Vulcan program to prevent a command prompt to appear on a windowless program. I'd say the code in X# is the same but it opens a command line prompt where the Vulcan program does not every time it starts and this doesn't close either. I tried to add
oApp:WindowStyle := System.Diagnostics.ProcessWindowStyle.Hidden
but this isn't recognized as a method on the App class.

The code is:

FUNCTION Start AS INT
//#s Startpoint is here
LOCAL oApp AS VOApp
LOCAL pi AS ProcessIcon
pi:=ProcessIcon{}
oApp := VOApp{}
Try
pi:Display()
oApp:Start()
Catch exception As System.Exception
// ....
FINALLY
pi:Dispose() // This removes the tray icon and is run when we return from oApp:Start
Environment.Exit(0)
end try
RETURN 0

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

How to prevent a command prompt to appear on a windowless program?

Post by Chris »

Hi Dick,

Just change the "Output type" of the app (in Project Properties/general) to "Windows Application" instead of Console, this will prevent it from displaying a console window.

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

How to prevent a command prompt to appear on a windowless program?

Post by ic2 »

Yes, that was it. Thanks!

Dick
Post Reply