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

In summary: I've been trying to use the Process tab in Properties, but that doesn't seem to have any effect. In summary, if you try to start a program with QuickEdit enabled and set the priority to BelowNormal, you'll find that the shortcut doesn't take effect and the program will start at the default priority.
  • #1
CRGreathouse
Science Advisor
Homework Helper
2,844
0
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:
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:
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?
 
Technology news on Phys.org
  • #2
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 environment of the calling program so sometimes you had to run them with system("cmd appname.exe")
 
  • #3
mgb_phys said:
Can you read the contents of the .lnk and run the command yourself ?

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.

mgb_phys said:
Otherwise you are going to have to find the PID of the process once it has started and then attach to it

Yeah, I guess so. But once I do, how can I change the setting?
 

What is the purpose of turning on QuickEdit from a program?

The purpose of turning on QuickEdit from a program is to enable users to easily edit and manipulate text within a command line interface (CLI) or C# program. This allows for quicker and more efficient use of the program, as users can quickly select and copy text without needing to use the mouse or additional commands.

How do I turn on QuickEdit from a program?

To turn on QuickEdit from a program, you can use the Console.SetWindowsSize() and Console.SetBufferSize() methods in C# to set the console window size and buffer size to the desired dimensions. Then, use the Console.SetQuickEditMode() method to enable QuickEdit mode. Alternatively, you can use the command line argument "cmd /K echo off" to enable QuickEdit mode when launching the program.

What are the benefits of using QuickEdit in a program?

The benefits of using QuickEdit in a program include increased efficiency, as users can quickly select and copy text without needing to use additional commands or the mouse. It also allows for more precise text manipulation, as users can easily select specific portions of text to edit or copy.

Can I turn on QuickEdit in a program permanently?

Yes, you can turn on QuickEdit in a program permanently by setting the console window and buffer sizes to desired dimensions and using the Console.SetQuickEditMode() method. This will ensure that QuickEdit mode is always enabled when launching the program.

Are there any potential drawbacks to using QuickEdit in a program?

One potential drawback of using QuickEdit in a program is that it may interfere with certain keyboard shortcuts and commands that are used within the program. Additionally, if the console window or buffer size is set too small, it may limit the amount of text that can be edited or copied at one time. It's important to carefully consider the dimensions and settings when using QuickEdit in a program to avoid these potential drawbacks.

Similar threads

  • Programming and Computer Science
Replies
29
Views
5K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • Feedback and Announcements
Replies
3
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • STEM Career Guidance
Replies
1
Views
2K
  • Computing and Technology
2
Replies
52
Views
3K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
4
Views
5K
Back
Top