Re: Getting focused control
The Windows API GetFocus returns a window handle which type is HWND, not a IntPtr
So either your code is wrong or the Forum you chose for your problem is wrong.
Re: Getting focused control
This code is not written in C++. IntPtr is just the replacement for HWND in the language the code was written.
I ran the code in C++ as well. If it makes any difference I can write here the C++ version of this code.
My question is about the API calls. I think the idea behind that code is right, but for some reason it doesn't work all the times.
Re: Getting focused control