How can I make a child process window to appear modal in my process?

前端 未结 6 1179
青春惊慌失措
青春惊慌失措 2021-02-08 23:36

I have an application that calls some other utility application to set some settings for a particular device. That utility application is called using ShellExecuteEx.

So

6条回答
  •  星月不相逢
    2021-02-09 00:29

    You have two things to simulate: ownership and modality.

    To simulate ownership: You need to set the owner of your new child process window to your window. This should alleviate any z ordering issues. Though I don't know if this works from another process. If not then you might have to attach your thread input queues and then call it. Or use some other code injection technique.

    SetWindowLong , GWL_HWNDPARENT, 
    

    To simulate modality, I think you are on the right track with EnableWindow and the WaitForSingleObjectEx.

提交回复
热议问题