Killing a Process (Window) - Windows CE

This is a discussion on Killing a Process (Window) - Windows CE ; Hi, I am Using eVC and my apps runs on Windows CE 4.1 I want to kill a Window. There are 3 Processes Process 1, Process 2 and Process 3. ---------------------------------------------------------------------- Process 1 : Creates Process 2 ; Wait fors ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Killing a Process (Window)

  1. Killing a Process (Window)

    Hi,
    I am Using eVC and my apps runs on Windows CE 4.1

    I want to kill a Window.

    There are 3 Processes Process 1, Process 2 and Process 3.

    ----------------------------------------------------------------------

    Process 1 :

    Creates Process 2 ;
    Wait fors Exit for the Process Created ;

    ------
    ------
    exit ;
    ------------------------------------------------------------------------
    Process 2 :
    Creates a Window XYZ

    -----
    -----
    exit ;
    ------------------------------------------------------------------------
    Process 3:
    Gets Handle to Window XYZ using FindWindow.
    Destroys the Window Using Destroy Window.

    ----
    exit ;
    ------------------------------------------------------------------------
    Problem is the Wait in the Process 1 Does not get Broken.


    How do i do it. I dont know the Pid of the Process (Process 2
    Here).

    I Know only Window Name. Can I kill a Process which has Created
    the Window by the Name. I Know that there will be only one window of
    that name.


    How do i do it. I have used FindWindow and DestroyWindow. But it
    does not
    Work. Which other APIs I must use. Please Help.


    Please Explain. I am new to Windows Programming. Please explain in
    detail.


    Thanks,
    Ram

  2. Re: Killing a Process (Window)

    On 5 Mar 2004 04:05:20 -0800, vsrirama@rediffmail.com (Sriram) wrote:

    >Hi,
    > I am Using eVC and my apps runs on Windows CE 4.1
    >
    > I want to kill a Window.
    >
    > There are 3 Processes Process 1, Process 2 and Process 3.
    >
    >----------------------------------------------------------------------
    >
    > Process 1 :
    >
    > Creates Process 2 ;
    > Wait fors Exit for the Process Created ;
    >
    > ------
    > ------
    > exit ;
    >------------------------------------------------------------------------
    > Process 2 :
    > Creates a Window XYZ
    >
    > -----
    > -----
    > exit ;
    >------------------------------------------------------------------------
    > Process 3:
    > Gets Handle to Window XYZ using FindWindow.
    > Destroys the Window Using Destroy Window.
    >
    > ----
    > exit ;
    >------------------------------------------------------------------------
    > Problem is the Wait in the Process 1 Does not get Broken.
    >
    >
    > How do i do it. I dont know the Pid of the Process (Process 2
    >Here).
    >
    > I Know only Window Name. Can I kill a Process which has Created
    >the Window by the Name. I Know that there will be only one window of
    >that name.
    >
    >
    > How do i do it. I have used FindWindow and DestroyWindow. But it
    >does not
    > Work. Which other APIs I must use. Please Help.


    If all these processes are running your code, then I think you should
    make sure each responds to a WM_CLOSE message. Then you can send a
    WM_CLOSE message to the window you find with FindWindow. I'm pretty
    sure functions do exist to forcefully shut down a process, but believe
    they should be avoided unless absolutely necessary, and if you are
    responsible for the code, you can make sure they are not necessary.

    >
    >
    > Please Explain. I am new to Windows Programming. Please explain in
    >detail.


    I just don't have the patience to explain in detail. Neither would I
    have the patience to read such an explanation on-line. I strongly
    recommend reading at least one decent book on Windows programming.
    Petzold is the usual choice. I favor Rector and Newcomer. Boling's
    book on Windows CE programming is good for learning CE specifics, but
    not so much for learning basic Windows programming. Every book I've
    seen on Windows programming has flaws, so don't fret over getting the
    best; you won't know what you really need until you read at least one.

    My order for getting info (such as details about the books I
    mentioned):
    books I own
    google (http://groups.google.com/advanced_group_search)
    question in newsgroup

    >
    >
    > Thanks,
    > Ram


    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret, eMVP
    PenFact, Inc.
    500 Harrison Ave., Suite 3R
    Boston, MA 02118
    www.penfact.com

+ Reply to Thread