Application running in idle thread

Is there an easy way to set the local XOJO application to run in the idle thread (low priority) , in windows?

You can use SetPriorityClass via declares:

Function SetPriority(PriorityLevel As Integer) As Integer
  ' PriorityLevel is one of the values listed at the above link
  ' Returns the last Win32 error code, or 0 on success
  #If TargetWin32 Then
    Declare Function GetCurrentProcessId Lib "Kernel32" () As Integer
    Declare Function OpenProcess Lib "Kernel32" (Access As Integer, Inherit As Boolean, ProcessID As Integer) As Integer
    Declare Function SetPriorityClass Lib "Kernel32" (Handle As Integer, Priority As Integer) As Boolean
    Declare Sub CloseHandle Lib "Kernel32" (Handle As Integer)
    Declare Function GetLastError Lib "Kernel32" () As Integer
    Const PROCESS_SET_INFORMATION = &h200
    
    Dim LastError As Integer
    Dim ProcessHandle As Integer = OpenProcess(PROCESS_SET_INFORMATION, False, GetCurrentProcessId)
    If ProcessHandle <> 0 Then
      If Not SetPriorityClass(ProcessHandle, PriorityLevel) Then
        LastError = GetLastError()
      End If
      CloseHandle(ProcessHandle)
    Else
      LastError = GetLastError()
    End If
    Return LastError
  #endif
End Function