Visual Studio Development Bookmark and Share   
 index > Developer Documentation and Help System > Visual c++ function for detecting a process running or not
 

Visual c++ function for detecting a process running or not

hello,

i have the basic knowledge of c++ (like if, else, loops, classes, file handling, etc.). but i dont have the knowledge of .net platform.

please tell me any default function of visual c++ 2008 that can tell that a specific process is runing in the system or not ?
is there any other way using visual c++ ? please help.
i have visual studio 2008 with windows 7 rc.

i dont have a very sound knowledge of c++ so please provide a simple program link so that i can understand it correctly.


thanks


rahul

rahuljin  Friday, June 05, 2009 8:26 AM
If you posted the code you are having a problem with it would simplify a response. However having said that if you want to become more familar with the language I suggest you download Microsoft's Visual C++ 2008 Express from their web site. Its free and has a great on-line help feature. If you are at all familar with VB 2008 or VC# 2008, both of these languages are structured nearly the same as VC++ with the exception of how operators are used, and are constructed around the .Net framework. Below is an example of all three language text box SaveFile Methods.

Visual Basic

 

Private Sub SaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click

        Dim myFileName As String = ""

        With SaveFileDialog1

            .DefaultExt = ".bas"

            .Filter = "Basic52 Files (*.bas)|*.bas|All Files (*.*)|*.*"

            .ShowDialog()

            myFileName = SaveFileDialog1.FileName

 

            FileOpen(1, myFileName, OpenMode.Output)

 

            myFileName = txtEditor.Text

 

            PrintLine(1, myFileName)        'Saves each line of text in the text

            FileClose(1)                    'editor so it can be eaisly be read

                                            'by the LineInput() Function.

        End With

        FileClose(1)

    End Sub

Visual C#

 

private void SaveToolStripButton_Click(object sender, EventArgs e)

        {

            Stream myStream;

            string nStr = txtEditor.Text;

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "Basic52 Files (*.bas)|*.bas|All files (*.*)|*.*";

            saveFileDialog1.FilterIndex = 2;

            saveFileDialog1.RestoreDirectory = true;

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)

            {

                if ((myStream = saveFileDialog1.OpenFile()) != null)

                {

                    using (StreamWriter sw = new StreamWriter(myStream))

                    sw.Write(nStr);               

               }

            }

 

        }

 

 

Visual C++

 

private: System::Void SaveToolStripButton_Click(System::Object^  sender, System::EventArgs^  e)

{

SaveFileDialog1->Filter = "Basic Files (*.bas)|*.bas|Text Files (*.txt)|*.txt|All Files (*.*)|*.*";

if(SaveFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)

{

System::IO::StreamWriter ^ sr = gcnew System::IO::StreamWriter(SaveFileDialog1->FileName);

       sr->Write(txtEditor->Text);

       sr->Close();

 }

 }

This should give you an idea of how all three languages are structured. As you can see with the exception of how Operators are used there is very little difference.             

tbar68  Sunday, October 04, 2009 5:01 PM

You can use google to search for other answers

Custom Search

More Threads

• Documentation Compiler - Sandcastle
• make language filter fix
• Helpprovider helpnamespace problem?
• Sandcastle March CTP - & in title attribute causes BuildAssembler exception
• Warn: CopyFromIndexComponent: Entries for the key...
• Editing Values in a ListBox Access 2007
• Anyone know if VS 2005 is compliant with Adobe Captivate
• Full text search in Sandcastle gerated CHM files
• Broken Links in Help->Index for VS 2008
• Document Explorer takes 2-3 minutes to load