Use QProcess to create a child process, then set its screen position

StackOverflow https://stackoverflow.com/questions/23612099

  •  20-07-2023
  •  | 
  •  

سؤال

I need to launch another program from my code but I also need to set its screen position? Is this possible using QT? Very simple In principal but as usual extremely difficult in QT...

هل كانت مفيدة؟

المحلول 2

This can be done by setting the dwX and dwY varibles In the STARTUPINFO struct and then setting dwFlags to STARTF_USEPOSITION.

Then call CreateProcess

نصائح أخرى

If the program you are calling allows it through the command line arguments then it is definitely possible.

in windows there is the option of providing the STARTUPINFO but that only works if the program uses CW_USEDEFAULT for its location

Otherwise you would need to use a debugger to hook into the relevant setLocation call and change the arguments, this is very hard without intimate knowledge of the program in question.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top