Hi,
My application window is in the foreground. How can I get a window handle located under my window ?
Hierarchy of windows
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Hierarchy of windows
Code: Select all | Expand
function Main()
local oWnd
DEFINE WINDOW oWnd FROM 100,100 TO 400,400 PIXEL TITLE "First Window"
@ 20,20 BUTTON "New Window" SIZE 200,50 PIXEL OF oWnd ;
ACTION ( CreateNextWindow( oWnd ), oWnd:GoTop() )
ACTIVATE WINDOW oWnd
return nil
function CreateNextWindow( oMain )
local oWnd
DEFINE WINDOW oWnd FROM 200,200 TO 500,500 PIXEL OF oMain
ACTIVATE WINDOW oWnd
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Hierarchy of windows
Also you can use the function
Code: Select all | Expand
BringWindowToTop( hWnd )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Hierarchy of windows
Rao, thank you for your reply. But I didn 't understand how it would help me ? There is a window of someone else's application under my window and I need to get a window handle of this someone else's application. In this case, using the FindWindow() function is not possible
Re: Hierarchy of windows
hi,
under HMG we have this Function
https://docs.microsoft.com/de-de/windows/win32/api/winuser/nf-winuser-getnextwindow?redirectedfrom=MSDN
under HMG we have this Function
https://docs.microsoft.com/de-de/windows/win32/api/winuser/nf-winuser-getnextwindow?redirectedfrom=MSDN
Code: Select all | Expand
HB_FUNC (GETNEXTWINDOW)
{
HWND hWnd = (HWND) HMG_parnl (1);
HWND hWndNext = GetWindow (hWnd, GW_HWNDNEXT);
HMG_retnl ((LONG_PTR) hWndNext );
}
GW_HWNDNEXT 2 Returns a handle to the window below the given window.
GW_HWNDPREV 3 Returns a handle to the window above the given window.
greeting,
Jimmy
Jimmy
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Hierarchy of windows
But I didn 't understand how it would help me ?
Sorry. Your question was different and my answer was different.
While adopting Mr. Jimmy's advice, you need not write all the 'C' code.
You can use the FWH function GetWindow() directly in your program with the same syntax.
Code: Select all | Expand
GetWindow( hWnd, 2 or 3 )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India