Click here to Skip to main content
15,905,073 members
Home / Discussions / C#
   

C#

 
GeneralRe: showing form from thread Pin
Dave Kreskowiak13-May-10 19:25
mveDave Kreskowiak13-May-10 19:25 
GeneralRe: showing form from thread Pin
The Man from U.N.C.L.E.13-May-10 22:34
The Man from U.N.C.L.E.13-May-10 22:34 
GeneralRe: showing form from thread Pin
The Man from U.N.C.L.E.13-May-10 22:43
The Man from U.N.C.L.E.13-May-10 22:43 
QuestionShowFileDialog In Console Pin
noamtzu0013-May-10 0:00
noamtzu0013-May-10 0:00 
AnswerRe: ShowFileDialog In Console Pin
Michel Godfroid13-May-10 0:36
Michel Godfroid13-May-10 0:36 
GeneralRe: ShowFileDialog In Console Pin
Luc Pattyn13-May-10 3:30
sitebuilderLuc Pattyn13-May-10 3:30 
RantRe: ShowFileDialog In Console Pin
Michel Godfroid13-May-10 4:13
Michel Godfroid13-May-10 4:13 
GeneralRe: ShowFileDialog In Console Pin
Luc Pattyn13-May-10 4:40
sitebuilderLuc Pattyn13-May-10 4:40 
I disagree, there may be good reasons to create a hybrid. What I would like to do is write a single app (one EXE) that:
- when no command line arguments are present, behaves like a WinForms app, i.e. it offers a GUI and the user can start setting options and clicking buttons;
- when command line arguments are present, behaves like a Console app, i.e. perform its job, as defined by the command line arguments, and provide output to the console, so it can be embedded inside a batch file, its output could be redirected by the shell, etc.

All this without a console nor a WinForm form popping up for a fraction of a second, to be hidden again when it is not wanted.

Turns out Windows does not let one do that. There is a single bit in the EXE format (PEF) that says this app is a console, if not started from a console, open one; or it isn't, so don't give it access to its caller.

Example:
I like WinZip a lot; long ago it was a DOS utility, no GUI, just command line operation. Fine.
Then it turned into a WinForm app, with a GUI.
And then they fixed it, by adding a "command line extension", a second EXE to fix the lack of scriptability. So MS themselves need two EXE to do basically the same thing twice, with different user interfaces.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: ShowFileDialog In Console Pin
Michel Godfroid13-May-10 5:06
Michel Godfroid13-May-10 5:06 
GeneralRe: ShowFileDialog In Console Pin
Luc Pattyn13-May-10 5:13
sitebuilderLuc Pattyn13-May-10 5:13 
GeneralRe: ShowFileDialog In Console Pin
DaveyM6913-May-10 5:43
professionalDaveyM6913-May-10 5:43 
GeneralRe: ShowFileDialog In Console Pin
DaveyM6913-May-10 5:41
professionalDaveyM6913-May-10 5:41 
GeneralRe: ShowFileDialog In Console Pin
Luc Pattyn13-May-10 5:57
sitebuilderLuc Pattyn13-May-10 5:57 
AnswerRe: ShowFileDialog In Console Pin
Rajesh Anuhya13-May-10 1:49
professionalRajesh Anuhya13-May-10 1:49 
AnswerRe: ShowFileDialog In Console Pin
dybs16-May-10 14:06
dybs16-May-10 14:06 
QuestionAdd Multiple IP Addresses Pin
wasifmuneer12-May-10 22:47
wasifmuneer12-May-10 22:47 
AnswerRe: Add Multiple IP Addresses Pin
Michel Godfroid12-May-10 23:43
Michel Godfroid12-May-10 23:43 
GeneralRe: Add Multiple IP Addresses Pin
wasifmuneer12-May-10 23:51
wasifmuneer12-May-10 23:51 
GeneralRe: Add Multiple IP Addresses Pin
Michel Godfroid13-May-10 0:05
Michel Godfroid13-May-10 0:05 
GeneralRe: Add Multiple IP Addresses Pin
#realJSOP13-May-10 0:19
professional#realJSOP13-May-10 0:19 
AnswerRe: Add Multiple IP Addresses Pin
#realJSOP13-May-10 0:18
professional#realJSOP13-May-10 0:18 
GeneralRe: Add Multiple IP Addresses Pin
wasifmuneer13-May-10 0:56
wasifmuneer13-May-10 0:56 
AnswerRe: Add Multiple IP Addresses Pin
wasifmuneer13-May-10 1:41
wasifmuneer13-May-10 1:41 
GeneralRe: Add Multiple IP Addresses Pin
Dave Kreskowiak13-May-10 3:54
mveDave Kreskowiak13-May-10 3:54 
GeneralRe: Add Multiple IP Addresses Pin
wasifmuneer14-May-10 1:31
wasifmuneer14-May-10 1:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.