IPB

Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

 
Reply to this topicStart new topic
Focuses, windows..., My component window blinking and doesn't give back a focus
K_S
post Oct 24 2011, 15:13
Post #1





Group: Members
Posts: 25
Joined: 14-September 11
Member No.: 93700



I'm writing plugin and have some problems with window (or Windows).
1) I want to create an invisible window (then working with this window in a thread and show in this thread). I just don't know how to hide a window on create. If I omit WS_VISIBLE my window is still visible. I create and hide this window with ShowWindow(SW_HIDE), but it's still shows my window for a fraction of second. Creating an invisible window should be so easy, but how to do this?
2) I don't know specifically how to return focus to Foobar window after closing my window. I have core_api::get_main_window() in Create method, but Foobar doesn't reciving focus after my window is closed. Only if I click in Foobar window and then close my window. What I'm missing?

BTW my plugin - it's 'cover downloader' - is here: http://www.mode.ugu.pl/foo_covdow.dll (still alpha/beta). I have a big problem with correctness of my writing in English, when I was walking to the school they taught Russian :-). Could somebody told me how I should call options in preferences, please...?
Go to the top of the page
+Quote Post
K_S
post Oct 25 2011, 11:50
Post #2





Group: Members
Posts: 25
Joined: 14-September 11
Member No.: 93700



I managed (hope so) with my problem with focus - if window of thread (progress bar and abort button) as parent has Foobar, then focus after closing my window is returned. I used my window as parent and had problems.

My problem with window 'invisible but blinking on Create' is irritating obstinate and I decided to dodge it, not resolve: show my window even when not needed (when thumbnails are downloaded from Google). It's something in WinAPI+ATL/WTL, not Foobar SDK, so maybe OT.

This post has been edited by db1989: Oct 25 2011, 13:14
Reason for edit: deleting quotation of now-deleted spam
Go to the top of the page
+Quote Post
foosion
post Oct 26 2011, 12:15
Post #3





Group: FB2K Moderator (Donating)
Posts: 4336
Joined: 24-February 03
Member No.: 5153



There are only few situations where you should need to manage the focus explicitly. As for creating an invisible window, WTL may be trying to help you by providing some default behaviour and window styles there. I remember I had a similar problem once. It is too far ago unfortunately, so I don't remember the details. It might help, if you posted the code that defines and creates your window.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
K_S
post Oct 29 2011, 09:13
Post #4





Group: Members
Posts: 25
Joined: 14-September 11
Member No.: 93700



Sorry for delayed reply

QUOTE (foosion @ Oct 26 2011, 12:15) *
There are only few situations where you should need to manage the focus explicitly.


I don't want to - only my component displays a few windows: main with thumbnails, additional with clicked picture, windows of threads - and if any of this window doesn't have 'core_api::get_main_window()' as parent, after closing my component main window focus doesn't return to Foobar main window. I made some errors, but I don't know where.

QUOTE
As for creating an invisible window, WTL may be trying to help you by providing some default behaviour and window styles there. I remember I had a similar problem once. It is too far ago unfortunately, so I don't remember the details. It might help, if you posted the code that defines and creates your window.


I created a better version of my plugin - showing downloaded thumbnails, I don't need to hide window - so this is not a big problem now for me.

Window class:

CODE
typedef CWinTraits<WS_TILEDWINDOW, WS_EX_TOOLWINDOW>//I've tested other combinations, of course
    CovWinTraits;
class CovWin : public CFrameWindowImpl<CovWin,CWindow,CovWinTraits>//CFrameWindowImpl, because I wanted a CreateSimpleStatusBar
        //Tested with CWindowImpl too


then I have a global object

CODE
static CovWin g_dlg; //I know - this could be done better, but I made this for quick experiments


and in function of context menu:

CODE
    try{//(...)
        if ( !g_dlg.IsWindow() ){
            RECT rc = {100, 100, 500, 700};//Later cfg_popup_window_placement
            g_dlg.Create(core_api::get_main_window(),rc);//this window is visible
        }
        g_dlg.ShowWindow(SW_HIDE);//A window will disappear, after blinking in Create();
//(...)

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th April 2014 - 14:50