CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Managed C++ and C++/CLI
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old July 11th, 2005, 07:00 AM
    amgturk amgturk is offline
    Junior Member
     
    Join Date: Jul 2005
    Posts: 15
    amgturk is an unknown quantity at this point (<10)
    Closing a program

    hii

    can anybody tell me how can ı close any program(for example:winamp) from my project? means from my c++.net project.
    Reply With Quote
      #2    
    Old July 11th, 2005, 07:12 AM
    pranavsharma pranavsharma is offline
    Member
     
    Join Date: Apr 2005
    Location: INDIA
    Posts: 35
    pranavsharma is on a distinguished road (10+)
    Thumbs up Re: Closing a program

    Using API in Visual Basic i have retrived all the runnig windows then after getting handle of that window i have passed virtual key events i.e. sendkey. These keyevents could be used to close the window too. Otherwise its difiicult to get hold of any third party tool or application if they dont provide its API or library to work on.

    Regards
    PS
    Reply With Quote
      #3    
    Old July 11th, 2005, 07:17 AM
    amgturk amgturk is offline
    Junior Member
     
    Join Date: Jul 2005
    Posts: 15
    amgturk is an unknown quantity at this point (<10)
    Re: Closing a program

    thank you for your response
    can u give an example or say any kind of function ı can use in my project?
    Reply With Quote
      #4    
    Old July 14th, 2005, 08:08 PM
    Jinto's Avatar
    Jinto Jinto is offline
    Member
     
    Join Date: Nov 2003
    Location: Seattle, WA
    Posts: 265
    Jinto is on a distinguished road (30+)
    Re: Closing a program

    Find the process and kill it.

    Code:
    System::Diagnostics::Process* p[] = System::Diagnostics::Process::GetProcessesByName( S"Winamp" );
    for( int i = 0; i < p->Count; i++ ) {
    	p[i]->Kill( );
    }
    __________________
    "Lose it? It means go crazy...nuts...insane...bonzo...no longer in possession of one's faculties...3 fries short of a happy meal...WACKO!!!"
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Managed C++ and C++/CLI


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 09:22 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009