Page 1 of 1

Issue with Text Label at Task Bar

Posted: Fri Dec 12, 2008 2:48 pm
by Bikram Thapa
Hi Support,

I am developing a SDI MFC application(Unicode). The application has no main window.It simply sits on system tray and context menu is displayed from there. The class to implement trayicon is implemented in ChildView.cpp
The applicaton in
CMainFrame::LoadFlashMovie(CString moviePath, CString movieTitle)

uses these two functions

FPC_LoadMovie(hwndFlashPlayerControl,0,moviePath);
pFlashProjectorWnd->SetWindowText(movieTitle);

function to load swf files. I extended MFC sample4 translucency to be used in this application. All goes well except few things.

The sample4, when it runs is visible on taskbar by default. But my flash movies, when run have no taskbar by default.

To display taskbar I use the function
ModifyStyleEx(0, WS_EX_APPWINDOW);
Now the taskbar is visible but only the first character of the moviTitle is shown.

Also what is diff between FPC_LoadMovie and FPC_PutMovie. In our case the user can play multiple(different) movies at same time, though we force only one instance of one particular movie to be played at any given time. Which function should preferably be used in such a scenario?

Please guide.

Thanks & Regards
Bikram Thapa...

Re: Issue with Text Label at Task Bar

Posted: Fri Dec 12, 2008 4:20 pm
by Softanics
Thank you for your questions.

Bikram Thapa wrote:pFlashProjectorWnd->SetWindowText(movieTitle);
...
Now the taskbar is visible but only the first character of the moviTitle is shown.


Could you please show (a piece of code) me how do you create a window?

Bikram Thapa wrote:Also what is diff between FPC_LoadMovie and FPC_PutMovie. In our case the user can play multiple(different) movies at same time, though we force only one instance of one particular movie to be played at any given time. Which function should preferably be used in such a scenario?


FPC_LoadMovie loads a movie into a specified level. So you can play a few movies within a single f-in-box window at the same time.

If you don't need to show more than one movie, use FPC_PutMovie.

Thank you.

Posted: Sat Dec 13, 2008 6:20 am
by Bikram Thapa
Hi Support,
Here is the code snippet:

Code: Select all

m_hFPC = FPC_LoadRegisteredOCX();   
if (NULL == m_hFPC)
{
   AfxMessageBox(_T("FPC_LoadRegisteredOCX() failed"));
   return FALSE;
}
if (!FPCIsTransparentAvailable())
{
   AfxMessageBox(_T("Flash transparent is not available"));
   return FALSE;
}
RECT rc = { 0, 0, 640, 480 };

#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED           0x00080000
#endif // WS_EX_LAYERED

HWND hwndFlashPlayerControl = CreateWindowEx(WS_EX_LAYERED,
               (LPCTSTR)FPC_GetClassAtom(m_hFPC),
               NULL, WS_POPUP | WS_VISIBLE,
               rc.left, rc.top,
               rc.right,
               rc.bottom,
               m_hWnd, /*NULL*/
               NULL,
               NULL,
               NULL);
CTransparentFlashPlayerControlWnd* pFlashProjectorWnd = new CTransparentFlashPlayerControlWnd(nDX,mycmdMap[nDX].romName);//Pass nDX to uniquely identify each rom
   pFlashProjectorWnd->SubclassWindow(hwndFlashPlayerControl);      
pFlashProjectorWnd->SetWindowText(movieTitle);   
//pFlashProjectorWnd->ModifyStyleEx(0, WS_EX_APPWINDOW);
pFlashProjectorWnd->ShowWindow(SW_SHOW);
pFlashProjectorWnd->UpdateWindow();      
   FPC_LoadMovie(hwndFlashPlayerControl,0,moviePath);//FPC_PutMovie(hwndFlashPlayerControl,moviePath);            
FPC_PutStandardMenu(hwndFlashPlayerControl, FALSE);//Disable standard flash context menu
FPCSetEventListener(hwndFlashPlayerControl, FPCListener,(LPARAM)this);   
   
if(playSound.CompareNoCase(_T("true"))==0)
   FPC_EnableSound(m_hFPC, TRUE);        
else
   FPC_EnableSound(m_hFPC, FALSE);

return TRUE; //Function Ends



Regards
Bikram Thapa...

Posted: Sat Dec 13, 2008 6:24 am
by Softanics
Could you please change this part:

Code: Select all

HWND hwndFlashPlayerControl = CreateWindowEx(WS_EX_LAYERED,
               (LPCTSTR)FPC_GetClassAtom(m_hFPC),
               NULL, WS_POPUP | WS_VISIBLE,
               rc.left, rc.top,
               rc.right,
               rc.bottom,
               m_hWnd, /*NULL*/
               NULL,
               NULL,
               NULL);


into:

Code: Select all

HWND hwndFlashPlayerControl = CreateWindowExW(WS_EX_LAYERED,
               (LPCWSTR)FPC_GetClassAtomW(m_hFPC),
               NULL, WS_POPUP | WS_VISIBLE,
               rc.left, rc.top,
               rc.right,
               rc.bottom,
               m_hWnd, /*NULL*/
               NULL,
               NULL,
               NULL);


Does it solve the problem with the caption?

Thank you.

No Luck With Task Bar Text

Posted: Sat Dec 13, 2008 10:19 am
by Bikram Thapa
Hi,

I tried as you suggested, no, it did not work. I must add that the window is not shown on taskbar by default, I have to force it to be shown on the taskbar.

Code: Select all

pFlashProjectorWnd->ModifyStyleEx(0, WS_EX_APPWINDOW);
pFlashProjectorWnd->UpdateWindow();


Bikram Thapa...

Posted: Sat Dec 13, 2008 10:51 am
by Softanics
It seems I need a sample project to test...

My email is support (at) f-in-box.com

Thank you.

Posted: Tue Jan 06, 2009 3:49 am
by theomania
Hi,

I have experienced this problem and wonder if there is now a solution? I can easily reproduce the problem by simply compiling and running the sample04_Translucency MFC application as "Unicode" through VS properties, changing nothing else. The task bar will only show the first letter of the window title. Changing it back to multibyte and the issue is gone.

Thanks.

Posted: Tue Jan 06, 2009 5:08 pm
by Softanics
theomania wrote:I have experienced this problem and wonder if there is now a solution? I can easily reproduce the problem by simply compiling and running the sample04_Translucency MFC application as "Unicode" through VS properties, changing nothing else. The task bar will only show the first letter of the window title. Changing it back to multibyte and the issue is gone.


Could you please check this build:
http://f-in-box.com/TEMP/CCC67A8F-9CB9- ... in_box.zip

Thank you.

Posted: Wed Jan 07, 2009 3:19 am
by theomania
This build does appear to work. :)

I have the Windows DLL version with source code, how am I able to upgrade the package to one containing this update?

Posted: Wed Jan 07, 2009 1:52 pm
by Softanics
theomania wrote:This build does appear to work. :)

I have the Windows DLL version with source code, how am I able to upgrade the package to one containing this update?


Download it using the same link as usually. If you have any problems please write me to http://f-in-box.com/support.html

Thank you!

Yes it works

Posted: Fri Jan 09, 2009 7:43 am
by Bikram Thapa
Yes, Its working at my end too. Thanks a lot.