I am again asking for thorough testing.
I do not know how to set the process priority, if I choose "Run as Administrator"
Pako
Code: Select all
if waitForCompletion or triggerEvent:
processInformation.fMask = SEE_MASK_NOCLOSEPROCESSCode: Select all
processInformation.fMask = SEE_MASK_NOCLOSEPROCESSCode: Select all
if priority != 2:
try:
SetPriorityClass(processInformation.hProcess, PRIORITY_FLAGS[priority])
except:
pid = windll.kernel32.GetProcessId(processInformation.hProcess)
# Run this command hidden as Administrator: C:\Windows\System32\wbem\wmic.exe process where processid={pid} CALL setpriority {PRIORITY_FLAGS[priority]}
I fear that when using ShellExecuteEx it will not be possible for this action returned results (such as Dir).blackwind wrote:And don't forget to add "Run as Administrator" to Windows Command.
Code: Select all
import os, time
filename = os.path.join(os.getenv("TEMP"), "EventGhost-output-%s.txt" % time.time())This is a very good idea. That solves my problem.I absolutely agree that the existence of two actions (with almost the same functions) is unnecessary.blackwind wrote:What I would do is simply use ShellExecuteEx for everything, redirect output to a file
Code: Select all
payload = "The result to use as payload"Code: Select all
payload = "Use result as payload"Therefore, I believe the only possible solution is to create a separate unprivileged process strictly for COM communication, in much the same way that a number of other plugins (like AudioEndpoint) silently load an executable in the background to facilitate their functionality. This executable will communicate with Snarl via COM, and then needs to communicate back to EventGhost somehow (NOT via COM) to trigger the events. We should probably offer an API for the unprivileged process so other plugins that do COM can utilize it as well. Any thoughts on the best way to approach this?ComObjActive/ComObjGet may fail. UIA programs are probably only able to access the active objects of other UIA programs, not regular programs. For example, ComObjActive("Word.Application") will fail because Word is not marked for UI access. The reverse is also true: objects registered by UIA scripts can only be accessed by other UIA programs/scripts.
It seems feasible, but it is not the only option.blackwind wrote:Therefore, I believe the only possible solution is to create a separate unprivileged process strictly for COM communication, in much the same way that a number of other plugins (like AudioEndpoint) silently load an executable in the background to facilitate their functionality. This executable will communicate with Snarl via COM, and then needs to communicate back to EventGhost somehow (NOT via COM) to trigger the events. We should probably offer an API for the unprivileged process so other plugins that do COM can utilize it as well.