How to find a desktop window (by window name) in Windows 8.1 Update 2 OS, using the Win32 API FindWindow() in PowerShell environment?

后端 未结 4 990
鱼传尺愫
鱼传尺愫 2021-01-19 05:53

I don\'t remember having any problem finding a window in older Windows OS\'s, but, I\'m not succeeding in Windows 8.1 Update 2 OS, using PowerShell v4.0.

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-19 06:36

    I had a look at the C# implementation for this issue, and found 2 WNDCLASS structures: WNDCLASS_D AND WNDCLASS_I. The former is the traditional structure that uses strings as types, following the Win32 API. But the latter, uses IntPtr.Zero values for those WNDCLASS structure that take null string values. For this reason, specifying null string values will result in noting found because a null string value is not implicitly convertible to IntPtr.Zero.

提交回复
热议问题