console app -- started via..? (Windows Only)

Share your advanced PureBasic knowledge/code with the community.
hss
User
User
Posts: 69
Joined: Thu Mar 08, 2007 6:02 pm

console app -- started via..? (Windows Only)

Post by hss »

hi,

how to check whether the -- PB compiled -- .exe was started
'directly' (like, double-click or Start/Run) or via shell (cmd.exe/c:\app.exe)?

thanks!
hss
User
User
Posts: 69
Joined: Thu Mar 08, 2007 6:02 pm

Post by hss »

Code: Select all

OpenConsole()


GetConsoleScreenBufferInfo_(GetStdHandle_(#STD_OUTPUT_HANDLE),@xy.CONSOLE_SCREEN_BUFFER_INFO)
If(xy\dwCursorPosition\Y=0)
MessageRequester("Appl.","Please, start from command-line!"):End
EndIf


PrintN("Hello.")


End


User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

moved 2 Tips&Tricks...
SPAMINATOR NR.1
User avatar
Michael Vogel
Addict
Addict
Posts: 2810
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: console app -- started via..? (Windows Only)

Post by Michael Vogel »

There was also a tip somewhere in the forum to do the check for standard applications, wasn't it?
I can't find it anymore... :? ...but I believe, that there was an output, if the application has been started by a double click or via command line :|

Michael
Post Reply