Click here to Skip to main content
15,909,503 members
Home / Discussions / C#
   

C#

 
GeneralRe: Determining when application is running in debug mode Pin
theFrenchHornet1-Jul-07 10:21
theFrenchHornet1-Jul-07 10:21 
GeneralRe: Determining when application is running in debug mode Pin
Luc Pattyn1-Jul-07 10:56
sitebuilderLuc Pattyn1-Jul-07 10:56 
GeneralRe: Determining when application is running in debug mode Pin
theFrenchHornet1-Jul-07 11:04
theFrenchHornet1-Jul-07 11:04 
GeneralMore on Task Manager Pin
Luc Pattyn1-Jul-07 11:30
sitebuilderLuc Pattyn1-Jul-07 11:30 
GeneralRe: Determining when application is running in debug mode Pin
theFrenchHornet3-Jul-07 8:19
theFrenchHornet3-Jul-07 8:19 
GeneralRe: Determining when application is running in debug mode Pin
Luc Pattyn3-Jul-07 11:00
sitebuilderLuc Pattyn3-Jul-07 11:00 
AnswerRe: Determining when application is running in debug mode Pin
Miguel Lopes1-Jul-07 11:57
Miguel Lopes1-Jul-07 11:57 
AnswerRe: Determining when application is running in debug mode - solution Pin
theFrenchHornet3-Jul-07 8:18
theFrenchHornet3-Jul-07 8:18 
Evidently, there is no easy way to access the same information as that in the applications tab of the task manager the way one can easily access the same information as that in the processes tab. Or, if there is, it isn't obvious to any of us. Instead, I used the method below (resulted from suggestion by Luc Pattyn) to determine whether the IDE simply had the application open or was running it.

Note - non-relevant portions of code omitted (the ...'s).

const string IDE_INDICATOR = ".vshost";
Process current = Process.GetCurrentProcess();
string IDE_Name;

...

if (current.ProcessName.Contains(IDE_INDICATOR))
{
  IDE_Name = current.ProcessName;
}
else
{
  IDE_Name = current.ProcessName + IDE_INDICATOR;
}


... (looping through all processes)

if (process.ProcessName == IDE_Name)
{
  IntPtr WindowHandle = process.MainWindowHandle;
  if (WindowHandle != IntPtr.Zero)
  {
    // then application is being run by the IDE 
  }
  else
  {
    // IDE is open with the application loaded, but not currently running it  - at least not in debug mode,
    // and non-debug mode can be detected because it has its own process
  }
}

QuestionPassing cmd line arguments to registry value during install Pin
Miguel Lopes1-Jul-07 6:27
Miguel Lopes1-Jul-07 6:27 
QuestionBig Problem with WebService Pin
Iftekhar Naim1-Jul-07 5:17
Iftekhar Naim1-Jul-07 5:17 
AnswerRe: Big Problem with WebService Pin
Guffa1-Jul-07 6:37
Guffa1-Jul-07 6:37 
GeneralRe: Big Problem with WebService Pin
Iftekhar Naim1-Jul-07 14:00
Iftekhar Naim1-Jul-07 14:00 
QuestionGeneric Pin
Jeeva Jose1-Jul-07 4:34
Jeeva Jose1-Jul-07 4:34 
AnswerRe: Generic Pin
DavidNohejl1-Jul-07 7:40
DavidNohejl1-Jul-07 7:40 
GeneralRe: Generic Pin
Not Active1-Jul-07 11:52
mentorNot Active1-Jul-07 11:52 
GeneralRe: Generic Pin
DavidNohejl1-Jul-07 13:19
DavidNohejl1-Jul-07 13:19 
GeneralRe: Generic Pin
Jeeva Jose2-Jul-07 19:15
Jeeva Jose2-Jul-07 19:15 
GeneralRe: Generic Pin
DavidNohejl3-Jul-07 1:57
DavidNohejl3-Jul-07 1:57 
Questionsaving image from screen Pin
HexaDeveloper1-Jul-07 3:29
HexaDeveloper1-Jul-07 3:29 
AnswerRe: saving image from screen Pin
Guffa1-Jul-07 6:47
Guffa1-Jul-07 6:47 
GeneralRe: saving image from screen Pin
HexaDeveloper1-Jul-07 8:29
HexaDeveloper1-Jul-07 8:29 
AnswerRe: saving image from screen Pin
Guffa1-Jul-07 8:56
Guffa1-Jul-07 8:56 
GeneralRe: saving image from screen Pin
HexaDeveloper1-Jul-07 9:12
HexaDeveloper1-Jul-07 9:12 
GeneralRe: saving image from screen Pin
HexaDeveloper1-Jul-07 9:21
HexaDeveloper1-Jul-07 9:21 
Questionhow to display parent and child records in a datagridview + C#.net in windows forms Pin
Need help on datagrid view1-Jul-07 3:09
Need help on datagrid view1-Jul-07 3:09 

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.