How to get higher priority for an application Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Earned a small fee
Earned a small fee
Posts: 10
Joined: Sun Sep 23, 2007 10:51 pm

How to get higher priority for an application

Post by xpz » Sat Feb 21, 2009 6:33 am

Whether there is a way to make the application with higher priority.

The thread has wxThread::SetPriority(). How to do it for an application through wxWidget function?

If use windows function SetPriorityClass(), it need "HANDLE hProcess", how to get it in wxWidgets?

I live to help wx-kind
I live to help wx-kind
Posts: 176
Joined: Mon Jun 16, 2008 11:07 am
Location: Kaunas

Post by Romas » Sat Feb 21, 2009 8:41 am


If you use SetPriorityClass (which is part of WinAPI), then you might want to use GetCurrentProccess :P

Earned a small fee
Earned a small fee
Posts: 16
Joined: Mon Sep 08, 2008 2:20 pm

Post by venkat_sp » Mon Feb 23, 2009 9:59 am

You can use GetCurrentProcess() which will return the handle.

Experienced Solver
Experienced Solver
Posts: 72
Joined: Fri Feb 20, 2009 7:13 pm
Location: $(#wx)\src

Post by computerquip » Mon Feb 23, 2009 1:07 pm

If you are using Linuxthreads (pthreads, ie, not NPTL) then you could exploit the non-POSIX compliance of the library by calling sched_setscheduler() or setpriority()
(man 2 sched_setscheduler or man 2 setpriority).

Post Reply