Commit dcedffea authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: misc small fixes.

parent 597f9cf7
...@@ -115,15 +115,6 @@ BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf ) ...@@ -115,15 +115,6 @@ BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf )
hInst = hInstance; // Store instance handle in our global variable hInst = hInstance; // Store instance handle in our global variable
// Check if the application is running.
// If it's running then focus its window.
hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
if( hwndMain )
{
SetForegroundWindow( hwndMain );
return TRUE;
}
// Register window class // Register window class
WNDCLASS wc; WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW ; wc.style = CS_HREDRAW | CS_VREDRAW ;
......
...@@ -124,7 +124,7 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst, ...@@ -124,7 +124,7 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst,
rect.bottom - rect.top - 2*(MENU_HEIGHT-1) - SLIDER_HEIGHT - 20, rect.bottom - rect.top - 2*(MENU_HEIGHT-1) - SLIDER_HEIGHT - 20,
p_parent, NULL, _hInst, (void *)this ); p_parent, NULL, _hInst, (void *)this );
// ShowWindow( p_child_window, 1 ); ShowWindow( p_child_window, SW_SHOW );
UpdateWindow( p_child_window ); UpdateWindow( p_child_window );
ReleaseWindow( (void*)p_child_window ); ReleaseWindow( (void*)p_child_window );
...@@ -165,6 +165,7 @@ void *VideoWindow::GetWindow( vout_thread_t *_p_vout, ...@@ -165,6 +165,7 @@ void *VideoWindow::GetWindow( vout_thread_t *_p_vout,
vlc_mutex_unlock( &lock ); vlc_mutex_unlock( &lock );
ShowWindow( (HWND)p_child_window, SW_SHOW );
return p_child_window; return p_child_window;
} }
...@@ -176,11 +177,11 @@ static void ReleaseWindow( intf_thread_t *p_intf, void *p_window ) ...@@ -176,11 +177,11 @@ static void ReleaseWindow( intf_thread_t *p_intf, void *p_window )
void VideoWindow::ReleaseWindow( void *p_window ) void VideoWindow::ReleaseWindow( void *p_window )
{ {
vlc_mutex_lock( &lock ); vlc_mutex_lock( &lock );
p_vout = NULL; p_vout = NULL;
ShowWindow( (HWND)p_window, SW_HIDE );
vlc_mutex_unlock( &lock ); vlc_mutex_unlock( &lock );
ShowWindow( (HWND)p_window, SW_HIDE );
SetForegroundWindow( p_parent );
} }
/*********************************************************************** /***********************************************************************
......
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
#if defined( UNDER_CE ) && defined(__MINGW32__) #if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */ /* This is a gross hack for the wince gcc cross-compiler */
#undef strerror
#define _off_t long #define _off_t long
char *strerror( int i_err ){ return "error message not available"; };
void abort (void){};
#endif #endif
#include "wince.h" #include "wince.h"
...@@ -77,10 +74,19 @@ DllMain( HANDLE hModule, DWORD fdwReason, LPVOID lpReserved ) ...@@ -77,10 +74,19 @@ DllMain( HANDLE hModule, DWORD fdwReason, LPVOID lpReserved )
/***************************************************************************** /*****************************************************************************
* Open: initialize interface * Open: initialize interface
*****************************************************************************/ *****************************************************************************/
static int Open ( vlc_object_t *p_this ) static int Open( vlc_object_t *p_this )
{ {
intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_thread_t *p_intf = (intf_thread_t *)p_this;
// Check if the application is running.
// If it's running then focus its window and bail out.
HWND hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
if( hwndMain )
{
SetForegroundWindow( hwndMain );
return VLC_EGENERIC;
}
// Allocate instance and initialize some members // Allocate instance and initialize some members
p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) ); p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL ) if( p_intf->p_sys == NULL )
...@@ -112,7 +118,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -112,7 +118,7 @@ static int Open ( vlc_object_t *p_this )
/***************************************************************************** /*****************************************************************************
* Close: destroy interface * Close: destroy interface
*****************************************************************************/ *****************************************************************************/
static void Close ( vlc_object_t *p_this ) static void Close( vlc_object_t *p_this )
{ {
intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_thread_t *p_intf = (intf_thread_t *)p_this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment