How to bring window on top of the process created through CreateProcess

前端 未结 2 1296
小蘑菇
小蘑菇 2021-01-13 06:33

I am launching a process from my application using CreateProcess API and I want to bring the window of the new process to top. Is there a way to do it? Do we have any flag o

2条回答
  •  醉话见心
    2021-01-13 07:02

    You need the window handle of the application you launched. If you don't have it, you could use the FindWindowA API call.

    Then use the SetFocus API call with the window handle as parameter.

    Related links:

    http://www.andreavb.com/tip020001.html
    http://msdn.microsoft.com/en-us/library/aa697422%28v=vs.71%29.aspx

提交回复
热议问题