Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

RRLCoder

@RRLCoder
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Do we, as developers, have a UI responsibility?
    R RRLCoder

    Wow, I was surprised that this is even a question but pleased so many believe they are responsible for a user-friendly UI. Absolutely, even if the programmer is given specific specifications, they need to validate what the user experience will be. We do not program stuff just to move data around. Ultimately a user must interface with the information and when they do, it should be as intuitive as possible. Nothing is more crazy making for the user than a UI that is confusing or ambiguous when the designer and programmer (and the whole team) have the power to make clean sensible user experiences.

    The Lounge design hardware json question

  • C# unable to get handle when multiple instances of app are open in windows 8.1
    R RRLCoder

    Thanks... I just tried it both ways (fully qualified and just the iexplore) followed by: Console.WriteLine("IE Instance started... PID= " + myProc.Id + myProc.MainWindowHandle); I get an unhandled exception on the myProcess.MainWindowHandle no matter how much of a sleep or if i loop looking for the process id. Again, it works find if there is only 1 instance of the target app (iexplor in this case) open.

    C# help csharp

  • C# unable to get handle when multiple instances of app are open in windows 8.1
    R RRLCoder

    This is a bit long but shows most of what i've tried

    //typical prcess start
    string ProcToStart = "iexplore";
    int saveProcId;

    Process myProcess = new Process();
    myProcess.StartInfo.FileName = TargetFile;
    myProcess.StartInfo.Arguments = TargetArguments;
    	myProcess.StartInfo.UseShellExecute = true;  //seems to make no difference
    myProcess.Start();
    saveProcId = myProcess.Id;
    

    1-the simple approach, just trying to access myProcess.MainWindowHandle gets 0 even after a 10 min sleep

    2--here is one method looping through all processes
    I also tried this wraped in: while (proc.MainWindowHandle == IntPtr.Zero) (ran forever & didnt find a hit)....
    foreach (Process proc in Process.GetProcesses())
    {
    if (proc.Id == saveProcId)
    {
    Console.WriteLine(" PID: " + proc.Id + " Handle: " + proc.MainWindowHandle);
    }
    }

    3--Here is another attempt using ....GetProcessById
    try
    {
    ChosenProc = Process.GetProcessById(ProcId);
    Console.WriteLine("Your Process Info: " );
    Console.WriteLine(" Id: " + ChosenProc.Id
    + " Handle: " + ChosenProc.Handle
    + " MainWinHndl: " + ChosenProc.MainWindowHandle
    + " Name: " + ChosenProc.ProcessName);
    return true;
    }
    catch
    {
    ChosenProc = null;
    Console.WriteLine("Incorrect entry.");
    return false;
    }

    C# help csharp

  • C# unable to get handle when multiple instances of app are open in windows 8.1
    R RRLCoder

    I have been trying to start multiple instances of iexplore and other apps then get the handle so i can reposition it and other actions. It works great in Windows 7 using myProcess.Id to find the process and retrieve the MainWindowHandle. It also works in Windows 8.1 if there is only 1 instance of the application running. The Problem: When i get more than one instance of the app open in W8.1 I can not find the handle. I can get the process id but can't get the handle even by looping through all processes and looking for the handle. Help

    C# help csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups