Window Order...how to order correctly? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
extreme001
I live to help wx-kind
I live to help wx-kind
Posts: 192
Joined: Fri Dec 22, 2006 9:17 am
Location: Germany
Contact:

Window Order...how to order correctly?

Post by extreme001 » Tue May 26, 2009 11:48 am

Hi!

I'm having a problem placing a transparent window over a window of a foreign application. Description:

1. I create a transparent window with controls on it(Transparency color = RGB 255,0,255)

2. I'm searching, finding a window of a foreign application and set my window on it (via SetWindowPos(Foreignwindow, Mywindow)). it works.

3. If the foreign window is minimized, my window has to minize, too. After maximize...my window should maximize, too, but the order of the windows should be the same....my window over the other

4.If the user opens another window e.g. Notepad and Notepad is topwindow...my window should be visible, to as long as the foreign window is opened but the ordering should last. So notepad is at top, my window is the next and the foreign window.

Example:
-Foreign Window, above...
-Mytransparent window

Notepad opened...

-Foreign Window, above...
-Mytransparent window, above...
-Notepad

My transparent should always positioned over the window and always visible if the foreign window is visible. If the foreign window is not visible, my transparent window shouldn't be visible, too.

I think it's important that a window belongs to another window, e.g. the Main-GUI...it means the application gui(main gui) starts a window, i position my transwindow above. After that i want to click the main-gui but it switches to the other. if the other one is clicked it switches to maingui. What's that? How to set the Focus correctly?

How to do it? someone has an idea or code?
Thank you very much and excuse my bad english.

User avatar
doublemax
Moderator
Moderator
Posts: 15915
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Tue May 26, 2009 12:36 pm

i'm not sure if i understood the problem correctly, but maybe you can use the hWndInsertAfter parameter of SetWindowPos ?
Use the source, Luke!

extreme001
I live to help wx-kind
I live to help wx-kind
Posts: 192
Joined: Fri Dec 22, 2006 9:17 am
Location: Germany
Contact:

Post by extreme001 » Tue May 26, 2009 1:50 pm

Yes i tried it.

I set the hwndinsertafter to my Window. Example:

::SetWindowPos(ForeignWindow, Mywindow);

But the foreign window is a subwindow of the mainwindow...it always actrivates the wrong window. I clicked on the main window and it appears...after that i clicked the subwindow (under my transparent window) and then the focus or activation is lost. It shows the subwindow (under my transparent window) in background. The activation or focus is lost.

Any idea?

Thank you!!!

User avatar
doublemax
Moderator
Moderator
Posts: 15915
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Tue May 26, 2009 2:32 pm

i am pretty confused ;)

you are talking about "subwindow" "mainwindow" and "mywindow". So are there 3 different windows involved? I only thought of two.

Additionally, i thought it was only a display problem. I'm not sure how to fix the activation/focus issue, but maybe you can fiddle with other Win32 Api functions like SetForegroundWindow or SetFocus
Use the source, Luke!

extreme001
I live to help wx-kind
I live to help wx-kind
Posts: 192
Joined: Fri Dec 22, 2006 9:17 am
Location: Germany
Contact:

Post by extreme001 » Wed May 27, 2009 7:14 am

Oh sorry :D

I'm trying to overlap a window which is a subwindow of another window.

But there are still problems with focussing and activating.

Examples:
PokerTracker, www.pokertracker.com here it works with an overlay.

User avatar
doublemax
Moderator
Moderator
Posts: 15915
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Wed May 27, 2009 9:58 am

interesting, another application developed with wxWidgets ;)

Unfortunately, i'm not into poker and i don't have the slightest idea what this thing does and i don't think i'll be able to see the overlay in action unless i play a game?
Use the source, Luke!

extreme001
I live to help wx-kind
I live to help wx-kind
Posts: 192
Joined: Fri Dec 22, 2006 9:17 am
Location: Germany
Contact:

Post by extreme001 » Wed May 27, 2009 1:21 pm

Yes...but who told you that it's wxWidgets ? :shock:

OK...you don't have to play...it was just an example...
Thanks so much for your help. I hope i can solve it in the 600 years :D

extreme001
I live to help wx-kind
I live to help wx-kind
Posts: 192
Joined: Fri Dec 22, 2006 9:17 am
Location: Germany
Contact:

Post by extreme001 » Wed May 27, 2009 1:25 pm

There's also an overlay for TeamSpeak...

Image

User avatar
doublemax
Moderator
Moderator
Posts: 15915
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Wed May 27, 2009 1:28 pm

Yes...but who told you that it's wxWidgets ?
the heavy flicker when resizing was very suspicious (wxFlicker ;) )

And when you ctrl-alt-middleclick on a wxWidgets application, it shows a message box.

I would suspect that teamspeak uses a totally different method for the overlay (probably something like Fraps that hooks into the DirectX chain)
Use the source, Luke!

extreme001
I live to help wx-kind
I live to help wx-kind
Posts: 192
Joined: Fri Dec 22, 2006 9:17 am
Location: Germany
Contact:

Post by extreme001 » Wed May 27, 2009 3:28 pm

Nice! Didn't know that until today. Thanks! :-)

Did you see the listctrl? PokerTracker uses own headers and footers. Any idea how they created that? It looks very nice.

For my overlay i tried to set it as a child of the window, then iterated through all childs and set mine always as hwndInsertAfter via SetWindowPos(). No succes! I'm really pissed off.

User avatar
doublemax
Moderator
Moderator
Posts: 15915
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Wed May 27, 2009 4:20 pm

Did you see the listctrl? PokerTracker uses own headers and footers. Any idea how they created that? It looks very nice.
i'm not sure, but i don't think that's a wxListCtrl. Looks custom to me.
Use the source, Luke!

Post Reply