Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

How kill a process with the exe filename?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-14-2010, 11:54 AM
sitajony's Avatar
Basic4ppc Veteran
 
Join Date: Mar 2010
Location: France
Posts: 416
Awards Showcase
Beta Tester 
Total Awards: 1
Default How kill a process with the exe filename?

Hello, I need to kill a process before update it in C#, I can't use dzHW.dll coz I want get a one EXE file without dll file...
I searched for GetWindowThreadProcessId(IntPtr hwnd) and GetProcessById(Int32 id) but how get the process id? (PID) from an exe filename?
And how check if it's running? I tried with FindWindow but I need also the Windows Handle and I don't know the Window handle...

Anyone can help me?
Thanks for your replies!
Reply With Quote
  #2 (permalink)  
Old 07-14-2010, 12:44 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Assuming you are on the desktop you can get an array of Process objects representing running processes with Process.GetProcesses or Process.GetProcessesByName for a specific exe. Once you have a Process object for the exe you can have your wicked way with it.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 07-14-2010, 01:08 PM
sitajony's Avatar
Basic4ppc Veteran
 
Join Date: Mar 2010
Location: France
Posts: 416
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Yes I know how do it on Desktop but GetProcessByName doesn't exist on compact Framework... Is there an other way?

And with ToolHelp32? In dzHW library in VB I see some stuff with ToolHelp32 in VB but unable to understand how use it...

Last edited by sitajony : 07-14-2010 at 01:27 PM.
Reply With Quote
  #4 (permalink)  
Old 07-14-2010, 01:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

compact framework BenPas Blog
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 07-14-2010, 02:02 PM
sitajony's Avatar
Basic4ppc Veteran
 
Join Date: Mar 2010
Location: France
Posts: 416
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks! Finaly a great response, each time I found only few informations but not enough... Thanks again I hope it'll works
Reply With Quote
  #6 (permalink)  
Old 07-14-2010, 02:36 PM
sitajony's Avatar
Basic4ppc Veteran
 
Join Date: Mar 2010
Location: France
Posts: 416
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I don't know how use it, how know the window name, window handle or process id?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
hold process Byak@ Questions (Windows Mobile) 6 07-10-2010 07:04 PM
File being used by another process jschuchert Questions (Windows Mobile) 21 12-05-2009 05:44 PM
Can I Kill an Array? enonod Questions (Windows Mobile) 2 07-11-2009 09:59 AM
Getting Filename, not whole path Basseman Questions (Windows Mobile) 2 02-06-2009 09:49 PM
How to return the filename of the running application Fall Questions (Windows Mobile) 1 01-08-2009 05:30 AM


All times are GMT. The time now is 04:59 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0