Re: Print to command window?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tony Proctor (tony_proctor_at_aimtechnology_NOSPAM.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 09:21:08 -0000

Yes, a console-mode application can still show forms Larry.

There are a couple of small issues that need attention though:

1) As Peter has already said, the console window will appear even when
running in "forms mode". The window can be hidden/restored using WIN32 calls
such as:

    ShowWindow GetConsoleWindow(), SW_HIDE
    ShowWindow GetConsoleWindow(), SW_SHOWNORMAL

2) Also when running in "forms mode", the main form needs to be modal since
it's probably being invoked from Sub Main(). However, you can't set
ShowInTaskbar for a modal form and so it doesn't appear like a normal
application window. What I did was show is as modeless but stall execution
with a "lazy wait" until the form was closed - i.e. simulating a modal form.

            Tony Proctor

"Larry" <lljo40@netscape.net> wrote in message
news:evS5CfrBEHA.3788@TK2MSFTNGP10.phx.gbl...
> I've seen other posts about using editbin, but haven't done anything with
it
> because they all talk about making the app a console app. I want it to
still
> be a visual app, but give the help information in similar to help fir the
> DIR command when asked.
>
> After using editbin to post-process the executable, is it still able to
> function as a normal VB app?
>
> "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM.com> wrote in message
> news:%23a2GZYrBEHA.2308@tk2msftngp13.phx.gbl...
> > With VB6, Larry, the process of generating a console-mode application
> > involves post-processing the normal executable with editbin.
> >
> > I too have a VB application with a "split personality". It has a normal
> > forms interface, but can optionally run as a console-mode application
> > instead. The decision is based on the command-line, as in your case.
> >
> > Assuming your situation is very similar, is there any specific help I
can
> > provide here?
> >
> > Tony Proctor
> >
> > "Larry" <lljo40@netscape.net> wrote in message
> > news:uQ$N8ArBEHA.2828@TK2MSFTNGP10.phx.gbl...
> > > Doing a search like this is always my first step at trying to get some
> > help,
> > > but I have looked at many, many of these articles and almost all of
the
> > ones
> > > giving advice are saying the application needs to be a console app,
> which
> > > needs some kind of different compilation.
> > >
> > > The problem is that my app is a typical VB app, most of the time, with
> the
> > > option of running as a "console" app. I need this to run visually and
> > > optionally from the command line.
> > >
> > > So far, I haven't found any code in Google that gives me the option
> > (without
> > > buying something extra).
> > >
> > > I'll keep looking there though.
> > >
> > >
> > > "Larry Serflaten" <serflaten@usinternet.com> wrote in message
> > > news:OJIKTpqBEHA.712@tk2msftngp13.phx.gbl...
> > > >
> > > > "Larry" <lljo40@netscape.net> wrote
> > > >
> > > > > I know I can trap the question mark, but how do I print the
> > information
> > > to
> > > > > the screen to describe the arguments?
> > > >
> > > > A quick look through the archive shows many answers:
> > > >
> > > >
> > >
> >
>
http://groups.google.com/groups?num=50&hl=en&lr=&ie=ISO-8859-1&safe=off&c2coff=1&scoring=r&as_drrb=q&q=Print+to+command+window+gro
> > > > up%3Amicrosoft.public.vb.*&btnG=Google+Search
> > > >
> > > > (Watch out for word wrap breaking the link)
> > > > LFS
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages