diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5896b5d2ac..1a744378bb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,21 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-03-13 01:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbgf/hbgfwin/winapi.c + * Formatting. + + * contrib/hbwin/win_misc.c + ! Fixed WIN_SHELLEXECUTE() for WinCE (converted to stub). + ! Fixed WIN_RUNDETACHED() to compile with WinCE (4th parameter + is ignored and fixed to CREATE_NEW_CONSOLE). + + * contrib/hbwin/win_regc.c + ! HKEY_CURRENT_CONFIG disabled for WinCE builds. + + * source/rtl/gtwvt/gtwvt.c + ! Complete "layered" window support disabled for WinCE builds. + 2009-03-12 16:10 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/rtl/achoice.prg * tests/ac_test2.prg diff --git a/harbour/contrib/hbgf/hbgfwin/winapi.c b/harbour/contrib/hbgf/hbgfwin/winapi.c index fe1f2febd3..de7cb2e1b5 100644 --- a/harbour/contrib/hbgf/hbgfwin/winapi.c +++ b/harbour/contrib/hbgf/hbgfwin/winapi.c @@ -72,12 +72,12 @@ HB_FUNC( WINREGISTERCLASS ) wndclass.cbWndExtra = 0; wndclass.lpfnWndProc = WndProc; wndclass.hInstance = GetModuleHandle( NULL ); - wndclass.hIcon = LoadIcon ( NULL, IDI_APPLICATION ); - wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); - wndclass.hbrBackground = (HBRUSH)( COLOR_BTNFACE + 1 ); + wndclass.hIcon = LoadIcon( NULL, IDI_APPLICATION ); + wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); + wndclass.hbrBackground = ( HBRUSH ) ( COLOR_BTNFACE + 1 ); wndclass.lpszMenuName = NULL; - hb_retl( RegisterClass (&wndclass) ); + hb_retl( RegisterClass( &wndclass ) ); HB_TCHAR_FREE( lpszClassName ); } @@ -94,7 +94,7 @@ HB_FUNC( WINCREATESTDWINDOW ) CW_USEDEFAULT, CW_USEDEFAULT, ( HWND ) hb_parptr( 7 ), /* hWndParent */ ( HMENU ) hb_parptr( 8 ), /* hMenu or nId */ - GetModuleHandle( NULL ), NULL) ); + GetModuleHandle( NULL ), NULL ) ); HB_TCHAR_FREE( lpszClassName ); HB_TCHAR_FREE( lpszCaption ); @@ -102,12 +102,12 @@ HB_FUNC( WINCREATESTDWINDOW ) HB_FUNC( HB_FORMSHOWMODAL ) { - MSG msg; + MSG msg; ShowWindow( ( HWND ) hb_parptr( 1 ), 1 ); while( GetMessage( &msg, NULL, 0, 0 ) ) { - TranslateMessage( &msg ); + TranslateMessage( &msg ); DispatchMessage( &msg ); } } @@ -129,7 +129,7 @@ HB_FUNC( WINSETWINDOWTEXT ) { LPTSTR lpszText = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); - hb_retl( SetWindowText( (HWND) hb_parptr( 1 ), lpszText ) ); + hb_retl( SetWindowText( ( HWND ) hb_parptr( 1 ), lpszText ) ); HB_TCHAR_FREE( lpszText ); } @@ -166,19 +166,15 @@ HB_FUNC( WINCREATEMENU ) } -/* Some xBase for C language */ -#define IIF(x,y,z) ((x)?(y):(z)) - - HB_FUNC( WINADDMENUITEM ) { LPTSTR lpszText = NULL; MENUITEMINFO mii; - HMENU hSubMenu = ( !ISNIL(4) )? (HMENU) hb_parptr( 4 ):0; + HMENU hSubMenu = ( ! ISNIL( 4 ) ) ? ( HMENU ) hb_parptr( 4 ) : 0; mii.cbSize = sizeof( MENUITEMINFO ); - mii.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID | ((hSubMenu)? MIIM_SUBMENU:0); - mii.fState = IIF( ! hb_parl( 6 ), MFS_DISABLED, 0 ); + mii.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID | ( hSubMenu ? MIIM_SUBMENU : 0 ); + mii.fState = ! hb_parl( 6 ) ? MFS_DISABLED : 0; mii.wID = hb_parni( 5 ); mii.hSubMenu = hSubMenu; if( ISCHAR( 2 ) ) @@ -221,16 +217,16 @@ HB_FUNC( SETMENU ) HB_FUNC( SENDMESSAGE ) { - hb_retnl( (LONG) SendMessage( - (HWND) hb_parptr( 1 ), /* handle of destination window */ - (UINT) hb_parni( 2 ), /* message to send */ - (WPARAM) hb_parnint( 3 ), /* first message parameter */ - (LPARAM) hb_parnint( 4 ) /* second message parameter */ + hb_retnl( ( LONG ) SendMessage( + ( HWND ) hb_parptr( 1 ), /* handle of destination window */ + ( UINT ) hb_parni( 2 ), /* message to send */ + ( WPARAM ) hb_parnint( 3 ), /* first message parameter */ + ( LPARAM ) hb_parnint( 4 ) /* second message parameter */ ) ); } -LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { static PHB_DYNS pDynSym = NULL; @@ -287,7 +283,7 @@ HB_FUNC( WINSETWIDTH ) WORD wHeight; GetWindowRect( hWnd, &rct ); - wHeight = (WORD) ( rct.bottom - rct.top ); + wHeight = ( WORD ) ( rct.bottom - rct.top ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -319,7 +315,7 @@ HB_FUNC( WINSETHEIGHT ) WORD wWidth; GetWindowRect( hWnd, &rct ); - wWidth = (WORD) ( rct.right - rct.left ); + wWidth = ( WORD ) ( rct.right - rct.left ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -361,8 +357,8 @@ HB_FUNC( WINSETTOP ) WORD wHeight, wWidth; GetWindowRect( hWnd, &rct ); - wHeight = (WORD) ( rct.bottom - rct.top ); - wWidth = (WORD) ( rct.right - rct.left ); + wHeight = ( WORD ) ( rct.bottom - rct.top ); + wWidth = ( WORD ) ( rct.right - rct.left ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { @@ -404,8 +400,8 @@ HB_FUNC( WINSETLEFT ) WORD wHeight, wWidth; GetWindowRect( hWnd, &rct ); - wHeight = (WORD) ( rct.bottom - rct.top ); - wWidth = (WORD) ( rct.right - rct.left ); + wHeight = ( WORD ) ( rct.bottom - rct.top ); + wWidth = ( WORD ) ( rct.right - rct.left ); if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD ) { diff --git a/harbour/contrib/hbwin/win_misc.c b/harbour/contrib/hbwin/win_misc.c index 1b5e269b6b..3a1ac6ec9e 100644 --- a/harbour/contrib/hbwin/win_misc.c +++ b/harbour/contrib/hbwin/win_misc.c @@ -60,6 +60,9 @@ HB_FUNC( WIN_SHELLEXECUTE ) { +#if defined( HB_OS_WIN_CE ) + hb_retnint( -1 ); +#else LPTSTR lpOperation = ISCHAR( 2 ) ? HB_TCHAR_CONVTO( hb_parc( 2 ) ) : NULL; LPTSTR lpFile = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); LPTSTR lpParameters = ISCHAR( 4 ) ? HB_TCHAR_CONVTO( hb_parc( 4 ) ) : NULL; @@ -79,6 +82,7 @@ HB_FUNC( WIN_SHELLEXECUTE ) HB_TCHAR_FREE( lpParameters ); if( lpDirectory ) HB_TCHAR_FREE( lpDirectory ); +#endif } HB_FUNC( WIN_RUNDETACHED ) @@ -99,7 +103,11 @@ HB_FUNC( WIN_RUNDETACHED ) NULL, /* Process handle not inheritable */ NULL, /* Thread handle not inheritable */ FALSE, /* Set handle inheritance to FALSE */ +#if defined( HB_OS_WIN_CE ) + CREATE_NEW_CONSOLE, /* Creation flags */ +#else hb_parl( 4 ) ? CREATE_NO_WINDOW : CREATE_NEW_CONSOLE, /* Creation flags */ +#endif NULL, /* Use parent's environment block */ NULL, /* Use parent's starting directory */ &si, /* Pointer to STARTUPINFO structure */ diff --git a/harbour/contrib/hbwin/win_regc.c b/harbour/contrib/hbwin/win_regc.c index 763308258d..e35d28b7c5 100644 --- a/harbour/contrib/hbwin/win_regc.c +++ b/harbour/contrib/hbwin/win_regc.c @@ -63,8 +63,10 @@ static HKEY hb_regkeyconv( ULONG nKey ) return ( HKEY ) HKEY_CLASSES_ROOT; case 2: return ( HKEY ) HKEY_CURRENT_USER; +#if ! defined( HB_OS_WIN_CE ) case 3: return ( HKEY ) HKEY_CURRENT_CONFIG; +#endif case 0: case 4: return ( HKEY ) HKEY_LOCAL_MACHINE; diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 6a5ea14aed..321d573c01 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -1819,6 +1819,7 @@ static BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) if( !pWVT->hWnd ) hb_errInternal( 10001, "Failed to create WVT window", NULL, NULL ); +#if ! defined(HB_OS_WIN_CE) if( ! GetSystemMetrics( SM_REMOTESESSION ) ) { typedef BOOL ( WINAPI * P_SLWA )( HWND, COLORREF, BYTE, DWORD ); @@ -1847,6 +1848,7 @@ static BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) LWA_ALPHA /* DWORD dwFlags */ ); } } +#endif hb_gt_wvt_InitWindow( pWVT, pWVT->ROWS, pWVT->COLS );