In my current app, I want to get the current top window in general, not the top window of my app.
When I tried to use the Win32 function GetTopWindow(), I get the wrong function returning wxWindow * instead of HWND, because wxApp also has a function with the exact same name and it takes precedence.
Running under Win 10 & MSVC 2015, wxWidgets 3.1
Win32 API GetTopWindow() - how to call it
Win32 API GetTopWindow() - how to call it
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: Win32 API GetTopWindow() - how to call it
You probably just need to use the scope operator. ie use ::GetTopWindow() to call the global function instead of class method with the same name.
Re: Win32 API GetTopWindow() - how to call it
[edit]
After my first cut at my reply, I found the function wxWindow::GetHWND() and it looks like what I think I need, though that is still to be confirmed, but it got me further along the road.
[/edit]
I'm, afraid, that does not do what I need. It compiles and runs, but I would need to transform the returned wxWindow * to HWND - two completely different things
After my first cut at my reply, I found the function wxWindow::GetHWND() and it looks like what I think I need, though that is still to be confirmed, but it got me further along the road.
Code: Select all
wxWindow *pWin = GetTopWindow();
HWND hWnd = pWin->GetHandle();
I'm, afraid, that does not do what I need. It compiles and runs, but I would need to transform the returned wxWindow * to HWND - two completely different things
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2