delphi - Get foreground CHILD window -
whenever skype in default view, tconversationwindow
's become children of tskmainform
window.
i having problems finding out tconversationwindow
active - it's not mdi interface - one tconversationwindow
visible, if tab/page.
when getforegroundwindow
, skype's mainform handle returned (tskmainform
). there way can foreground tconversationwindow
within skype?
this question of mine has screenshots of skype's default view, if need it. :)
edit: here screenshot of winspector hierachy:
edit2: tried going thru windows this:
procedure tform1.button1click(sender: tobject); function getclassname(handle: hwnd): string; var buffer: array[0..max_path] of char; begin windows.getclassname(handle, @buffer, max_path); result := string(buffer); end; var wnd: hwnd; skypewnd: hwnd; begin skypewnd := findwindow('tskmainform',nil); wnd := gettopwindow(skypewnd); while (getclassname(wnd) <> 'tconversationform') , (wnd <> 0) , (not iswindowvisible(wnd)) begin wnd := getnextwindow(wnd,gw_hwndnext); end; label1.caption := getclassname(wnd)+' - '+gethandletext(wnd); end;
the above supposed find visible window, when debug it, never enters begin end within while loop, , label1 displays "tchromemenu - chrometoolbar". when remove iswindowvisible check, atleast finds tconversationform. doing wrong?
edit3: placing iswindowvisible , getclassname check inside loop, , break when true, managed it. :)
by placing iswindowvisible , getclassname check inside loop, , break when true, managed it. :)
Comments
Post a Comment