Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Turning on QuickEdit from a program (CLI/C#)

  1. Jan 21, 2009 #1

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    I'm trying to run a program, turn on QuickEdit (click-and-drag to copy, right-click to paste), and set the priority to BelowNormal.

    The following will start a program at BelowNormal priority:
    Code (Text):
    Process pr = new Process();
    pr.StartInfo.FileName = "blah.exe";
    pr.Start();
    pr.PriorityClass = ProcessPriorityClass.BelowNormal;
    The following will start a program with QuickEdit, assuming the shortcut is set up appropriately:
    Code (Text):
    Process pr = new Process();
    pr.StartInfo.FileName = "blah.lnk";
    pr.Start();
    But I can't find a way to do both. If I set the priority on the second, it sets it for the shortcut -- not the spawned process. (Not that I'm quick enough to grab it before it disappears, usually.)

    Thoughts?
     
  2. jcsd
  3. Jan 21, 2009 #2

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    My guess is that running the link just causes explorer to run the program and then return - so the process you are getting back is the explorer instance.
    Can you read the contents of the .lnk and run the command yourself ?
    Otherwise you are going to have to find the PID of the process once it has started and then attach to it

    There used to be a similair problem running command line apps with system() - they would inherit the enviroment of the calling program so sometimes you had to run them with system("cmd appname.exe")
     
  4. Jan 22, 2009 #3

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    I would be setting up the .lnk file for the purpose of the program, so that's not an issue. .lnk files let me choose settings like display types and QuickEdit, which are useful to me here.

    The program I'm working on just spawns a bunch of windows with different settings. In this case, (say) 8 instances of Pari running a program over similar settings. But I'd like to turn on QuickEdit since I may end up using some of the windows manually.

    Yeah, I guess so. But once I do, how can I change the setting?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Turning on QuickEdit from a program (CLI/C#)
  1. C programming (Replies: 9)

Loading...