User Profile

Collapse

Profile Sidebar

Collapse
CodeMann
CodeMann
Last Activity: Jun 14 '14, 09:57 PM
Joined: Jun 13 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hello Luk3r, well, as I sometimes like to say, "the littlest things can cause the biggest problems." I had originally created a mockup using your code suggestion, using a simple form with a list-box and button, which worked great.

    I then attempted to port this over to my main body of code in the real application and completely forgot to include the check if the MainWindowTitle was empty and wondered why procList had every...
    See more | Go to post

    Leave a comment:


  • Hello Luk3r, sorry I didn't post this sooner. It's entirely possible that I don't have the syntax correct on this Kill function. I've used a process.Kill before when I was looking to stop one specific process and it worked fine.

    However, what I'm trying to do here is kill any process with a window that doesn't correspond to my running application.

    When I debugged my code, I found that the list of processes being returned...
    See more | Go to post

    Leave a comment:


  • Also, to note, this Win32Exception occurred when I attempted the
    Code:
    process.Kill()
    See more | Go to post

    Leave a comment:


  • Hello Luk3r, you are correct, I wouldn't want to kill explorer.exe, so that window wouldn't be a problem.

    Interestingly though, the Win32Exception returned, with an exception message of "Access is denied" and this is on my own system, which has Administrator rights.

    I can't imagine that I would need elevated rights on my own box.
    Any thoughts on why I'm getting this, or perhaps more importantly, how to get...
    See more | Go to post

    Leave a comment:


  • Hello Luk3r and thanks for your reply. It does give me a list of running processes having a window without throwing the aforementioned exceptions.

    Curiously though, it did not show a Windows Explorer window that i had open, whereas TaskManager does show that window along with the others.

    Not sure why it excluded that window. Any ideas why that window wouldn't show up in the list?
    Thanks.
    See more | Go to post

    Leave a comment:


  • Process.GetProcesses(userName) throws InvalidOperationException

    Hello all. I came across a posting that addressed exactly what I'm trying to accomplish, i.e. "to get a list of Processes that have a window" by userName, which I found at http://bytes.com/topic/c-sharp/answe...if-app-running.

    I'm writing this in C-Sharp in Visual Studio 2010 and am testing it on a Windows Vista 32-bit system, but the final target will be a Windows 7 64-bit system.
    ...
    See more | Go to post
    Last edited by Niheel; Jun 13 '14, 08:05 PM. Reason: adding clickable link to reference question
No activity results to display
Show More
Working...