Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
First of all im a no pro and just started out learning c# a few days ago.

With that in mind i have the following code to handle a process:
        public bool Process_Handle(string ProcessName)
                Process[] ProcList = Process.GetProcessesByName(ProcessName);
                if (ProcList.Length == 0)
                    return false;
                    pHandel = ProcList[0].Handle;
                    return true;
            catch (Exception ex)
                Console.Beep(); Console.WriteLine("Process_Handle - " + ex.Message);  
                return false; 
When i try this with for example WinRAR it works i can check if its running or not etc but when i want to do this with for example iw5mp.exe*32 (in task manager), im guessing a 64bit program, it just says it didn't find the process.
Now my question is how can i make edit it so that process_handle will handle all processes including 64bit processes.

Huge thanks in advance, i've been frustrated with this for quite some time now
Posted 3-Nov-12 22:41pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

That is 'Call of duty''s program right?
Try writing iw5mp.exe as opposed to iw5mp.exe*32

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 285
1 DamithSL 265
2 CPallini 195
3 Maciej Los 175
4 George Jonsson 170
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911

Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100