FindWindow and SetForegroundWindow alternatives?

后端 未结 4 1784
忘掉有多难
忘掉有多难 2020-12-01 11:14

I am searching for alternatives to the old User32.dll version of switching to a different application with FindWindow() and SetForegroundWind

4条回答
  •  生来不讨喜
    2020-12-01 11:45

    An alternative to SetForeGroundWindow is VisualBasic's AppActivate

    Call it like this

    Microsoft.VisualBasic.Interaction.AppActivate("WindowTitle")
    

    Just because it is in the VisualBasic namespace doesn't mean you can't use it in C#.

    Full Documentation here

提交回复
热议问题