<p>I am developing console application in .Net and I want to change a behavior a little based on information that application was started from cmd.exe or from explorer.exe. Is it possible?</p>

The
CreateToolhelp32Snapshot Function
has a Process32First method that will allow you to read a
PROCESSENTRY32 Structure
. The structure has a property that will get you the information you want:
th32ParentProcessID
- The identifier
  of the process that created this
  process (its parent process).
This article will help you get started using the ToolHelpSnapshot function:
http://www.codeproject.com/KB/cs/IsApplicationRunning.aspx