Sending a mouse click to a button in the taskbar using C#

前端 未结 4 2023
借酒劲吻你
借酒劲吻你 2021-01-05 10:45

In an application that I am currently working on, a requirement is to bring a window of an external application to the foreground. Making Win32 API calls such as BringWindo

4条回答
  •  无人及你
    2021-01-05 11:12

    To be honest I've never had an issue bringing a window to the foreground on XP/Vista/2003/2000.

    You need to make sure you do the following:

    1. Check if IsIconic (minimized)
    2. If #1 results in true then call ShowWindow passing SW_RESTORE
    3. Then call SetForegroundWindow

    I've never had problems that I can think of doing it with those steps.

提交回复
热议问题