The way my application functions, is determined by Skype's view mode, due to the fact that my application is looking for windows of class TConversationWindow
, which if in Default View is a child of tSkMainForm
, and if in Compact View, it is not a child of tSkMainForm
.
Here is what I tried to do:
Function IsCompactView:Boolean;
Var
Wnd : Hwnd;
Begin
Result := True;
Wnd := FindWindow('TConversationForm',nil);
if Wnd <> 0 then
begin
Wnd := GetParent(Wnd);
// Custom function that grabs the Window Text
if GetHandleText(Wnd) <> '' then
Result := False;
end;
End;
The above function will look for top-level (unless I am mistaken - the windows with no window parent) TConversationForm
's, by checking if their parent has text or not. If Skype is in Default View, the TConversationForm
's are children of tSkMainForm
, which always has some text. It works as it is supposed to.
Now for the actual problem: Whenever the user switches between the 2 views, the top-level TConversationForm
's are not "refreshed". They disappear alright, but in order for it to appear as a child of tSkMainForm
again (so the change is visible in Winspector Spy), you have to select it in Skype, and I cannot rely on the user to do that.
In case you dont know, here is the difference between the 2 views:
Compact View
Default View
If you need more info please let me know, thanks!