如何使用默认的普通优先级运行我的exe [英] How to run my exe using default normal priority

查看:123
本文介绍了如何使用默认的普通优先级运行我的exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用c#创建了一个exe并运行它,但它运行在低于​​正常优先级。我希望它在普通优先级上运行。但使用视觉工作室。



通过视觉工作室设置是否可行。



什么我试过了:



流程proc = GetCurrentProcess(); proc.PriorityClass = ProcessPriorityClass.Normal。

但这会影响我的exe工作。

I've created an exe using c# and run it but it is running on Below Normal Priority. I want it to run on Normal priority. But using visual studio.

Is any way possible through visual studio settings.

What I have tried:

Process proc = GetCurrentProcess(); proc.PriorityClass = ProcessPriorityClass.Normal.
But this effecting my exe work.

推荐答案

可能你不能。

快速查看文档: ThreadPriority Enumeration(System.Threading) [ ^ ]

说:

Probably, you can't.
A quick look at the documentation: ThreadPriority Enumeration (System.Threading)[^]
says:
The operating system can also adjust the thread priority dynamically as the user interface's focus is moved between the foreground and the background.

因此,如果您将进程优先级设置为正常(默认值),那么当窗口没有输入焦点以保持用户体验时,它可以将其降级为低于正常值。 br />


可能您可以将其设置为高于正常以获得一些改进,但您可能会锁定您的用户界面现有的app。

So if you set the process priority to "Normal" (the default) windows can "downgrade" it to "Below Normal" when it doesn't have the input focus to maintain the user experience.

It may be that you can set it to "Above Normal" to get some improvement, but you risk "locking out" the UI for your existing app.


这篇关于如何使用默认的普通优先级运行我的exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆