question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WindowFromPoint malfunctions for x64 WPF application.

See original GitHub issue
  • .NET Core Version: (6.0.202)
  • Windows version: (Windows 11 21H2)
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Test for 4.7.1 reproduced successfully.

Problem description: Native function WindowFromPoint cannot be used to obtain handle to windows in x64 WPF application.
When attempting to get a window from .NET WPF process(no matter it’s a remote process or the current process), it returns the ‘background’ window as if the WPF window does not exist.
This problem disappeared if PlatformTarget property in ‘.csproj’ file is set to x86(default x64 in the following project).

Minimal repro: WpfApp1.zip in which is a draggable cross. Dragging the cross to any point at the window itself does not work.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Qiu233commented, Jul 12, 2022

Thanks. Problem solved.

1reaction
Qiu233commented, Jul 12, 2022

@Qiu233 What is it's tmodloader 1.4.3.6 means?

It’s a modified game, running in .NET 6 x64.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - WindowFromPoint doesn't work correctly on 64bit .NET ...
Windows XP Pro 64 bit - running 32 bit app WindowFromPoint takes 2 32 bit integers off the stack regardless of what the...
Read more >
WindowFromPoint in 64Bit application
Hi, I have an application which running smoothly in 32bit, but my client now requested it make it as 64bit. So i've gone...
Read more >
WPF Apps crash on Windows 10/11 after ...
My Windows 11 dev system installed updates last night, and today when I run any of our WPF apps (either under the Visual...
Read more >
MouseGetPos fails in Visual Studio - Ask for Help
In the main (code) window of Visual Studio 2010 I get an empty handle from both methods of MouseGetPos. The DllCall does return...
Read more >
Microsoft Known Issues
Microsoft often releases patches to address security and reliability issues. Sometimes, patches itself will introduce unprecedented issues after installing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found