|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Command Prompt or WindowsHi there,
A console application (.exe) can be executed at Command Prompt or Windows (double-click). Is there a way to detect whether if it is executed at CP or Windows? regards, Boon Hello TBoon,
I believe your assumption is wrong. I'm fairly certain that you can not operate in both console and GUI mode from a single app. This effect is usually accomplished by providing a ".com" console app that is the equivalent of the ".exe" GUI app. You can ask Windows for the launching process.. search google or MSDN for details. -Boo Show quoteHide quote > Hi there, > > A console application (.exe) can be executed at Command Prompt or > Windows > (double-click). > Is there a way to detect whether if it is executed at CP or Windows? > regards, > Boon GhostInAK wrote:
> I believe your assumption is wrong. I'm fairly certain that you can My guess was that he's only ever operating in console mode, but he wants to > not operate in both console and GUI mode from a single app. tell whether his application was launched by someone opening a command window and typing in "myapp.exe" in order to run in the existing window, or by double-clicking the .exe in Windows so that it automatically opened a console window to run the application. The only way I could think to do this would be to see what the name of the process that launched the application is (presumably it would be either explorer.exe or cmd.exe) but I've no idea how one would find that information. -- (O)enone Hello Oenone,
Unfortunately not everyone uses the Explorer shell or the cmd console. Some people change their GUI shells (to somethink like Elightenment for Windows or whatever) and some people use MSH instead of CMD. Unless you can guarantee your target audience will always and forever use explorer and cmd, you need to find another way. I don't have a way off the top of my head. -Boo Show quoteHide quote > GhostInAK wrote: > >> I believe your assumption is wrong. I'm fairly certain that you can >> not operate in both console and GUI mode from a single app. >> > My guess was that he's only ever operating in console mode, but he > wants to tell whether his application was launched by someone opening > a command window and typing in "myapp.exe" in order to run in the > existing window, or by double-clicking the .exe in Windows so that it > automatically opened a console window to run the application. > > The only way I could think to do this would be to see what the name of > the process that launched the application is (presumably it would be > either explorer.exe or cmd.exe) but I've no idea how one would find > that information. >
Fill DataTable Progress
Iterating through a ListBox in VB.NET VS 2005 Help with Merge and INSERT/UPDATE commands Using code to add controls SQL datasources Why return false? OPEN A FILE FOR READ ONLY Sort on two columns in ListView? Fail to connect SQL2005 Problem passing Collection from VB.Net to VB6 |
|||||||||||||||||||||||