hbwhat32

hbwhat32

Top  Previous  Next

c:\harbour\contrib\hbwhat32
wincorec.c
TypeFunctionSourceLine
HB_FUNC_REGISTERCLASS(void)
HB_FUNC( _REGISTERCLASS )
{
   WNDCLASS *wndclass = ( WNDCLASS *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value ;
   wndclass->lpfnWndProc   = __WndProc ;

   /*
   wndclass.style         = (ISNIL(1) ? (CS_HREDRAW | CS_VREDRAW | CS_OWNDC | CS_DBLCLKS)  : hb_parni(1) );
   wndclass.lpfnWndProc   = __WndProc ;
   wndclass.cbClsExtra    = ( ISNIL(2)  ? 0 : hb_parni(2)) ;
   wndclass.cbWndExtra    = ( ISNIL(3)  ? 0 : hb_parni(3)) ;
   wndclass.hInstance     = ( ISNIL(4)  ? GetModuleHandle(NULL) : (HANDLE) hb_parnl(4) ) ;
   wndclass.hIcon         = ( ISNIL(5)  ? LoadIcon(GetModuleHandle(NULL),"") : (HICON) hb_parnl(5) ) ;
   wndclass.hCursor       = ( ISNIL(6)  ? LoadCursor (NULL, IDC_ARROW) : (HCURSOR) hb_parnl(6) ) ;
   wndclass.hbrBackground = ( ISNIL(7)  ? (INT) COLOR_WINDOW  + 1 :  (HBRUSH) hb_parnl(7) ) ;
   wndclass.lpszMenuName  = (LPCSTR) ( !ISNIL(8) ? hb_parc(8) : NULL ) ;
   wndclass.lpszClassName = (LPCSTR) hb_parc(9) ;
   */

   hb_retl( RegisterClass (wndclass));
}
wincorec.c50
HB_FUNC_UNREGISTERCLASS(void)
HB_FUNC( _UNREGISTERCLASS )
{
   HANDLE hInst = ( ISNIL(2) ? GetModuleHandle(NULL) : (HANDLE) hb_parnl(2) ) ;

   hb_retl( UnregisterClass( hb_parc(1), (HINSTANCE) hInst ) ) ;
}
wincorec.c74
HB_FUNC_CREATEWINDOWEX(void)
HB_FUNC( _CREATEWINDOWEX )
{
   DWORD  dwExStyle  = (ISNIL(1)  ? 0 : hb_parnl(1)) ;
   LPCSTR cClass     = (LPCSTR) hb_parc(2);
   LPCSTR cTitle     = (LPCSTR) hb_parc(3);
   DWORD  nStyle     = (ISNIL(4)  ? 0 : (DWORD) hb_parnd(4) );
   int    x          = (ISNIL(5)  ? CW_USEDEFAULT : hb_parni(5));
   int    y          = (ISNIL(6)  ? CW_USEDEFAULT : hb_parni(6));
   int    nWidth     = (ISNIL(7)  ? CW_USEDEFAULT : hb_parni(7));
   int    nHeight    = (ISNIL(8)  ? CW_USEDEFAULT : hb_parni(8));
   HWND   hWndParent = (ISNIL(9)  ? (HWND) NULL : (HWND) hb_parnl(9)) ;
   HMENU  hMenu      = (ISNIL(10) ? (HMENU) NULL : (HMENU) hb_parni(10));
   HANDLE hInstance  = (ISNIL(11) ? GetModuleHandle( NULL ) : (HANDLE) hb_parnl(11));
   LPVOID lParam     = (ISNIL(12) ? NULL : (LPVOID) hb_parnl(12));

   HWND hWnd = CreateWindowEx( dwExStyle, cClass, cTitle,
                               nStyle, x, y, nWidth, nHeight,
                               hWndParent, hMenu, (HINSTANCE) hInstance, lParam )  ;

   hb_retnl( (LONG) hWnd );
}
wincorec.c86
HB_FUNC_CREATEMDIWINDOW(void)
HB_FUNC( _CREATEMDIWINDOW )
{
   LPCSTR cClass     = (LPCSTR) hb_parc(1);
   LPCSTR cTitle     = (LPCSTR) hb_parc(2);
   DWORD  nStyle     = (ISNIL(3)  ? WS_MAXIMIZE : (DWORD) hb_parnd(3) );
   int    x          = (ISNIL(4)  ? CW_USEDEFAULT : hb_parni(4));
   int    y          = (ISNIL(5)  ? CW_USEDEFAULT : hb_parni(5));
   int    nWidth     = (ISNIL(6)  ? CW_USEDEFAULT : hb_parni(6));
   int    nHeight    = (ISNIL(7)  ? CW_USEDEFAULT : hb_parni(7));
   HWND   hWndParent = (ISNIL(8)  ? (HWND) NULL : (HWND) hb_parnl(8)) ;
   HANDLE hInstance  = (ISNIL(9)  ? GetModuleHandle( NULL ) : (HANDLE) hb_parnl(9));
   LPARAM lParam     = (ISNIL(10) ? 0 : (LPARAM) hb_parnl(10));

   HWND hWnd = CreateMDIWindow( cClass, cTitle,nStyle,
                                x, y, nWidth, nHeight,
                                hWndParent, (HINSTANCE) hInstance, lParam ) ;
   hb_retnl( (LONG) hWnd );
}
wincorec.c112
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 pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 1 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c134
LRESULT CALLBACK__WndProc2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 2 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c163
LRESULT CALLBACK__WndProc3 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc3 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 3 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c192
LRESULT CALLBACK__WndProc4 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc4 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 4 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c221
LRESULT CALLBACK__WndProc5 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc5 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 5 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c250
LRESULT CALLBACK__WndProc6 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc6 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 6 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c278
LRESULT CALLBACK__WndProc7 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc7 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 7 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c307
LRESULT CALLBACK__WndProc8 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc8 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 8 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c336
LRESULT CALLBACK__WndProc9 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc9 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 9 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c365
LRESULT CALLBACK__WndProc10 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK __WndProc10 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   long int res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmPushLong( 10 );
      hb_vmDo( 5 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return( DefWindowProc( hWnd, message, wParam, lParam ));
}
wincorec.c394
HB_FUNCGETWNDPROC(void)
HB_FUNC( GETWNDPROC )
{

  switch ( hb_parni(1) )
  {
    case 10:
      hb_retptr( __WndProc10 ) ;
      return ;

    case 9:
      hb_retptr( __WndProc9 ) ;
      return ;

    case 8:
      hb_retptr( __WndProc8 ) ;
      return ;

    case 7:
      hb_retptr( __WndProc7 ) ;
      return ;

    case 6:
      hb_retptr( __WndProc6 ) ;
      return ;

    case 5:
      hb_retptr( __WndProc5 ) ;
      return ;

    case 4:
      hb_retptr( __WndProc4 ) ;
      return ;

    case 3:
      hb_retptr( __WndProc3 ) ;
      return ;

    case 2:
      hb_retptr( __WndProc2 ) ;
      return ;

    case 1:
      hb_retptr( __WndProc ) ;
      return ;

    default:
      hb_retptr( NULL ) ;
      return ;

  }

}
wincorec.c426
HB_FUNC_GETDLGPROC(void)
HB_FUNC( _GETDLGPROC )
{
    hb_retptr( __DlgProc ) ;
}
wincorec.c482
BOOL CALLBACK__DlgProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK __DlgProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static PHB_DYNS pSymTest = 0 ;
   BOOL res;

   if ( !pSymTest )
     pSymTest = hb_dynsymFind( "_PROCESSDLGMSG" );

   if ( pSymTest )
   {
      //hb_vmPushSymbol( pSymTest->pSymbol );
      hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) );
      hb_vmPushNil();
      hb_vmPushLong( (LONG ) hWnd );
      hb_vmPushLong( (LONG ) message );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );
      hb_vmDo( 4 );
      res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
      return FALSE ;
}
wincorec.c489
HB_FUNC_DIALOGBOX(void)
HB_FUNC( _DIALOGBOX )
{


  hb_retni( DialogBox( (ISNIL(1)  ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl(1) )  ,
                       (hb_parinfo(2)==HB_IT_STRING ? hb_parc(2) : MAKEINTRESOURCE( (WORD) hb_parni(2))) ,
                       (ISNIL(3) ?  NULL : (HWND) hb_parnl(3) )        ,
                       (DLGPROC) hb_parptr(4)
                     ));

}
wincorec.c519
HB_FUNC_DIALOGBOXINDIRECT(void)
HB_FUNC( _DIALOGBOXINDIRECT )
{

   hb_retni( DialogBoxIndirect( (ISNIL(1)  ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl(1) )   ,
                               (LPDLGTEMPLATE) hb_parc(2)  ,
                               (ISNIL(3) ?  NULL : (HWND) hb_parnl(3) )        ,
                               (DLGPROC) hb_parptr(4)
                             ));
}
wincorec.c534
HB_FUNC_CREATEDIALOG(void)
HB_FUNC( _CREATEDIALOG )
{

  hb_retnl( (ULONG) CreateDialog( (ISNIL(1)  ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl(1) )  ,
                                  (hb_parinfo(2)==HB_IT_STRING ? hb_parc(2) : MAKEINTRESOURCE( (WORD) hb_parni(2))) ,
                                  (ISNIL(3) ?  NULL : (HWND) hb_parnl(3) )        ,
                                  (DLGPROC) hb_parptr(4)
                                ) );
}
wincorec.c547
HB_FUNC_CREATEDIALOGINDIRECT(void)
HB_FUNC( _CREATEDIALOGINDIRECT )
{
  hb_retnl(
   (ULONG) CreateDialogIndirect(
            (ISNIL(1)  ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl(1) )   ,
            (LPDLGTEMPLATE) hb_parc(2) ,
            (ISNIL(3) ?  NULL : (HWND) hb_parnl(3) )        ,
            (DLGPROC) hb_parptr(4)
          ));
}


//-----------------------------------------------------------------------------

// Create dynamic dialog from the Harbour array

HB_FUNC( _MAKEDLGTEMPLATE )
wincorec.c560
HB_FUNC_MAKEDLGTEMPLATE(void)
{
   WORD *p, *pdlgtemplate ;
   WORD  nItems = hb_parni( 1, 4 ) ;
   int   i, nchar ;
   DWORD lStyle ;

   // Parameters: 12 arrays
   // 1 for DLG template
   // 11 for item properties

   pdlgtemplate = p = (PWORD) LocalAlloc (LPTR, 65534)  ; // 64k allow to build up to 255 items on the dialog

   //---------------

    lStyle = hb_parnl(1,3) ;

    // start to fill in the dlgtemplate information.  addressing by WORDs

    *p++ = 1                   ; // version
    *p++ = 0xFFFF                   ; // signature
    *p++ = LOWORD ( hb_parnl(1,1) ) ; // Help Id
    *p++ = HIWORD ( hb_parnl(1,1) ) ;

    *p++ = LOWORD ( hb_parnl(1,2) ) ; // ext. style
    *p++ = HIWORD ( hb_parnl(1,2) ) ;

    *p++ = LOWORD (lStyle)          ;
    *p++ = HIWORD (lStyle)          ;

    *p++ = (WORD)   nItems        ;  // NumberOfItems
    *p++ = (short)  hb_parni(1,5) ;  // x
    *p++ = (short)  hb_parni(1,6) ;  // y
    *p++ = (short)  hb_parni(1,7) ;  // cx
    *p++ = (short)  hb_parni(1,8) ;  // cy
    *p++ = (short)  0             ;  // Menu (ignored for now.)
    *p++ = (short)  0x00          ;  // Class also ignored

    if ( hb_parinfa(1,11) == HB_IT_STRING ) {
        nchar = nCopyAnsiToWideChar( p, TEXT( hb_parc(1,11) ) ) ;
        p += nchar   ;
      }
    else
      *p++ =0 ;

    // add in the wPointSize and szFontName here iff the DS_SETFONT bit on

    if ( (lStyle & DS_SETFONT ) ) {
      *p++ = (short) hb_parni(1,12) ;
      *p++ = (short) hb_parni(1,13) ;
      *p++ = (short) hb_parni(1,14) ;

      nchar = nCopyAnsiToWideChar( p, TEXT( hb_parc(1,15) ) ) ;
      p += nchar ;

    } ;

    //---------------
    // Now, for the items

   for ( i = 1 ; i <= nItems ; i++ ) {

      // make sure each item starts on a DWORD boundary
      p = lpwAlign (p) ;


      *p++ = LOWORD ( hb_parnl(2,i) ) ;    // help id
      *p++ = HIWORD ( hb_parnl(2,i) ) ;

      *p++ = LOWORD ( hb_parnl(3,i) ) ; // ext. style
      *p++ = HIWORD ( hb_parnl(3,i) ) ;

      *p++ = LOWORD ( hb_parnl(4,i) ) ; // style
      *p++ = HIWORD ( hb_parnl(4,i) ) ;

      *p++ = (short)  hb_parni(5,i)   ;  // x
      *p++ = (short)  hb_parni(6,i)   ;  // y
      *p++ = (short)  hb_parni(7,i)   ;  // cx
      *p++ = (short)  hb_parni(8,i)   ;  // cy

      *p++ = LOWORD ( hb_parnl(9,i) ) ;  // id
      *p++ = HIWORD ( hb_parnl(9,i) ) ;  // id   // 0;

      if ( hb_parinfa(10,i) == HB_IT_STRING ) {
          nchar = nCopyAnsiToWideChar(p, TEXT ( hb_parc(10,i)) ) ; // class
          p += nchar ;
         }
      else
         {
         *p++ = 0xFFFF ;
         *p++ = (WORD) hb_parni(10,i) ;
         }

      if ( hb_parinfa(11,i) == HB_IT_STRING ) {
         nchar = nCopyAnsiToWideChar(p, (LPSTR) hb_parc(11,i) ) ;  // text
         p += nchar ;
         }
      else
         {
         *p++ = 0xFFFF ;
         *p++ = (WORD) hb_parni(11,i) ;
         }


      *p++ = 0x00 ;  // extras ( in array 12 )


    } ;
    p = lpwAlign (p)  ;


    hb_retclen( (LPSTR) pdlgtemplate, ( (ULONG) p - (ULONG) pdlgtemplate ) ) ;

    LocalFree (LocalHandle (pdlgtemplate) ) ;

}
wincorec.c578
_winbmp.c
TypeFunctionSourceLine
HB_FUNCLOADBITMAP(void)
HB_FUNC( LOADBITMAP )
{
   hb_retnl( (LONG) LoadBitmap(
             ISNIL(1) ? GetModuleHandle( NULL ): (HINSTANCE) hb_parnl(1) ,
             hb_parinfo(2)==HB_IT_STRING ?
                       (LPCTSTR) hb_parcx( 2 ) :
                       MAKEINTRESOURCE( (WORD) hb_parni(2)) ) );
}
_winbmp.c39
HB_FUNCDRAWBITMAP(void)
HB_FUNC( DRAWBITMAP )
{
   HDC hDC = (HDC) hb_parnl( 1 );
   HDC hDCmem = CreateCompatibleDC( hDC );
   DWORD dwraster = (ISNIL(3))? SRCCOPY : hb_parnl(3);
   HBITMAP hBitmap = (HBITMAP) hb_parnl( 2 );
   BITMAP  bitmap;
   int nWidthDest = ( hb_pcount() >=5 && !ISNIL(6) )? hb_parni(6):0;
   int nHeightDest = ( hb_pcount()>=6 && !ISNIL(7) )? hb_parni(7):0;

   SelectObject( hDCmem, hBitmap );
   GetObject( hBitmap, sizeof( BITMAP ), ( LPVOID ) &bitmap );
   if( nWidthDest && ( nWidthDest != bitmap.bmWidth || nHeightDest != bitmap.bmHeight ))
   {
      StretchBlt( hDC, hb_parni(4), hb_parni(5), nWidthDest, nHeightDest, hDCmem,
                  0, 0, bitmap.bmWidth, bitmap.bmHeight, dwraster );
   }
   else
   {
      BitBlt( hDC, hb_parni(4), hb_parni(5), bitmap.bmWidth, bitmap.bmHeight, hDCmem, 0, 0, dwraster );
   }

   DeleteDC( hDCmem );
}
_winbmp.c52
HB_FUNCGETBITMAPSIZE(void)
HB_FUNC( GETBITMAPSIZE )
{
   PHB_ITEM aArray = _itemArrayNew(2) ;
   PHB_ITEM tmp ;
   BITMAP bm;
   HBITMAP hBmp = (HBITMAP) hb_parnl(1);

   GetObject(hBmp, sizeof(bm), &bm);

   tmp = _itemPutNL( NULL, bm.bmWidth );
   hb_arraySet( aArray, 1, tmp );
   _itemRelease( tmp );

   tmp = _itemPutNL( NULL, bm.bmHeight );
   hb_arraySet( aArray, 2, tmp );
   _itemRelease( tmp );

  _itemReturn( aArray );
  _itemRelease( aArray );
}
_winbmp.c77
HB_FUNCGETBITMAPDIMENSIONEX(void)
HB_FUNC( GETBITMAPDIMENSIONEX )
{
   SIZE  Size  ;
   PHB_ITEM aSize ;

   if  ( GetBitmapDimensionEx( (HBITMAP) hb_parnl( 1 ), &Size )  )
   {
      aSize = Size2Array( &Size ) ;
      _itemReturn( aSize );
      _itemRelease( aSize );
   }

}
_winbmp.c104
HB_FUNCSETBITMAPDIMENSIONEX(void)
HB_FUNC( SETBITMAPDIMENSIONEX )
{
   SIZE Size  ;
   PHB_ITEM aSize;
   PHB_ITEM temp;

   if ( SetBitmapDimensionEx( (HBITMAP) hb_parnl( 1 ),
                                  hb_parni( 2 )          ,
                                  hb_parni( 3 )          ,
                                  &Size
                                  ) )
   {

   aSize = hb_itemArrayNew(2);

   temp = _itemPutNL( NULL, Size.cx );
   hb_arraySet( aSize, 1, temp );
   hb_itemRelease( temp );

   temp = _itemPutNL( NULL, Size.cy );
   hb_arraySet( aSize, 2, temp );
   hb_itemRelease( temp );

   hb_itemReturn( aSize );
   hb_itemRelease( aSize );


   }

}
_winbmp.c126
HB_FUNCSETSTRETCHBLTMODE(void)
HB_FUNC( SETSTRETCHBLTMODE )
{
   hb_retni( SetStretchBltMode( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winbmp.c162
HB_FUNCSTRETCHBLT(void)
HB_FUNC( STRETCHBLT )
{
   hb_retl( StretchBlt( (HDC) hb_parnl( 1 )   ,
                        hb_parni( 2 )         ,
                        hb_parni( 3 )         ,
                        hb_parni( 4 )         ,
                        hb_parni( 5 )         ,
                        (HDC) hb_parnl( 6 )   ,
                        hb_parni( 7 )         ,
                        hb_parni( 8 )         ,
                        hb_parni( 9 )         ,
                        hb_parni( 10 )        ,
                        (DWORD) hb_parnl( 11 )
                        ) ) ;
}
_winbmp.c171
HB_FUNCCREATEBITMAP(void)
HB_FUNC( CREATEBITMAP )
{
   hb_retnl( (LONG) CreateBitmap( hb_parni( 1 )       ,
                                  hb_parni( 2 )       ,
                                  (UINT) hb_parni( 3 ),
                                  (UINT) hb_parni( 4 ),
                                  hb_parcx(5)
                                  ) ) ;
}
_winbmp.c192
HB_FUNCCREATEBITMAPINDIRECT(void)
HB_FUNC( CREATEBITMAPINDIRECT )
{
   CONST BITMAP *bmp = (BITMAP * ) hb_parc( 1 );//hb_param( 1,HB_IT_STRING )->item.asString.value;

   hb_retnl( (LONG) CreateBitmapIndirect( bmp ) ) ;
}
_winbmp.c209
HB_FUNCCREATECOMPATIBLEBITMAP(void)
HB_FUNC( CREATECOMPATIBLEBITMAP )
{
   hb_retnl( (LONG) CreateCompatibleBitmap( (HDC) hb_parnl( 1 ),
                                            hb_parni( 2 )      ,
                                            hb_parni( 3 )
                                            ) ) ;
}
_winbmp.c221
HB_FUNCCREATEDIBITMAP(void)
HB_FUNC( CREATEDIBITMAP )
{
   BITMAPINFOHEADER *bmih = (BITMAPINFOHEADER *) hb_parc( 2 );//hb_param( 2, HB_IT_STRING )->item.asString.value ;
   BITMAPINFO *bmi  = (BITMAPINFO *) hb_parc( 5 );//hb_param( 5, HB_IT_STRING)->item.asString.value ;

   hb_retnl( (LONG) CreateDIBitmap( (HDC) hb_parnl( 1 )  ,
                                    bmih                ,
                                    (DWORD) hb_parnl( 3 ),
                                    (VOID *) hb_parcx( 3 ),
                                    bmi                 ,
                                    (UINT) hb_parni( 6 )
                                    ) ) ;
}
_winbmp.c234
HB_FUNCCREATEDIBSECTION(void)
HB_FUNC( CREATEDIBSECTION )
{
   BITMAPINFO *bmi  = (BITMAPINFO *) hb_parc( 2 );//hb_param( 2, HB_IT_STRING)->item.asString.value ;
   VOID **ppBits = (VOID **) 0;

   hb_retnl( (LONG) CreateDIBSection( (HDC) hb_parnl( 1 )   ,
                                      bmi                  ,
                                      (UINT) hb_parni( 3 )  ,
                                      ppBits                ,
                                      (HANDLE) hb_parnl( 5 ),
                                      (DWORD) hb_parnl( 6 )
                                      ) ) ;

   hb_stornl((LONG) *ppBits, 4) ;
}
_winbmp.c255
HB_FUNCCREATEDISCARDABLEBITMAP(void)
HB_FUNC( CREATEDISCARDABLEBITMAP )
{
   hb_retnl( (LONG) CreateDiscardableBitmap( (HDC) hb_parnl( 1 ),
                                             hb_parni( 2 )      ,
                                             hb_parni( 3 )
                                             ) ) ;
}
_winbmp.c276
HB_FUNCMASKBLT(void)
HB_FUNC( MASKBLT )
{
   hb_retl( MaskBlt( (HDC) hb_parnl( 1 )    ,
                     hb_parni( 2 )          ,
                     hb_parni( 3 )          ,
                     hb_parni( 4 )          ,
                     hb_parni( 5 )          ,
                     (HDC) hb_parnl( 6 )    ,
                     hb_parni( 7 )          ,
                     hb_parni( 8 )          ,
                     (HBITMAP) hb_parnl( 9 ),
                     hb_parni( 10 )         ,
                     hb_parni( 11 )         ,
                     (DWORD) hb_parnl( 12 )
                     ) ) ;
}
_winbmp.c288
HB_FUNCBITBLT(void)
HB_FUNC( BITBLT )
{
   hb_retl( BitBlt( (HDC) hb_parnl( 1 )  ,
                    hb_parni( 2 )        ,
                    hb_parni( 3 )        ,
                    hb_parni( 4 )        ,
                    hb_parni( 5 )        ,
                    (HDC) hb_parnl( 6 )  ,
                    hb_parni( 7 )        ,
                    hb_parni( 8 )        ,
                    (DWORD) hb_parnl( 9 )
                    ) ) ;
}
_winbmp.c309
HB_FUNCPATBLT(void)
HB_FUNC( PATBLT )
{
   hb_retl( PatBlt( (HDC) hb_parnl( 1 )  ,
                    hb_parni( 2 )        ,
                    hb_parni( 3 )        ,
                    hb_parni( 4 )        ,
                    hb_parni( 5 )        ,
                    (DWORD) hb_parnl( 6 )
                    ) ) ;
}
_winbmp.c327
HB_FUNCSETROP2(void)
HB_FUNC( SETROP2 )
{
   hb_retni( SetROP2( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winbmp.c342
HB_FUNCSETBITMAPBITS(void)
HB_FUNC( SETBITMAPBITS )
{

   hb_retnl( (LONG) SetBitmapBits( (HBITMAP) hb_parnl( 1 ),
                                   (DWORD) hb_parclen( 2 )  ,
                                   (VOID *) hb_parcx( 2 )
                                   ) ) ;
}
_winbmp.c353
HB_FUNCSETDIBITS(void)
HB_FUNC( SETDIBITS )
{

   BITMAPINFO *bmi  = (BITMAPINFO *) hb_parc( 6 );//hb_param( 6, HB_IT_STRING)->item.asString.value ;



   // Your code goes here

   hb_retni( SetDIBits( (HDC) hb_parnl( 1 )    ,
                        (HBITMAP) hb_parnl( 2 ),
                        (UINT) hb_parni( 3 )   ,
                        (UINT) hb_parni( 4 )   ,
                        (VOID *) hb_parcx(5)    ,
                        bmi                    ,
                        (UINT) hb_parni( 7 )
                        ) ) ;
}
_winbmp.c366
HB_FUNCGETROP2(void)
HB_FUNC( GETROP2 )
{
   hb_retni( GetROP2( (HDC) hb_parnl( 1 ) ) ) ;
}
_winbmp.c390
HB_FUNCGETSTRETCHBLTMODE(void)
HB_FUNC( GETSTRETCHBLTMODE )
{
   hb_retni( GetStretchBltMode( (HDC) hb_parnl( 1 ) ) ) ;
}
_winbmp.c399
HB_FUNCSETDIBITSTODEVICE(void)
HB_FUNC( SETDIBITSTODEVICE )
{

   BITMAPINFO *bmi  = (BITMAPINFO *) hb_parc( 11 );//hb_param( 11, HB_IT_STRING)->item.asString.value ;

   hb_retni( SetDIBitsToDevice( (HDC) hb_parnl( 1 )  ,
                                hb_parni( 2 )        ,
                                hb_parni( 3 )        ,
                                (DWORD) hb_parnl( 4 ),
                                (DWORD) hb_parnl( 5 ),
                                hb_parni( 6 )        ,
                                hb_parni( 7 )        ,
                                (UINT) hb_parni( 8 ) ,
                                (UINT) hb_parni( 9 ) ,
                                (VOID *) hb_parcx(10) ,
                                bmi                  ,
                                (UINT) hb_parni( 12 )
                                ) ) ;
}
_winbmp.c410
HB_FUNCSTRETCHDIBITS(void)
HB_FUNC( STRETCHDIBITS )
{

   BITMAPINFO *bmi  = (BITMAPINFO *) hb_parc( 11 );//hb_param( 11, HB_IT_STRING)->item.asString.value ;

   hb_retni( StretchDIBits( (HDC) hb_parnl( 1 )   ,
                            hb_parni( 2 )         ,
                            hb_parni( 3 )         ,
                            hb_parni( 4 )         ,
                            hb_parni( 5 )         ,
                            hb_parni( 6 )         ,
                            hb_parni( 7 )         ,
                            hb_parni( 8 )         ,
                            hb_parni( 9 )         ,
                            (VOID *) hb_parcx(10)  ,
                            bmi                   ,
                            (UINT) hb_parni( 12 ) ,
                            (DWORD) hb_parnl( 13 )
                            ) ) ;
}


//-----------------------------------------------------------------------------

void Pic(HDC hDC, int x , int y , int dx , int dy , HBITMAP hBmp , COLORREF rgbTransparent , BOOL disabled)
_winbmp.c436
VOIDPic(HDC hDC, int x , int y , int dx , int dy , HBITMAP hBmp , COLORREF rgbTransparent , BOOL disabled)
{

   //  COLORREF rgbOld ;
     HDC      hDCMem ;
     HDC      hDCMem2 ;
     HBITMAP  hbmDefault ;

     HBITMAP  hbmTransMask ;
     HBRUSH   hBr  ;
     HBRUSH   hOld ;


     hDCMem       = CreateCompatibleDC(hDC) ;
     hDCMem2      = CreateCompatibleDC(hDC) ;
     hbmTransMask = CreateBitmap(dx,dy,1,1,NULL) ;


     SetBkColor(hDC, RGB(255,255,255)) ; //White)
     SetTextColor(hDC, RGB(0,0,0)) ;     //Black)

     hbmDefault=(HBITMAP)SelectObject(hDCMem, hBmp);
     SelectObject(hDCMem2, hbmTransMask)   ;

    // build mask based on transparent color.

     SetBkColor(hDCMem, rgbTransparent) ;
     BitBlt(hDCMem2, 0, 0, dx, dy, hDCMem, 0, 0, SRCCOPY) ;

    if( disabled)
      {
        hBr=CreateSolidBrush(GetSysColor(COLOR_BTNHIGHLIGHT));
        hOld=(HBRUSH)SelectObject(hDC,hBr)  ;
        BitBlt(hDC, x+1, y+1, dx-2, dy-2, hDCMem2, 0, 0, 12060490) ;
        SelectObject(hDC,hOld) ;
        DeleteObject(hBr)      ;

        hBr=CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW)) ;
        hOld=(HBRUSH)SelectObject(hDC,hBr) ;
        BitBlt(hDC, x, y, dx-2, dy-2, hDCMem2, 0, 0, 12060490) ;
        SelectObject(hDC,hOld) ;
        DeleteObject(hBr) ;
      }
    else
      {
        BitBlt(hDC, x, y, dx, dy, hDCMem, 0, 0, SRCINVERT) ;
        BitBlt(hDC, x, y, dx, dy, hDCMem2, 0, 0, SRCAND)   ;
        BitBlt(hDC, x, y, dx, dy, hDCMem, 0, 0, SRCINVERT) ;
      }


    SelectObject(hDCMem, hbmDefault);
    SelectObject(hDCMem2, hbmDefault);
    DeleteObject(hbmTransMask);

    DeleteDC(hDCMem) ;
    DeleteDC(hDCMem2) ;

    return ;

}


//-----------------------------------------------------------------------------

_winbmp.c464
HB_FUNCDRAWGLYPH(void)
HB_FUNC( DRAWGLYPH )
   {
    Pic(    (HDC) hb_parni(1),
                  hb_parni(2),
                  hb_parni(3),
                  hb_parni(4),
                  hb_parni(5),
        (HBITMAP) hb_parni(6),
       (COLORREF) hb_parnl(7),
                  hb_parl(8));
    return;
   }





//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI DrawStateA( IN HDC, IN HBRUSH, IN DRAWSTATEPROC, IN LPARAM, IN WPARAM, IN int, IN int, IN int, IN int, IN UINT);

//The DrawState function displays an image and applies a visual effect to indicate a state, such as a disabled or default state.


/*

HB_FUNC( DRAWSTATE )
{
   DRAWSTATEPROC drawstateProc ;

   // Your code goes here

   hb_retl( DrawState( (HDC) hb_parnl( 1 )   ,
                       (HBRUSH) hb_parnl( 2 ),
                       drawstateProc         ,
                       (LPARAM) hb_parnl( 4 ),
                       (WPARAM) hb_parnl( 5 ),
                       hb_parni( 6 )         ,
                       hb_parni( 7 )         ,
                       hb_parni( 8 )         ,
                       hb_parni( 9 )         ,
                       (UINT) hb_parni( 10 )
                     ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI LONG WINAPI GetBitmapBits( IN HBITMAP, IN LONG, OUT LPVOID);

// obsolete

/*

HB_FUNC( GETBITMAPBITS )
{
   LPVOID  lpVoid  ;

   // Your code goes here

   hb_retnl( (LONG) GetBitmapBits( (HBITMAP) hb_parnl( 1 ),
                                   hb_parnl( 2 )          ,
                                   lpVoid
                                   ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI GetDIBits( IN HDC, IN HBITMAP, IN UINT, IN UINT, OUT LPVOID, IN OUT LPBITMAPINFO, IN UINT);


// NOT FINISHED

/*
HB_FUNC( GETDIBITS )
{
   VOID *lpvBits ;
   BITMAPINFO *bmi  = (BITMAPINFO *) hb_param( 6, HB_IT_STRING)->item.asString.value ;

   hb_retni( GetDIBits( (HDC) hb_parnl( 1 )       ,
                        (HBITMAP) hb_parnl( 2 )   ,
                        (UINT) hb_parni( 3 )      ,
                        (UINT) hb_parni( 4 )      ,
                        ISNIL(5) ? NULL : lpvBits ,
                        bmi                       ,
                        (UINT) hb_parni( 7 )
                        ) ) ;

  hb_storc( lpvBits, 5) ;
}
*/


//-----------------------------------------------------------------------------
// WINGDIAPI DWORD WINAPI GetGlyphIndicesA( IN HDC, IN LPCSTR, IN int, OUT LPWORD, IN DWORD);

/*

HB_FUNC( GETGLYPHINDICESA )
{
   LPWORD lpWord ;

   // Your code goes here

   hb_retnl( (LONG) GetGlyphIndicesA( (HDC) hb_parnl( 1 )  ,
                                      (LPCSTR) hb_parcx( 2 ),
                                      hb_parni( 3 )        ,
                                      lpWord               ,
                                      (DWORD) hb_parnl( 5 )
                                      ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI DWORD WINAPI GetGlyphOutlineA( IN HDC, IN UINT, IN UINT, OUT LPGLYPHMETRICS, IN DWORD, OUT LPVOID, IN CONST MAT2 *);

/*

HB_FUNC( GETGLYPHOUTLINEA )
{
   LPGLYPHMETRICS lpglyphMetrics ;
   LPVOID         lpVoid         ;
   CONST          MAT2           ;

   // Your code goes here

   hb_retnl( (LONG) GetGlyphOutlineA( (HDC) hb_parnl( 1 )  ,
                                      (UINT) hb_parni( 2 ) ,
                                      (UINT) hb_parni( 3 ) ,
                                      lpglyphMetrics       ,
                                      (DWORD) hb_parnl( 5 ),
                                      lpVoid               ,
                                      &MAT2
                                      ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI AlphaBlend( IN HDC, IN int, IN int, IN int, IN int, IN HDC, IN int, IN int, IN int, IN int, IN BLENDFUNCTION);

// NT only ?

/*
HB_FUNC( ALPHABLEND )
{
   BLENDFUNCTION *bf = (BLENDFUNCTION *) hb_param( 11, HB_IT_STRING)->item.asString.value ;

   hb_retl( AlphaBlend( (HDC) hb_parnl( 1 ),
                        hb_parni( 2 )      ,
                        hb_parni( 3 )      ,
                        hb_parni( 4 )      ,
                        hb_parni( 5 )      ,
                        (HDC) hb_parnl( 6 ),
                        hb_parni( 7 )      ,
                        hb_parni( 8 )      ,
                        hb_parni( 9 )      ,
                        hb_parni( 10 )     ,
                        *bf
                        ) ) ;
}
*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI PlgBlt( IN HDC, IN CONST POINT *, IN HDC, IN int, IN int, IN int, IN int, IN HBITMAP, IN int, IN int);

/*

HB_FUNC( PLGBLT )
{
   CONST   POINT   ;

   // Your code goes here

   hb_retl( PlgBlt( (HDC) hb_parnl( 1 )    ,
                    &POINT                 ,
                    (HDC) hb_parnl( 3 )    ,
                    hb_parni( 4 )          ,
                    hb_parni( 5 )          ,
                    hb_parni( 6 )          ,
                    hb_parni( 7 )          ,
                    (HBITMAP) hb_parnl( 8 ),
                    hb_parni( 9 )          ,
                    hb_parni( 10 )
                    ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI SetDIBColorTable( IN HDC, IN UINT, IN UINT, IN CONST RGBQUAD *);

/*

HB_FUNC( SETDIBCOLORTABLE )
{
   CONST RGBQUAD ;

   // Your code goes here

   hb_retni( SetDIBColorTable( (HDC) hb_parnl( 1 ) ,
                               (UINT) hb_parni( 2 ),
                               (UINT) hb_parni( 3 ),
                               &RGBQUAD
                               ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI TransparentBlt(IN HDC,IN int,IN int,IN int,IN int,IN HDC,IN int,IN int,IN int,IN int,IN UINT);

// NT only ?

_winbmp.c532
_winbrsh.c
TypeFunctionSourceLine
HB_FUNCCREATESOLIDBRUSH(void)
HB_FUNC( CREATESOLIDBRUSH )
{
   hb_retnl( (LONG) CreateSolidBrush( (COLORREF) hb_parnl( 1 ) ) ) ;    // brush color
}
_winbrsh.c25
HB_FUNCCREATEPATTERNBRUSH(void)
HB_FUNC( CREATEPATTERNBRUSH )
{
   hb_retnl( (LONG) CreatePatternBrush((HBITMAP) hb_parnl( 1 ) ) ) ;    // bitmap handle
}
_winbrsh.c33
HB_FUNCCREATEDIBPATTERNBRUSH(void)
HB_FUNC( CREATEDIBPATTERNBRUSH )
{
   hb_retnl( (LONG) CreateDIBPatternBrush( (HGLOBAL) hb_parnl( 1 ),
                                           (UINT) hb_parni( 2 )
                                           ) ) ;
}
_winbrsh.c42
HB_FUNCCREATEBRUSHINDIRECT(void)
HB_FUNC( CREATEBRUSHINDIRECT )
{
   //PHB_ITEM br = hb_param( 1,HB_IT_STRING ) ;
   //LOGBRUSH *lb = (LOGBRUSH * ) br->item.asString.value;
   LOGBRUSH *lb = (LOGBRUSH * ) hb_parnl( 1 );

   hb_retnl( (LONG) CreateBrushIndirect( lb ) ) ;
}
_winbrsh.c56
HB_FUNCCREATEHATCHBRUSH(void)
HB_FUNC( CREATEHATCHBRUSH )
{

   hb_retnl( (LONG) CreateHatchBrush( hb_parni( 1 ), (COLORREF) hb_parnl(2) ) ) ;
}


//-----------------------------------------------------------------------------

// no prototype ?

/*

// WINGDIAPI COLORREF WINAPI GetDCBrushColor( IN HDC);

HB_FUNC( GETDCBRUSHCOLOR )
{
   hb_retnl( (ULONG) GetDCBrushColor( (HDC) hb_parnl( 1 ) ) ) ;
}

*/

//-----------------------------------------------------------------------------

// no prototype ?

_winbrsh.c69
HB_FUNCCREATEDIBPATTERNBRUSHPT(void)
HB_FUNC( CREATEDIBPATTERNBRUSHPT )
{
   BITMAPINFO *bmi = (BITMAPINFO *) hb_parc( 1 );//hb_param( 1,HB_IT_STRING )->item.asString.value;

   hb_retnl( (LONG) CreateDIBPatternBrushPt( bmi, (UINT) hb_parni( 2 ) ) ) ;
}
_winbrsh.c110
HB_FUNCFIXBRUSHORGEX(void)
HB_FUNC( FIXBRUSHORGEX )
{
   POINT *Point = (POINT *) hb_parc( 4 );//hb_param( 4,HB_IT_STRING )->item.asString.value;

   hb_retl( FixBrushOrgEx( (HDC) hb_parnl( 1 ),
                           hb_parni( 2 )      ,
                           hb_parni( 3 )      ,
                           Point
                           ) ) ;
}
_winbrsh.c123
HB_FUNCGETBRUSHORGEX(void)
HB_FUNC( GETBRUSHORGEX )
{
   POINT Point ;
   PHB_ITEM aPt;
   PHB_ITEM temp ;

   if ( GetBrushOrgEx( (HDC) hb_parnl( 1 ), &Point ) )
   {
     aPt = _itemArrayNew( 2 );

     temp = _itemPutNL( NULL, Point.x );
     hb_arraySet( aPt, 1, temp );
     _itemRelease( temp );

     temp = _itemPutNL( NULL, Point.y );
     hb_arraySet( aPt, 2, temp );
     _itemRelease( temp );

     _itemReturn( aPt );
     _itemRelease( aPt );
   }
}
_winbrsh.c139
HB_FUNCSETBRUSHORGEX(void)
HB_FUNC( SETBRUSHORGEX )
{

   POINT Point ;
   PHB_ITEM aPt;
   PHB_ITEM temp ;

   if ( SetBrushOrgEx( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ), &Point) )
   {
     aPt = _itemArrayNew( 2 );

     temp = _itemPutNL( NULL, Point.x );
     hb_arraySet( aPt, 1, temp );
     _itemRelease( temp );

     temp = _itemPutNL( NULL, Point.y );
     hb_arraySet( aPt, 2, temp );
     _itemRelease( temp );

     _itemReturn( aPt );
     _itemRelease( aPt );

   }

}
_winbrsh.c169
_wincall.c
TypeFunctionSourceLine
RESULTDynaCall(int Flags, DWORD lpFunction, int nArgs, DYNAPARM Parm[], LPVOID pRet, int nRetSiz)
RESULT DynaCall(int Flags, DWORD lpFunction,
                                  int nArgs, DYNAPARM Parm[],
                                  LPVOID pRet, int nRetSiz)
{
   RESULT Res = { 0 };
#if defined(HB_WINCE) || defined(HB_OS_WIN_64)
   HB_SYMBOL_UNUSED( Flags );
   HB_SYMBOL_UNUSED( lpFunction );
   HB_SYMBOL_UNUSED( nArgs );
   HB_SYMBOL_UNUSED( Parm );
   HB_SYMBOL_UNUSED( pRet );
   HB_SYMBOL_UNUSED( nRetSiz );
#else
   // Call the specified function with the given parameters. Build a
   // proper stack and take care of correct return value processing.
   int     i, nInd, nSize;
   DWORD   dwEAX, dwEDX, dwVal, *pStack, dwStSize = 0;
   BYTE   *pArg;

   // Reserve 256 bytes of stack space for our arguments
   _asm mov pStack, esp
   _asm sub esp, 0x100

   // Push args onto the stack. Every argument is aligned on a
   // 4-byte boundary. We start at the rightmost argument.
   for(i = 0; i < nArgs; i++)
   {
      nInd  = (nArgs - 1) - i;
      // Start at the back of the arg ptr, aligned on a DWORD
      nSize = (Parm[nInd].nWidth + 3) / 4 * 4;
      pArg  = (BYTE *)Parm[nInd].pArg + nSize - 4;
      dwStSize += (DWORD)nSize; // Count no of bytes on stack
      while (nSize > 0)
      {
         // Copy argument to the stack
         if (Parm[nInd].dwFlags & DC_FLAG_ARGPTR)
         {
            // Arg has a ptr to a variable that has the arg
            dwVal = *(DWORD *)pArg; // Get first four bytes
            pArg -= 4;              // Next part of argument
         }
         else
         {
            // Arg has the real arg
            dwVal = Parm[nInd].dwArg;
         }
         // Do push dwVal
         pStack--;           // ESP = ESP - 4
         *pStack = dwVal;    // SS:[ESP] = dwVal
         nSize -= 4;
      }
   }

   if((pRet != NULL) && ((Flags & DC_BORLAND) || (nRetSiz > 8)))
   {
      // Return value isn't passed through registers, memory copy
      // is performed instead. Pass the pointer as hidden arg.
      dwStSize += 4;          // Add stack size
      pStack--;               // ESP = ESP - 4
      *pStack = (DWORD)pRet;  // SS:[ESP] = pMem
   }

   _asm add esp, 0x100         // Restore to original position
   _asm sub esp, dwStSize      // Adjust for our new parameters

   // Stack is now properly built, we can call the function
   _asm call [lpFunction]

   _asm mov dwEAX, eax         // Save eax/edx registers
   _asm mov dwEDX, edx         //

   // Possibly adjust stack and read return values.
   if (Flags & DC_CALL_CDECL)
   {
      _asm add esp, dwStSize
   }
   if (Flags & DC_RETVAL_MATH4)
   {
      _asm fstp dword ptr [Res]
   }
   else if (Flags & DC_RETVAL_MATH8)
   {
      _asm fstp qword ptr [Res]
   }
   else if (pRet == NULL)
   {
      _asm mov  eax, [dwEAX]
      _asm mov  DWORD PTR [Res], eax
      _asm mov  edx, [dwEDX]
      _asm mov  DWORD PTR [Res + 4], edx
   }
   else if (((Flags & DC_BORLAND) == 0) && (nRetSiz <= 8))
   {
      // Microsoft optimized less than 8-bytes structure passing
      _asm mov ecx, DWORD PTR [pRet]
      _asm mov eax, [dwEAX]
      _asm mov DWORD PTR [ecx], eax
      _asm mov edx, [dwEDX]
      _asm mov DWORD PTR [ecx + 4], edx
   }
#endif
   return Res;
}
_wincall.c101
_wincdlg.c
TypeFunctionSourceLine
HB_FUNCCOMMDLGEXTENDEDERROR(void)
HB_FUNC( COMMDLGEXTENDEDERROR )
{
  hb_retnl( CommDlgExtendedError() ) ;
}
_wincdlg.c34
HB_FUNCCHOOSEFONT(void)
HB_FUNC( CHOOSEFONT )
{
  CHOOSEFONT *cf =  (CHOOSEFONT * ) hb_parc( 1 );
                       //hb_param( 1, HB_IT_STRING )->item.asString.value; 

  cf->lStructSize = sizeof(CHOOSEFONT);

  if (ChooseFont( cf ) )
      hb_retclen( (char *) cf, sizeof( CHOOSEFONT )) ;
}
_wincdlg.c43
HB_FUNC_FINDTEXT(void)
HB_FUNC( _FINDTEXT )
{
   FINDREPLACE fr ;

   fr.lStructSize = sizeof( fr );

   fr.hwndOwner        = (HWND) hb_parnl( 1 ) ;
   fr.hInstance        = (HINSTANCE) hb_parnl( 2 ) ;
   fr.Flags            = (DWORD)  hb_parnl( 3 ) ;
   fr.lpstrFindWhat    = (LPTSTR) hb_parcx( 4 ) ;
   fr.lpstrReplaceWith = NULL ;
   fr.wFindWhatLen     = (WORD) hb_parclen(4) ;
   fr.wReplaceWithLen  = 0 ;
   fr.lCustData        = 0 ;
//   fr.lpfnHook         = ISNIL(5) ? NULL : __DlgProc ;
   fr.lpTemplateName   = NULL ;


   hb_retnl( (LONG) FindText( &fr ) ) ;
}
_wincdlg.c58
HB_FUNC_REPLACETEXT(void)
HB_FUNC( _REPLACETEXT )
{
   FINDREPLACE fr ;

   fr.lStructSize = sizeof( fr );

   fr.hwndOwner        = (HWND) hb_parnl( 1 ) ;
   fr.hInstance        = (HINSTANCE) hb_parnl( 2 ) ;
   fr.Flags            = (DWORD)  hb_parnl( 3 ) ;
   fr.lpstrFindWhat    = (LPTSTR) hb_parcx( 4 )  ;
   fr.lpstrReplaceWith = (LPTSTR) hb_parcx( 5 )  ;
   fr.wFindWhatLen     = (WORD) hb_parclen( 4 ) ;
   fr.wReplaceWithLen  = (WORD) hb_parclen( 5 ) ;
   fr.lCustData        = 0 ;
//   fr.lpfnHook         = ISNIL(5) ? NULL : __DlgProc ;
   fr.lpTemplateName   = NULL ;

   hb_retnl( (LONG) FindText( &fr ) ) ;
}
_wincdlg.c83
HB_FUNCPRINTDLG(void)
HB_FUNC( PRINTDLG )
{

   PRINTDLG *pd  = ( PRINTDLG * ) hb_parc( 1 );
                       //hb_param( 1, HB_IT_STRING )->item.asString.value;

   pd->lStructSize = sizeof(PRINTDLG);

   if ( PrintDlg( pd ) )
   {
      hb_storclen( (char*) pd, sizeof(PRINTDLG), 1 );
      hb_retl(TRUE);
   }
   else
     hb_retl(FALSE);
}

//----------------------------------------------------------------------------

//NT

_wincdlg.c106
HB_FUNCPAGESETUPDLG(void)
HB_FUNC( PAGESETUPDLG )
{

   PAGESETUPDLG *psd = (PAGESETUPDLG * ) hb_parc( 1 );
                        //hb_param( 1, HB_IT_STRING )->item.asString.value;

   psd->lStructSize = sizeof(PAGESETUPDLG);

   if ( PageSetupDlg( psd ) )
   {
      hb_storclen( (char*) psd, sizeof(PAGESETUPDLG), 1 );
      hb_retl(TRUE);
   }
   else
   {
     hb_retl(FALSE);
   }
}
_wincdlg.c147
HB_FUNCCHOOSECOLOR(void)
HB_FUNC( CHOOSECOLOR )
{
   CHOOSECOLOR cc ;
   COLORREF crCustClr[16] ;
   int i ;

   for( i = 0 ; i <16 ; i++ )
     crCustClr[i] = (ISARRAY(3) ? hb_parnl(3,i+1) : RGB(0,0,0)) ;
                                    // GetSysColor(COLOR_BTNFACE)) ;

   cc.lStructSize    = sizeof( CHOOSECOLOR ) ;
   cc.hwndOwner      = ISNIL(1) ? GetActiveWindow():(HWND) hb_parnl(1) ;
   cc.rgbResult      = (COLORREF)ISNIL(2) ?  0 : hb_parnl(2) ;
   cc.lpCustColors   = crCustClr ;
   cc.Flags          = (WORD) (ISNIL(4) ? CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT : hb_parnl(4) ) ;
   if ( ChooseColorA( &cc ) )
   {
      hb_retnl( cc.rgbResult );
   }
}
_wincdlg.c171
HB_FUNC_GETOPENFILENAME(void)
HB_FUNC( _GETOPENFILENAME )
{
   OPENFILENAME ofn;
   char *szFileName =(char*) hb_xgrab( hb_parcsiz(2));

   strcpy( szFileName, hb_parcx( 2 ) );

   ZeroMemory( &ofn, sizeof(ofn) );
   ofn.hInstance       = GetModuleHandle(NULL)  ;
   ofn.lStructSize     = sizeof(ofn);
   ofn.hwndOwner       = (ISNIL  (1) ? GetActiveWindow() : (HWND) hb_parnl(1));
   ofn.lpstrTitle      = hb_parc (3);
   ofn.lpstrFilter     = hb_parc (4);
   ofn.Flags           = (ISNIL  (5) ? OFN_EXPLORER : hb_parnl(5) );
   ofn.lpstrInitialDir = hb_parc (6);
   ofn.lpstrDefExt     = hb_parc (7);
   ofn.nFilterIndex    = hb_parni(8);
   ofn.lpstrFile       = szFileName;
   ofn.nMaxFile        = hb_parcsiz(2);

   if( GetOpenFileName( &ofn ) )
   {
      hb_stornl( ofn.nFilterIndex, 8 );
      hb_storclen( szFileName, hb_parcsiz(2), 2 ) ;
      hb_xfree( szFileName );
      hb_retc( ( char * ) ofn.lpstrFile );
   }
   else
   {
      hb_retc( NULL );
   }
}
_wincdlg.c197
HB_FUNC_GETSAVEFILENAME(void)
HB_FUNC( _GETSAVEFILENAME )
{
    OPENFILENAME ofn;
    char szFileName[MAX_PATH+1] ;
    strcpy( szFileName, hb_parc (2) );
    ZeroMemory(&ofn, sizeof(ofn));
    ofn.hInstance       = GetModuleHandle(NULL)  ;
    ofn.lStructSize     = sizeof(ofn);
    ofn.hwndOwner       = ISNIL   (1)  ? GetActiveWindow() : (HWND) hb_parnl(1);
    ofn.lpstrTitle      = hb_parc (3);
    ofn.lpstrFilter     = hb_parc (4);
    ofn.Flags           = (ISNIL  (5) ? OFN_FILEMUSTEXIST|OFN_EXPLORER : hb_parnl(4) ); 
    ofn.lpstrInitialDir = hb_parc (6);
    ofn.lpstrDefExt     = hb_parc (7);
    ofn.nFilterIndex    = hb_parni(8);
    ofn.lpstrFile       = szFileName;
    ofn.nMaxFile        = MAX_PATH;
    if(GetSaveFileName(&ofn))
     {
      hb_stornl(ofn.nFilterIndex , 8 );
      hb_retc( ofn.lpstrFile );
     }
    else
     {
      hb_retc( NULL );
   }
}
_wincdlg.c236
HB_FUNCSHBROWSEFORFOLDER(void)
HB_FUNC( SHBROWSEFORFOLDER )
{
   HWND hwnd = ISNIL   (1)  ? GetActiveWindow() : (HWND) hb_parnl(1);
   BROWSEINFO BrowseInfo;
   char *lpBuffer = (char*) hb_xgrab( MAX_PATH + 1 );
   LPITEMIDLIST pidlBrowse;

   SHGetSpecialFolderLocation(hwnd, ISNIL(4) ? CSIDL_DRIVES : hb_parni(4), &pidlBrowse) ;
   BrowseInfo.hwndOwner = hwnd;
   BrowseInfo.pidlRoot = pidlBrowse;
   BrowseInfo.pszDisplayName = lpBuffer;
   BrowseInfo.lpszTitle = ISNIL (2) ?  "Select a Folder" : hb_parcx(2);
   BrowseInfo.ulFlags = hb_parni(3);
   BrowseInfo.lpfn = NULL;
   BrowseInfo.lParam = 1;
   BrowseInfo.iImage = 0;
   pidlBrowse = SHBrowseForFolder(&BrowseInfo);

   if ( pidlBrowse )
   {
     SHGetPathFromIDList(pidlBrowse,lpBuffer);
     hb_retc( lpBuffer );
   }
   else
   {
     hb_retc( NULL );
   }

   hb_xfree( lpBuffer);
}
_wincdlg.c269
_winclpb.c
TypeFunctionSourceLine
HB_FUNCCLOSECLIPBOARD(void)
HB_FUNC( CLOSECLIPBOARD )
{
   hb_retl( CloseClipboard() );
}
_winclpb.c35
HB_FUNCCOUNTCLIPBOARDFORMATS(void)
HB_FUNC( COUNTCLIPBOARDFORMATS )
{
   hb_retni( CountClipboardFormats() ) ;
}
_winclpb.c42
HB_FUNCEMPTYCLIPBOARD(void)
HB_FUNC( EMPTYCLIPBOARD )
{
   hb_retl( EmptyClipboard() ) ;
}
_winclpb.c49
HB_FUNCENUMCLIPBOARDFORMATS(void)
HB_FUNC( ENUMCLIPBOARDFORMATS )
{
   hb_retni( EnumClipboardFormats( (UINT) hb_parni(1) ) );
}
_winclpb.c56
HB_FUNCSETCLIPBOARDVIEWER(void)
HB_FUNC( SETCLIPBOARDVIEWER )
{
   hb_retnl( (ULONG) SetClipboardViewer( (HWND) hb_parnl(1) ) );
}
_winclpb.c63
HB_FUNCCHANGECLIPBOARDCHAIN(void)
HB_FUNC( CHANGECLIPBOARDCHAIN )
{
   hb_retl( ChangeClipboardChain( (HWND) hb_parnl( 1 ), (HWND) hb_parnl( 2 ) ) ) ;
}
_winclpb.c68
HB_FUNCGETOPENCLIPBOARDWINDOW(void)
HB_FUNC( GETOPENCLIPBOARDWINDOW )
{
   hb_retnl( (LONG) GetOpenClipboardWindow(  ) ) ;
}
_winclpb.c78
HB_FUNCGETPRIORITYCLIPBOARDFORMAT(void)
HB_FUNC( GETPRIORITYCLIPBOARDFORMAT )
{
   UINT *p, *paFP ;
   UINT i;

   p = paFP = (PUINT) hb_xgrab( hb_parinfa( 1, 0 ) * sizeof(UINT)  );
   for ( i=1; i<=hb_parinfa( 1, 0 ); i++ )
   {
     *p++ = hb_parni( 1, i ) ;
   }
   hb_retni( GetPriorityClipboardFormat( (UINT *) paFP, hb_parinfa( 1, 0 ) ) ) ;

}
_winclpb.c88
HB_FUNCGETCLIPBOARDSEQUENCENUMBER(void)
HB_FUNC( GETCLIPBOARDSEQUENCENUMBER )
{
   hb_retnl( (LONG) GetClipboardSequenceNumber(  ) ) ;
}
_winclpb.c112
HB_FUNCGETCLIPBOARDOWNER(void)
HB_FUNC( GETCLIPBOARDOWNER )
{
   hb_retnl( (ULONG) GetClipboardOwner() ) ;
}
_winclpb.c121
HB_FUNCGETCLIPBOARDVIEWER(void)
HB_FUNC( GETCLIPBOARDVIEWER )
{
   hb_retnl( (ULONG) GetClipboardViewer() ) ;
}
_winclpb.c128
HB_FUNCISCLIPBOARDFORMATAVAILABLE(void)
HB_FUNC( ISCLIPBOARDFORMATAVAILABLE )
{
   hb_retl( IsClipboardFormatAvailable( hb_parni(1) ) );
}
_winclpb.c135
HB_FUNCOPENCLIPBOARD(void)
HB_FUNC( OPENCLIPBOARD )
{
   hb_retl( OpenClipboard( (HWND) hb_parnl(1) ) ) ;
}
_winclpb.c142
HB_FUNCREGISTERCLIPBOARDFORMAT(void)
HB_FUNC( REGISTERCLIPBOARDFORMAT )
{
   hb_retni( RegisterClipboardFormat( (LPCSTR) hb_parcx(1) ) ) ;
}

//----------------------------------------------------------------------------//
_winclpb.c149
HB_FUNCGETCLIPBOARDDATA(void)
HB_FUNC( GETCLIPBOARDDATA )
{
   WORD    wType = ( ISNIL( 1 ) ? CF_TEXT : hb_parni( 1 ) );
   HGLOBAL hMem ;
   HANDLE  hClipMem ;
   LPSTR   lpClip ;

   switch( wType )
   {
      case CF_TEXT:
         hMem = GetClipboardData( CF_TEXT ) ;
         if( hMem )
         {
            hb_retc( ( char * ) GlobalLock( hMem ) );
            GlobalUnlock( hMem );
         }
         else
            hb_retc( NULL );
         break;

      case CF_BITMAP:
         if( IsClipboardFormatAvailable( CF_BITMAP ) )
            hb_retnl( ( LONG ) DuplicateBitmap( ( HBITMAP ) GetClipboardData( CF_BITMAP ) ) );
         else
            hb_retnl( 0 );
         break;

      default:
         hClipMem = GetClipboardData( ( UINT ) hb_parni( 1 ) );

         if( hClipMem )
         {
            lpClip = ( LPSTR )  GlobalLock( hClipMem ) ;
            hb_retclen( lpClip, GlobalSize( hClipMem ) ) ;
            GlobalUnlock( hClipMem ) ;
         }
         break;      
   }
}
_winclpb.c173
HB_FUNCGETCLIPBOARDFORMATNAME(void)
HB_FUNC( GETCLIPBOARDFORMATNAME )
{
   int nRet ;
   char cName[128] ;

   nRet = GetClipboardFormatName( (UINT) hb_parni(1), cName, 127 ) ;

   if ( nRet == 0 )
      hb_retc(NULL) ;
   else
      hb_retclen(cName, nRet) ;
}

//----------------------------------------------------------------------------//
_winclpb.c215
HB_FUNCSETCLIPBOARDDATA(void)
HB_FUNC( SETCLIPBOARDDATA )
{
   WORD    wType = hb_parni( 1 ) ;
   HGLOBAL hMem ;
   DWORD   dwLen;
   void    *pMem;

   switch( wType )
   {
      case CF_TEXT:
         hMem = GetClipboardData( CF_TEXT ) ;
         if( hMem )
         {
            hb_retc( ( char * ) GlobalLock( hMem ) );
            GlobalUnlock( hMem );
         }
         else
            hb_retc( NULL );
         break;

      case CF_BITMAP:
         if( IsClipboardFormatAvailable( CF_BITMAP ) )
              hb_retl( ( BOOL ) SetClipboardData( CF_BITMAP,
                                  DuplicateBitmap( ( HBITMAP ) hb_parnl( 2 ) ) ) );
         else
            hb_retnl( 0 );
         break;

      default:
         dwLen = ( DWORD ) hb_parclen( 2 );
         hMem  = GlobalAlloc( ( GMEM_MOVEABLE | GMEM_DDESHARE) , dwLen ) ;
         if ( hMem )
         {
            pMem = GlobalLock( hMem ) ;
            memcpy( pMem, hb_parcx( 2 ), dwLen ) ;
            GlobalUnlock( hMem ) ;
            hb_retnl( ( ULONG ) SetClipboardData( ( UINT ) hb_parni( 1 ), hMem ) ) ;
         }
         else
         {
            hb_retnl( 0 );
         }
         break;
   }
}
_winclpb.c254
HBITMAPDuplicateBitmap( HBITMAP hbmpSrc )
HBITMAP DuplicateBitmap( HBITMAP hbmpSrc )
{
   HBITMAP hbmpOldSrc, hbmpOldDest, hbmpNew;
   HDC     hdcSrc, hdcDest;
   BITMAP  bmp;

   hdcSrc  = CreateCompatibleDC( NULL );
   hdcDest = CreateCompatibleDC( hdcSrc );

   GetObject( hbmpSrc, sizeof( BITMAP ), &bmp );

   hbmpOldSrc = ( HBITMAP ) SelectObject( hdcSrc, hbmpSrc );

   hbmpNew = CreateCompatibleBitmap( hdcSrc, bmp.bmWidth, bmp.bmHeight );

   hbmpOldDest = ( HBITMAP ) SelectObject( hdcDest, hbmpNew );

   BitBlt( hdcDest, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcSrc, 0, 0, SRCCOPY);

   SelectObject( hdcDest, hbmpOldDest );
   SelectObject( hdcSrc, hbmpOldSrc );

   DeleteDC( hdcDest );
   DeleteDC( hdcSrc );

   return hbmpNew;
}
_winclpb.c302
_wincomm.c
TypeFunctionSourceLine
HB_FUNCINITCOMMONCONTROLS(void)
HB_FUNC( INITCOMMONCONTROLS )
{
  InitCommonControls() ;
}
_wincomm.c32
HB_FUNCINITCOMMONCONTROLSEX(void)
HB_FUNC( INITCOMMONCONTROLSEX )
{
  INITCOMMONCONTROLSEX icc ;
  icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icc.dwICC = hb_parnl( 1 );

  hb_retl( InitCommonControlsEx( &icc ) );
}
_wincomm.c43
HB_FUNCCREATESTATUSWINDOW(void)
HB_FUNC( CREATESTATUSWINDOW )
{
  hb_retnl( (ULONG) CreateStatusWindow (
                                         hb_parnl(1),
                                         (LPCSTR) hb_parcx(2) ,
                                         (HWND) hb_parnl(3) ,
                                         (UINT) hb_parni(4)
                                       )
                                   ) ;
}
_wincomm.c52
HB_FUNCDRAWSTATUSTEXT(void)
HB_FUNC( DRAWSTATUSTEXT )
{
    RECT rc ;

    rc.left   = hb_parnl( 2, 1 ) ;
    rc.top    = hb_parnl( 2, 2 ) ;
    rc.right  = hb_parnl( 2, 3 ) ;
    rc.bottom = hb_parnl( 2, 4 ) ;

    DrawStatusText(
                     (HDC) hb_parnl(1)  ,
                     (LPRECT) &rc       ,
                     (LPCTSTR) hb_parcx(3),
                     (UINT) hb_parni(4)
                  );

}
_wincomm.c67
HB_FUNCWRITESTATUSWINDOW(void)
HB_FUNC( WRITESTATUSWINDOW )
{
   SendMessage( (HWND) hb_parnl( 1 ), SB_SETTEXT, hb_parni( 2 ), (LPARAM) hb_parcx( 3 ) );
}
_wincomm.c87
HB_FUNCSTATUSBARGETRECT(void)
HB_FUNC( STATUSBARGETRECT )
{
  RECT rc;
  PHB_ITEM aRect ;
  HWND hWnd = (HWND) hb_parnl(1);
  SendMessage ( hWnd, SB_GETRECT, hb_parnl(2), (LPARAM) &rc);
  aRect = Rect2Array( &rc  );
  _itemReturn( aRect );
  _itemRelease( aRect );
}
_wincomm.c93
HB_FUNCSTATUSBARGETPARTS(void)
HB_FUNC( STATUSBARGETPARTS )
{
  RECT rc;
  PHB_ITEM aParts;
  HWND hWnd = (HWND) hb_parnl(1);
  SendMessage ( hWnd, SB_GETPARTS, hb_parni(2), (LPARAM) &rc);
  aParts = Rect2Array( &rc  );
  _itemReturn( aParts );
  _itemRelease( aParts );
}

//----------------------------------------------------------------------------//

// T.B.D.

_wincomm.c105
HB_FUNCCREATEPROGRESSBAR(void)
HB_FUNC( CREATEPROGRESSBAR )
{
   HWND hPBar, hParentWindow = (HWND) hb_parnl(1);
   RECT rcClient;
   LONG ProgressBarStyle;
   BOOL bBorder = ISNIL(7) ? FALSE : hb_parl(7);
   int cyVScroll = ISNIL(6) ? GetSystemMetrics( SM_CYVSCROLL ): hb_parni(6) ;
   LONG nStyle = ISNIL(8) ? 0 : hb_parnl(8) ;

   int x1, y1, nwidth, nheight;
   if( hb_pcount() > 2 )
   {
      x1 = hb_parni( 3 );
      y1 = hb_parni( 4 );
      nwidth = hb_parni( 5 );
      nheight = cyVScroll;
   }
   else
   {
      GetClientRect( hParentWindow, &rcClient );
      x1 = rcClient.left;
      y1 = rcClient.bottom - cyVScroll;
      nwidth = rcClient.right;
      nheight = cyVScroll;
   }

   hPBar = CreateWindowEx( 0, PROGRESS_CLASS, (LPSTR) NULL,
              WS_CHILD | WS_VISIBLE | nStyle,    /* style  */
              x1,                       /* x */
              y1,                       /* y */
              nwidth, nheight,          /* nWidth, nHeight */
              hParentWindow,            /* parent window    */
              (HMENU) NULL,
              GetModuleHandle( NULL ), NULL );

   SendMessage( hPBar, PBM_SETRANGE, 0, ( MAKELPARAM( 0, hb_parni( 2 ) ) ) );
   SendMessage(hPBar, PBM_SETSTEP, (WPARAM) 1, 0);


  if( bBorder )
    {
    ProgressBarStyle = GetWindowLong(hPBar, GWL_EXSTYLE);
    ProgressBarStyle = ProgressBarStyle - WS_EX_STATICEDGE;
    SetWindowLong(hPBar, GWL_EXSTYLE, ProgressBarStyle);
    }

   hb_retnl( (LONG) hPBar );
}
_wincomm.c149
HB_FUNCUPDATEPROGRESSBAR(void)
HB_FUNC( UPDATEPROGRESSBAR )
{
   SendMessage( (HWND) hb_parnl(1), PBM_STEPIT, 0, 0 );
}
_wincomm.c204
HB_FUNCSETPROGRESSBAR(void)
HB_FUNC( SETPROGRESSBAR )
{
   SendMessage( (HWND) hb_parnl(1), PBM_SETPOS, (WPARAM) hb_parni(2), 0 );
}



_wincomm.c214
HB_FUNCINITLISTVIEW(void)
HB_FUNC( INITLISTVIEW )
{
   HWND hwnd;
   HWND hbutton;

   INITCOMMONCONTROLSEX  i;

   i.dwSize = sizeof(INITCOMMONCONTROLSEX);
   i.dwICC = ICC_DATE_CLASSES;
   InitCommonControlsEx(&i);

   hwnd = (HWND) hb_parnl (1);

   hbutton = CreateWindowEx(WS_EX_CLIENTEDGE,"SysListView32","",
   LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_BORDER | LVS_REPORT,
   hb_parni(3), hb_parni(4) , hb_parni(5), hb_parni(6) ,
   hwnd,(HMENU)hb_parni(2) , GetModuleHandle(NULL) , NULL ) ;

   SendMessage(hbutton,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP );

   if ( hb_parni(8) != 0)
   {
      //SendMessage(hbutton,(UINT)WM_SETFONT,(WPARAM) PrepareFont ( hb_parcx(7) , (LPARAM) hb_parni(8)) , 1 ) ;
   }

   hb_retnl ( (LONG) hbutton );
}
_wincomm.c259
HB_FUNCINITLISTVIEWCOLUMNS(void)
HB_FUNC( INITLISTVIEWCOLUMNS )
{
   PHB_ITEM wArray;
   PHB_ITEM hArray;
   char *caption;
   HWND hc;
   LV_COLUMN COL;
   int l9;
   int s;
   int vi;

   hc = (HWND) hb_parnl( 1 ) ;

   l9 = hb_parinfa( 2, 0 ) - 1 ;
   hArray = hb_param( 2, HB_IT_ARRAY );
   wArray = hb_param( 3, HB_IT_ARRAY );

   COL.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT |LVCF_SUBITEM;
   COL.fmt=LVCFMT_LEFT;

   for (s = 0 ; s<=l9 ; s=s+1 )
      {
      //...........
      //caption  = hb_itemGetCPtr ( hArray->item.asArray.value->pItems + s );
      //vi = hb_itemGetNI   ( wArray->item.asArray.value->pItems + s );

caption  = hb_itemGetCPtr ( hb_arrayGetItemPtr(hArray,s));
vi = hb_itemGetNI   ( hb_arrayGetItemPtr(wArray, s ));

      COL.cx=vi;
      COL.pszText=caption;
      COL.iSubItem=s;
      ListView_InsertColumn(hc,s,&COL);

      }

}
_wincomm.c286
HB_FUNCADDLISTVIEWITEMS(void)
HB_FUNC( ADDLISTVIEWITEMS )
{
// PHB_ITEM hArray;
   char *caption = NULL;
   LV_ITEM LI;
   HWND h;
   int l;
   int s;
   int c;

   h = (HWND) hb_parnl( 1 ) ;
   l = hb_parinfa( 2, 0 ) - 1 ;
   c = ListView_GetItemCount (h);
// hArray = hb_param( 2, HB_IT_ARRAY );
//   caption  = hb_itemGetCPtr ( hArray->item.asArray.value->pItems );

   LI.mask=LVIF_TEXT ;
   LI.state=0;
   LI.stateMask=0;
        LI.iImage=0;
        LI.iSubItem=0;
   LI.iItem=c;
   LI.pszText=caption;
   ListView_InsertItem(h,&LI);

   for (s = 1 ; s<=l ; s=s+1 )
   {
//      caption  = hb_itemGetCPtr ( hArray->item.asArray.value->pItems + s );
      ListView_SetItemText(h,c,s,caption);
   }
}
_wincomm.c324
HB_FUNCLISTVIEW_SETCURSEL(void)
HB_FUNC( LISTVIEW_SETCURSEL )
{
   ListView_SetItemState((HWND) hb_parnl (1), (WPARAM) hb_parni(2)-1 ,LVIS_FOCUSED | LVIS_SELECTED , LVIS_FOCUSED | LVIS_SELECTED );
}
_wincomm.c356
HB_FUNCC_SETFOCUS(void)
HB_FUNC( C_SETFOCUS )
{
   hb_retnl( (LONG) SetFocus( (HWND) hb_parnl( 1 ) ) );
}
_wincomm.c361
HB_FUNCLISTVIEWDELETESTRING(void)
HB_FUNC( LISTVIEWDELETESTRING )
{
   SendMessage( (HWND) hb_parnl( 1 ),LVM_DELETEITEM , (WPARAM) hb_parni(2)-1, 0);
}
_wincomm.c366
HB_FUNCLISTVIEWRESET(void)
HB_FUNC( LISTVIEWRESET )
{
   SendMessage( (HWND) hb_parnl( 1 ), LVM_DELETEALLITEMS , 0, 0 );
}
_wincomm.c371
HB_FUNCLISTVIEW_GETFIRSTITEM(void)
HB_FUNC( LISTVIEW_GETFIRSTITEM )
{
   hb_retni( ( ListView_GetNextItem( (HWND) hb_parnl( 1 ), -1, LVNI_ALL | LVNI_SELECTED ) ) + 1 );
}
_wincomm.c376
_wincret.c
TypeFunctionSourceLine
HB_FUNCGETCARETBLINKTIME(void)
HB_FUNC( GETCARETBLINKTIME )
{
   hb_retni( GetCaretBlinkTime() );
}
_wincret.c31
HB_FUNCSETCARETBLINKTIME(void)
HB_FUNC( SETCARETBLINKTIME )
{
   hb_retl( SetCaretBlinkTime( (UINT) hb_parni(1) ) );
}
_wincret.c38
HB_FUNCGETCARETX(void)
HB_FUNC( GETCARETX )
{
   POINT ptPoint ;
   GetCaretPos( (LPPOINT) &ptPoint ) ;
   hb_retnl( ptPoint.x );
}
_wincret.c45
HB_FUNCGETCARETY(void)
HB_FUNC( GETCARETY )
{
   POINT ptPoint ;
   GetCaretPos( (LPPOINT) &ptPoint ) ;
   hb_retnl( ptPoint.y );
}
_wincret.c54
HB_FUNCGETCARETPOS(void)
HB_FUNC( GETCARETPOS )
{
   POINT Point ;
   PHB_ITEM aPt;
   
   if ( GetCaretPos( (LPPOINT) &Point ) ) 
   {
      aPt = Point2Array(&Point) ;
      _itemReturn( aPt );
      _itemRelease( aPt );
   }
  
}
_wincret.c64
HB_FUNCSETCARETPOS(void)
HB_FUNC( SETCARETPOS )
{

   hb_retl( SetCaretPos( hb_parni(1), hb_parni(2) ) );
}
_wincret.c81
HB_FUNCSHOWCARET(void)
HB_FUNC( SHOWCARET )
{
   hb_retl( ShowCaret( (HWND) hb_parnl(1) ) ) ;
}
_wincret.c89
HB_FUNCHIDECARET(void)
HB_FUNC( HIDECARET )
{
   hb_retl( HideCaret( (HWND) hb_parnl(1) ) );
}
_wincret.c97
HB_FUNCCREATECARET(void)
HB_FUNC( CREATECARET )
{
   hb_retl( CreateCaret( (HWND) hb_parnl(1)  ,
                         (HBITMAP) hb_parnl(2),
                         (int) hb_parni(3) ,
                         (int) hb_parni(4) ) ) ;
}
_wincret.c104
HB_FUNCDESTROYCARET(void)
HB_FUNC( DESTROYCARET )
{
  hb_retl( DestroyCaret() ) ;
}
_wincret.c114
_windate.c
TypeFunctionSourceLine
HB_FUNCDATETIME_CREATE(void)
HB_FUNC( DATETIME_CREATE )
{

   hb_retnl( (LONG) CreateWindowEx( ISNIL( 1 ) ? 0 : hb_parnl( 1 ) ,
                                    "SysDateTimePick32"   ,   // CLASSNAME
                                    0                     ,   // Window Name   // ????????
                                    (DWORD) hb_parnl( 2 ) ,   // nStyle
                                    hb_parni( 3 )         ,   // x
                                    hb_parni( 4 )         ,   // y
                                    hb_parni( 5 )         ,   // nWidth
                                    hb_parni( 6 )         ,   // nHeight
                                    (HWND) hb_parnl( 7 )  ,   // hParent
                                    (HMENU) hb_parni( 8 ) ,   // hMenu
                                    GetModuleHandle(NULL) ,   // hInstance
                                    ISNIL( 9 ) ? NULL : (void *) hb_parnl( 9 ) ) ) ;   // lpParam
}
_windate.c28
HB_FUNCDATETIME_GETMONTHCAL(void)
HB_FUNC( DATETIME_GETMONTHCAL )
{

   hb_retnl( (LONG) DateTime_GetMonthCal(
                                            (HWND) hb_parnl( 1 )  // Handle to a DTP control
                                          ) );
}
_windate.c56
HB_FUNCDATETIME_GETMONTHCALCOLOR(void)
HB_FUNC( DATETIME_GETMONTHCALCOLOR )
{

   hb_retnl( (LONG) DateTime_GetMonthCalColor(
                                            (HWND) hb_parnl( 1 ),  // Handle to a DTP control
                                                   hb_parni( 2 )   // Value of type int specifying which month calendar color to retrieve.

                                             ) );
}
_windate.c74
HB_FUNCDATETIME_GETMONTHCALFONT(void)
HB_FUNC( DATETIME_GETMONTHCALFONT )
{

   hb_retnl( (LONG) DateTime_GetMonthCalFont(
                                            (HWND) hb_parnl( 1 )   // Handle to a DTP control
                                             ) );
}
_windate.c94
HB_FUNCDATETIME_GETRANGE(void)
HB_FUNC( DATETIME_GETRANGE )
{
   LPSYSTEMTIME lpSysTimeArray = (SYSTEMTIME *) hb_xgrab( 2 * sizeof(SYSTEMTIME)) ;
   PHB_ITEM aMinMaxDate, aMinDate, aMaxDate ;
   PHB_ITEM temp ;
   DWORD dwRet ;

   dwRet = DateTime_GetRange( (HWND) hb_parnl( 1 ), (SYSTEMTIME *)lpSysTimeArray ) ;

   if ( ISBYREF(2) )
      hb_stornl(dwRet,2);


   aMinMaxDate = hb_itemArrayNew( 2 ) ;
   aMinDate    = hb_itemArrayNew( 8 ) ;

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wYear );
       hb_arraySet( aMinDate, 1, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wMonth );
       hb_arraySet( aMinDate, 2, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wDayOfWeek );
       hb_arraySet( aMinDate, 3, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wDay );
       hb_arraySet( aMinDate, 4, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wHour );
       hb_arraySet( aMinDate, 5, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wMinute );
       hb_arraySet( aMinDate, 6, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wSecond );
       hb_arraySet( aMinDate, 7, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[0].wMilliseconds );
       hb_arraySet( aMinDate, 8, temp );
       hb_itemRelease( temp );

   hb_arraySet( aMinMaxDate, 1, aMinDate );


   aMaxDate    = hb_itemArrayNew( 8 ) ;

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wYear );
       hb_arraySet( aMaxDate, 1, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wMonth );
       hb_arraySet( aMaxDate, 2, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wDayOfWeek );
       hb_arraySet( aMaxDate, 3, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wDay );
       hb_arraySet( aMaxDate, 4, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wHour );
       hb_arraySet( aMaxDate, 5, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wMinute );
       hb_arraySet( aMaxDate, 6, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wSecond );
       hb_arraySet( aMaxDate, 7, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, lpSysTimeArray[1].wMilliseconds );
       hb_arraySet( aMaxDate, 8, temp );
       hb_itemRelease( temp );

   hb_arraySet( aMinMaxDate, 2, aMaxDate );

   hb_itemReturn( aMinMaxDate );
   hb_itemRelease( aMinMaxDate );
   hb_itemRelease( aMinDate );
   hb_itemRelease( aMaxDate );
   hb_xfree(lpSysTimeArray);

}
_windate.c114
HB_FUNCDATETIME_GETSYSTEMTIME(void)
HB_FUNC( DATETIME_GETSYSTEMTIME )
{
   SYSTEMTIME SysTime ;
   PHB_ITEM aSysTime ;
   PHB_ITEM temp ;
   long nRet;


   nRet = DateTime_GetSystemtime(
                      (HWND) hb_parnl( 1 ),   // Handle to a DTP control
                      &SysTime              // Pointer to a SYSTEMTIME structure. If DTM_GETSYSTEMTIME returns
                                              // GDT_VALID, this structure will contain the system time.
                                              // Otherwise, it will not contain valid information.
                                              // This parameter must be a valid pointer; it cannot be NULL.
                                );

   if (nRet == GDT_VALID)  // Time is valid
   {
       aSysTime = hb_itemArrayNew( 8 ) ;

       temp = hb_itemPutNL( NULL, SysTime.wYear );
       hb_arraySet( aSysTime, 1, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wMonth );
       hb_arraySet( aSysTime, 2, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wDayOfWeek );
       hb_arraySet( aSysTime, 3, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wDay );
       hb_arraySet( aSysTime, 4, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wHour );
       hb_arraySet( aSysTime, 5, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wMinute );
       hb_arraySet( aSysTime, 6, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wSecond );
       hb_arraySet( aSysTime, 7, temp );
       hb_itemRelease( temp );

       temp = hb_itemPutNL( NULL, SysTime.wMilliseconds );
       hb_arraySet( aSysTime, 8, temp );
       hb_itemRelease( temp );

       hb_itemReturn( aSysTime );
       hb_itemRelease( aSysTime );
   }

}
_windate.c222
HB_FUNCDATETIME_SETFORMAT(void)
HB_FUNC( DATETIME_SETFORMAT )
{
   hb_retl( DateTime_SetFormat(
                      (HWND) hb_parnl( 1 ),   // Handle to a DTP control
                   (LPCTSTR) hb_parcx( 2 )     // Pointer to a zero-terminated format string that defines
                                              // the desired display. Setting this parameter to NULL will
                                              // reset the control to the default format string for the current style.
                          )  );
}
_windate.c293
HB_FUNCDATETIME_SETMONTHCALCOLOR(void)
HB_FUNC( DATETIME_SETMONTHCALCOLOR )
{
   hb_retnl( (LONG) DateTime_SetMonthCalColor(
                      (HWND) hb_parnl( 1 ),   // Handle to a DTP control
                             hb_parni( 2 ),   // Value of type int specifying which month calendar color to set.
                  (COLORREF) hb_parnl( 3 )    // COLORREF value that represents the color that will be set for the specified area of the month calendar.
                                    )  );
}
_windate.c316
HB_FUNCDATETIME_SETMONTHCALFONT(void)
HB_FUNC( DATETIME_SETMONTHCALFONT )
{

   DateTime_SetMonthCalFont(
                      (HWND) hb_parnl( 1 ),   // Handle to a DTP control
                     (HFONT) hb_parnl( 2 ),   // Handle to the font that will be set.
                      (BOOL) hb_parl( 3 )     // Specifies whether the control should be redrawn
                                              // immediately upon setting the font. Setting this
                                              // parameter to TRUE causes the control to redraw itself.
                           );

}
_windate.c337
HB_FUNCDATETIME_SETSYSTEMTIME(void)
HB_FUNC( DATETIME_SETSYSTEMTIME )
{
   SYSTEMTIME SysTime, *lpSysTime ;

   if ( ISARRAY( 3 ) ) // array
   {
      SysTime.wYear         = (WORD)  hb_parnl( 3, 1 );
      SysTime.wMonth        = (WORD)  hb_parnl( 3, 2 );
      SysTime.wDayOfWeek    = (WORD)  hb_parnl( 3, 3 );
      SysTime.wDay          = (WORD)  hb_parnl( 3, 4 );
      SysTime.wHour         = (WORD)  hb_parnl( 3, 5 );
      SysTime.wMinute       = (WORD)  hb_parnl( 3, 6 );
      SysTime.wSecond       = (WORD)  hb_parnl( 3, 7 );
      SysTime.wMilliseconds = (WORD)  hb_parnl( 3, 8 );
      lpSysTime = &SysTime;
   }
   else
   {
     if ( ISCHAR(2) )  // xHarbour structure
     {
        lpSysTime =( SYSTEMTIME *) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING)->item.asString.value;
     }
     else
     {
      hb_retl(0);
      return;
     }
   }

   hb_retl( DateTime_SetSystemtime(
                      (HWND) hb_parnl( 1 ) ,   // Handle to a DTP control
                      (DWORD) hb_parnl( 2 ),   // Value that specifies the action that should be performed.
                      lpSysTime                // Pointer to SYSTEMTIME structures
                               ) );
}
_windate.c364
_windc.c
TypeFunctionSourceLine
HB_FUNCGETDC(void)
HB_FUNC( GETDC )
{
   hb_retnl( (ULONG) GetDC( (HWND) hb_parnl(1) ) ) ;
}
_windc.c30
HB_FUNCRESTOREDC(void)
HB_FUNC( RESTOREDC )
{
   hb_retl( RestoreDC( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_windc.c39
HB_FUNCSAVEDC(void)
HB_FUNC( SAVEDC )
{
   hb_retni( SaveDC( (HDC) hb_parnl( 1 ) ) ) ;
}
_windc.c48
HB_FUNCGETDCEX(void)
HB_FUNC( GETDCEX )
{
   hb_retnl( (LONG) GetDCEx( (HWND) hb_parnl( 1 ) ,
                             (HRGN) hb_parnl( 2 ) ,
                             (DWORD) hb_parnl( 3 )
                           ) ) ;
}
_windc.c56
HB_FUNCRELEASEDC(void)
HB_FUNC( RELEASEDC )
{
   hb_retni( ReleaseDC( (HWND) hb_parnl(1), (HDC) hb_parnl(2) ) ) ;
}
_windc.c66
HB_FUNCDELETEDC(void)
HB_FUNC( DELETEDC )
{
   hb_retl( DeleteDC( (HDC) hb_parnl( 1 ) ) ) ;
}
_windc.c74
HB_FUNCCANCELDC(void)
HB_FUNC( CANCELDC )
{
   hb_retl( CancelDC( (HDC) hb_parnl( 1 ) ) ) ;
}
_windc.c82
HB_FUNCCREATECOMPATIBLEDC(void)
HB_FUNC( CREATECOMPATIBLEDC )
{
   hb_retnl( (LONG) CreateCompatibleDC( (HDC) hb_parnl( 1 ) ) ) ;
}
_windc.c90
HB_FUNCWINDOWFROMDC(void)
HB_FUNC( WINDOWFROMDC )
{
   hb_retnl( (LONG) WindowFromDC( (HDC) hb_parnl( 1 ) ) );
}
_windc.c98
HB_FUNCGETWINDOWDC(void)
HB_FUNC( GETWINDOWDC )
{
   hb_retnl( (LONG) GetWindowDC( (HWND) hb_parnl( 1 ) ) ) ;
}
_windc.c108
HB_FUNCCREATEDC(void)
HB_FUNC( CREATEDC )
{
   DEVMODE *lpInitData = NULL;

   if ( ! ISNIL( 4 ) )
        lpInitData = (DEVMODE *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING)->item.asString.value ;

   hb_retnl( (ULONG) CreateDC((LPCTSTR) hb_parcx( 1 )  ,       // pointer to string specifying driver name
                              (LPCTSTR) hb_parcx( 2 )  ,       // pointer to string specifying device name
                              NULL                    ,       // do not use; set to NULL
                              ISNIL( 4 ) ? NULL : lpInitData // pointer to optional printer data
                             )
           ) ;
}
_windc.c119
HB_FUNCRESETDC(void)
HB_FUNC( RESETDC )
{

   DEVMODE *lpInitData = NULL;

   if ( ! ISNIL( 2 ) )
        lpInitData = (DEVMODE *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING)->item.asString.value ;

   hb_retnl( (LONG) ResetDCA( (HDC) hb_parnl( 1 ),
                               ISNIL( 2 )? NULL : lpInitData ) ) ;

}
_windc.c139
HB_FUNCGETDCORGEX(void)
HB_FUNC( GETDCORGEX )
{
   POINT Point ;
   PHB_ITEM aPt;

   if ( GetDCOrgEx( (HDC) hb_parnl( 1 ), &Point ) )
   {
     aPt = Point2Array(&Point);
     _itemReturn( aPt );
     _itemRelease( aPt );
   }

}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI ScrollDC( IN HDC hDC, IN int dx, IN int dy, IN CONST RECT *lprcScroll, IN CONST RECT *lprcClip, IN HRGN hrgnUpdate, OUT LPRECT lprcUpdate);

_windc.c160
HB_FUNCSCROLLDC(void)
HB_FUNC( SCROLLDC )
{
   RECT   lprcScroll ;
   RECT   lprcClip   ;
   RECT lprcUpdate ;
   PHB_ITEM pArray=hb_param(7,HB_IT_ARRAY);

   if( Array2Rect(hb_param( 4, HB_IT_ARRAY ) , &lprcScroll )  && Array2Rect(hb_param( 5, HB_IT_ARRAY ) , &lprcClip ) )
   {
      if( ScrollDC( (HDC) hb_parnl( 1 ) ,
                      hb_parni( 2 )       ,
                      hb_parni( 3 )       ,
                      &lprcScroll         ,
                      &lprcClip           ,
                      (HRGN) hb_parnl( 6 ),
                      &lprcUpdate
                    ) )
        {
         Rect2ArrayEx( &lprcUpdate,pArray);
         hb_retl(TRUE);
        }
   else
      hb_retl(FALSE);
   }
   else
      hb_retl(FALSE);
}
_windc.c186
_windir.c
TypeFunctionSourceLine
HB_FUNCGETLOGICALDRIVES(void)
HB_FUNC( GETLOGICALDRIVES )
{
   hb_retnl( (LONG) GetLogicalDrives(  ) ) ;
}
_windir.c20
HB_FUNCGETDRIVETYPE(void)
HB_FUNC( GETDRIVETYPE )
{
   hb_retni( GetDriveType( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_windir.c30
HB_FUNCGETSYSTEMDIRECTORY(void)
HB_FUNC( GETSYSTEMDIRECTORY )
{

   char szBuffer[ MAX_PATH + 1 ] = {0} ;
   GetSystemDirectory( szBuffer,MAX_PATH);
   hb_retc(szBuffer);

}
_windir.c42
HB_FUNCGETTEMPPATH(void)
HB_FUNC( GETTEMPPATH )
{
   char szBuffer[ MAX_PATH + 1 ] = {0} ;
   GetTempPath(MAX_PATH, szBuffer);
   hb_retc(szBuffer);

}
_windir.c58
HB_FUNCGETTEMPFILENAME(void)
HB_FUNC( GETTEMPFILENAME )
{
   char cPath[ MAX_PATH ] = {0};

   GetTempFileName( (LPCSTR) hb_parcx( 1 ),
                            (LPCSTR) hb_parcx( 2 ),
                            (UINT) ( ISNIL(3) ? 0 : hb_parni( 3 ) ) ,
                            (LPSTR) cPath
                           ) ;
   hb_retc( cPath);
}
_windir.c75
HB_FUNCGETWINDOWSDIRECTORY(void)
HB_FUNC( GETWINDOWSDIRECTORY )
{
   char szBuffer[ MAX_PATH + 1 ] = {0} ;
   GetWindowsDirectory( szBuffer,MAX_PATH);
   hb_retc(szBuffer);
}

//-----------------------------------------------------------------------------
// WINBASEAPI UINT WINAPI GetSystemWindowsDirectoryA( OUT LPSTR lpBuffer, IN UINT uSize );

_windir.c91
HB_FUNCSETCURRENTDIRECTORY(void)
HB_FUNC( SETCURRENTDIRECTORY )
{

   hb_retl( SetCurrentDirectory( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_windir.c120
HB_FUNCGETCURRENTDIRECTORY(void)
HB_FUNC( GETCURRENTDIRECTORY )
{
   char cPath[ MAX_PATH + 1 ] = {0};
   GetCurrentDirectory( MAX_PATH , (LPSTR) cPath ) ;
   hb_retc( cPath );
}
_windir.c130
HB_FUNCSETFILEATTRIBUTES(void)
HB_FUNC( SETFILEATTRIBUTES )
{
   hb_retl( SetFileAttributes( (LPCSTR) hb_parcx( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_windir.c141
HB_FUNCGETFILEATTRIBUTES(void)
HB_FUNC( GETFILEATTRIBUTES )
{
   hb_retnl( (LONG) GetFileAttributes( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_windir.c150
HB_FUNCDELETEFILE(void)
HB_FUNC( DELETEFILE )
{
   hb_retl( DeleteFile( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_windir.c159
HB_FUNCSETVOLUMELABEL(void)
HB_FUNC( SETVOLUMELABEL )
{
   hb_retl( SetVolumeLabel( (LPCSTR) hb_parcx( 1 ), (LPCSTR) hb_parcx( 2 ) ) ) ;
}
_windir.c168
HB_FUNCCREATEDIRECTORY(void)
HB_FUNC( CREATEDIRECTORY )
{
   SECURITY_ATTRIBUTES *sa = NULL;

   if (ISCHAR(2))
       sa = (SECURITY_ATTRIBUTES *) hb_parc( 2 ); //hb_param(2, HB_IT_STRING)->item.asString.value;

   hb_retl( CreateDirectoryA( (LPCSTR) hb_parcx( 1 ), sa ) ) ;
}


//-----------------------------------------------------------------------------
// WINBASEAPI BOOL WINAPI CreateDirectoryExA( IN LPCSTR lpTemplateDirectory, IN LPCSTR lpNewDirectory, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes );

_windir.c178
HB_FUNCREMOVEDIRECTORY(void)
HB_FUNC( REMOVEDIRECTORY )
{
   hb_retl( RemoveDirectory( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_windir.c212
HB_FUNCGETFULLPATHNAME(void)
HB_FUNC( GETFULLPATHNAME )
{
   char *szBuffRet = NULL ;
   char buffer[ MAX_PATH + 1 ] = {0};
   char *szIn =hb_parcx( 1 );
   //DWORD dwSize  = hb_parnl( 2 );
   DWORD dwReq;
   dwReq = GetFullPathName( (LPCSTR) szIn,
                            MAX_PATH ,
                            (LPSTR) buffer ,
                            &szBuffRet
                          )  ;
  hb_retnl( dwReq ) ;
  hb_storc( szBuffRet , 4 ) ;
  hb_storc( buffer ,3 ) ;
}
_windir.c226
HB_FUNCGETVOLUMEPATHNAME(void)
HB_FUNC( GETVOLUMEPATHNAME )
{
   typedef BOOL ( WINAPI * P_GVPN )( LPCTSTR, LPTSTR, DWORD );
   BOOL bResult = FALSE;
   char buffer[MAX_PATH+1] = {0};
   P_GVPN pGVPN ;
   pGVPN = ( P_GVPN ) GetProcAddress( GetModuleHandle( "kernel32.dll" ), "GetVolumePathNameA" );
   if( pGVPN )
   {
      bResult = pGVPN( (LPCSTR) hb_parcx( 1 ), buffer, MAX_PATH );
   }
   hb_retl( bResult );
   if ( ISBYREF( 2 ) )
   {
      hb_storc( buffer ,2 );
   }
}
_windir.c254
HB_FUNCGETSHORTPATHNAME(void)
HB_FUNC( GETSHORTPATHNAME )
{
   char buffer[ MAX_PATH + 1 ] = {0};
   int iRet;

   iRet = GetShortPathName(hb_parcx(1),buffer,MAX_PATH);
   hb_storc(buffer , 2 );
   hb_stornl(iRet , 3 );

}
_windir.c278
HB_FUNCGETLONGPATHNAME(void)
HB_FUNC( GETLONGPATHNAME )
{
   hb_retnl( (LONG) GetLongPathName( (LPCSTR) hb_parcx( 1 ),
                                      (LPSTR) hb_parcx( 2 ) ,
                                      (DWORD) hb_parnl( 3 )
                                      ) ) ;
}

//-----------------------------------------------------------------------------

_windir.c292
HB_FUNCGETVOLUMEINFORMATION(void)
HB_FUNC( GETVOLUMEINFORMATION )
{
  char *VolumeNameBuffer     = (char *) hb_xgrab( MAX_PATH ) ;
  DWORD VolumeSerialNumber                              ;
  DWORD MaximumComponentLength                          ;
  DWORD FileSystemFlags                                 ;
  char *FileSystemNameBuffer = (char *) hb_xgrab( MAX_PATH )  ;
  BOOL bRet;

  bRet = GetVolumeInformation( ISNIL(1) ? NULL : (LPCTSTR) hb_parcx(1) ,
                                  (LPTSTR) VolumeNameBuffer              ,
                                  MAX_PATH                               ,
                                  &VolumeSerialNumber                    ,
                                  &MaximumComponentLength                ,
                                  &FileSystemFlags                       ,
                                  (LPTSTR)FileSystemNameBuffer           ,
                                  MAX_PATH ) ;
  if ( bRet  )
  {
     if ( ISBYREF( 2 ) )  hb_storc ((char *) VolumeNameBuffer, 2 ) ;
     if ( ISBYREF( 3 ) )  hb_stornl( (LONG)  VolumeSerialNumber, 3 ) ;
     if ( ISBYREF( 4 ) )  hb_stornl( (LONG)  MaximumComponentLength, 4 ) ;
     if ( ISBYREF( 5 ) )  hb_stornl( (LONG)  FileSystemFlags, 5 );
     if ( ISBYREF( 6 ) )  hb_storc ((char *) FileSystemNameBuffer, 6 );
  }

  hb_retl(bRet);
  hb_xfree( VolumeNameBuffer );
  hb_xfree( FileSystemNameBuffer );
}
_windir.c321
_windlg.c
TypeFunctionSourceLine
HB_FUNCENDDIALOG(void)
HB_FUNC( ENDDIALOG )
{
  EndDialog( (HWND) hb_parnl(1) , hb_parni(2) ) ;
}
_windlg.c33
HB_FUNCGETDLGITEM(void)
HB_FUNC( GETDLGITEM )
{
   HWND hWnd = GetDlgItem(
                 (HWND) hb_parnl( 1 ), // handle of dialog box
                 hb_parni( 2 )           // identifier of control
               );
   hb_retnl( (LONG) hWnd );
}
_windlg.c40
HB_FUNCGETNEXTDLGGROUPITEM(void)
HB_FUNC( GETNEXTDLGGROUPITEM )
{
   hb_retnl( (LONG) GetNextDlgGroupItem( (HWND) hb_parnl( 1 ),
                                         (HWND) hb_parnl( 2 ),
                                         hb_parl( 3 )
                                       ) ) ;
}
_windlg.c54
HB_FUNCGETNEXTDLGTABITEM(void)
HB_FUNC( GETNEXTDLGTABITEM )
{
   hb_retnl( (LONG) GetNextDlgTabItem( (HWND) hb_parnl( 1 ),
                                       (HWND) hb_parnl( 2 ),
                                       hb_parl( 3 )
                                     ) ) ;
}
_windlg.c66
HB_FUNCGETDLGCTRLID(void)
HB_FUNC( GETDLGCTRLID )
{
   hb_retni( GetDlgCtrlID( (HWND) hb_parnl( 1 ) ) ) ;
}
_windlg.c78
HB_FUNCGETDIALOGBASEUNITS(void)
HB_FUNC( GETDIALOGBASEUNITS )
{
   hb_retnl( (LONG) GetDialogBaseUnits(  ) ) ;
}
_windlg.c87
HB_FUNCSETDLGITEMINT(void)
HB_FUNC( SETDLGITEMINT )
{
   hb_retl( SetDlgItemInt( (HWND) hb_parnl( 1 ),
                           hb_parni( 2 )       ,
                           (UINT) hb_parni( 3 ),
                           hb_parl( 4 )
                         ) ) ;
}
_windlg.c97
HB_FUNCSETDLGITEMTEXT(void)
HB_FUNC( SETDLGITEMTEXT )
{
    SetDlgItemText(
       (HWND) hb_parnl( 1 ),  // handle of dialog box
       hb_parni( 2 ),           // identifier of control
       (LPCTSTR) hb_parcx( 3 )    // text to set
    );
}
_windlg.c109
HB_FUNCGETDLGITEMTEXT(void)
HB_FUNC( GETDLGITEMTEXT )  // GETDLGITMTEXT
{
   USHORT iLen = ( USHORT ) SendMessage( GetDlgItem( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 )+1 ;
   char *cText = (char*) hb_xgrab( iLen );

   GetDlgItemText(
                  (HWND) hb_parnl( 1 ),   // handle of dialog box
                  hb_parni( 2 ),             // identifier of control
                  (LPTSTR) cText,         // address of buffer for text
                  iLen                    // maximum size of string
                 );

   hb_retc( cText );
   hb_xfree( cText );
}
_windlg.c122
HB_FUNCGETLBITEMTEXT(void)
HB_FUNC( GETLBITEMTEXT )  // GETDLGITMTEXT
{
   USHORT iLen = ISNIL(3) ? 255 : hb_parni( 3 );
   char *cText = (char*) hb_xgrab( iLen+1 );

   SendMessage(
                  (HWND) hb_parnl( 1 ),    // handle of dialog box
                  LB_GETTEXT ,
                  (WPARAM) hb_parni( 2 ) , // item number
                  (LPARAM) (LPCSTR) cText           // address of buffer for text
              );

   hb_retc( cText );
   hb_xfree( cText );
}
_windlg.c143
HB_FUNCCHECKDLGBUTTON(void)
HB_FUNC( CHECKDLGBUTTON )
{
    hb_retl( CheckDlgButton(
                             (HWND) hb_parnl( 1 ), // handle of dialog box
                             hb_parni( 2 ),          // identifier of control
                             ISNUM(3) ? hb_parni(3) : (UINT) hb_parl(3) ) );
}
_windlg.c162
HB_FUNCCHECKRADIOBUTTON(void)
HB_FUNC( CHECKRADIOBUTTON )
{
    hb_retl( CheckRadioButton(
                              (HWND) hb_parnl( 1 ),   // handle of dialog box
                              hb_parni( 2 ),         // identifier of first radio button in group
                              hb_parni( 3 ),         // identifier of last radio button in group
                              hb_parni( 4 )          // identifier of radio button to select
                             ) ) ;
}
_windlg.c172
HB_FUNCISDLGBUTTONCHECKED(void)
HB_FUNC( ISDLGBUTTONCHECKED )
{
  hb_retni( IsDlgButtonChecked(
                               (HWND) hb_parnl( 1 ),       // handle of dialog box
                               hb_parni( 2 )               // button identifier
                               ) ) ;


}
_windlg.c184
HB_FUNCDLGDIRLIST(void)
HB_FUNC( DLGDIRLIST )
{

   char *cText = (char*) hb_xgrab( MAX_PATH+1 );
  // cText = hb_parcx(2);

   hb_retni( DlgDirList( (HWND) hb_parnl( 1 ),
                         (LPSTR) cText       ,
                         hb_parni( 3 )       ,
                         hb_parni( 4 )       ,
                         (UINT) hb_parni( 5 )
                       ) ) ;

   hb_storc(cText,2) ;
   hb_xfree(cText);

}
_windlg.c199
HB_FUNCDLGDIRSELECTEX(void)
HB_FUNC( DLGDIRSELECTEX )
{

   USHORT iLen = ISNIL(3) ? MAX_PATH : hb_parni( 3 );
   char *cText = (char*) hb_xgrab( iLen+1 );

   hb_retl( DlgDirSelectEx( (HWND) hb_parnl( 1 ),
                            (LPSTR) cText       ,
                            iLen                ,
                            hb_parni( 4 )
                          ) ) ;

   hb_storc(cText, 2 ) ;
   hb_xfree(cText) ;
}
_windlg.c222
HB_FUNCDLGDIRLISTCOMBOBOX(void)
HB_FUNC( DLGDIRLISTCOMBOBOX )
{
   char *cText = (char*) hb_xgrab( MAX_PATH+1 );
   //cText = hb_parcx(2) ;

   hb_retni( DlgDirListComboBox( (HWND) hb_parnl( 1 ),
                                 (LPSTR) cText       ,
                                 hb_parni( 3 )       ,
                                 hb_parni( 4 )       ,
                                 (UINT) hb_parni( 5 )
                               ) ) ;
   hb_storc(cText, 2 ) ;
   hb_xfree(cText) ;

}
_windlg.c242
HB_FUNCDLGDIRSELECTCOMBOBOXEX(void)
HB_FUNC( DLGDIRSELECTCOMBOBOXEX )
{

   USHORT iLen = ISNIL(3) ? MAX_PATH : hb_parni( 3 );
   char *cText = (char*) hb_xgrab( iLen+1 );

   hb_retl( DlgDirSelectComboBoxEx( (HWND) hb_parnl( 1 ),
                                    (LPSTR) cText       ,
                                    iLen                ,
                                    hb_parni( 4 )
                                  ) ) ;

   hb_storc(cText, 2 ) ;
   hb_xfree(cText) ;

}


//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI MapDialogRect( IN HWND hDlg, IN OUT LPRECT lpRect);

_windlg.c262
HB_FUNCMAPDIALOGRECT(void)
HB_FUNC( MAPDIALOGRECT )
{
   RECT lpRect ;
   PHB_ITEM pArray;
   if (ISARRAY(2) )
      {
      pArray=hb_param( 2, HB_IT_ARRAY ) ;
      lpRect.left   = hb_arrayGetNL( pArray , 1 );
      lpRect.top    = hb_arrayGetNL( pArray , 2 );
      lpRect.right  = hb_arrayGetNL( pArray , 3 );
      lpRect.bottom = hb_arrayGetNL( pArray , 4 );

      hb_retl( MapDialogRect( (HWND) hb_parnl( 1 ), &lpRect ) ) ;
      hb_stornl( lpRect.left   , 2 , 1 ) ;
      hb_stornl( lpRect.top    , 2 , 2 ) ;
      hb_stornl( lpRect.right  , 2 , 3 ) ;
      hb_stornl( lpRect.bottom , 2 , 4 ) ;
   }
   else
      hb_retl(FALSE);


}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI GetComboBoxInfo( IN HWND hwndCombo, OUT PCOMBOBOXINFO pcbi );

/*

HB_FUNC( GETCOMBOBOXINFO )
{
   PCOMBOBOXINFO pcbi      ;

   hb_retl( GetComboBoxInfo( (HWND) hb_parnl( 1 ), pcbi ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI GetAltTabInfoA( IN HWND hwnd, IN int iItem, OUT PALTTABINFO pati, OUT LPSTR pszItemText, IN UINT cchItemText );

/*

HB_FUNC( GETALTTABINFO )
{
   PALTTABINFO pati        ;

   // Your code goes here

   hb_retl( GetAltTabInfo( (HWND) hb_parnl( 1 ),
                           hb_parni( 2 )       ,
                           pati                ,
                           (LPSTR) hb_parcx( 4 ),
                           (UINT) hb_parni( 5 )
                         ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI DWORD WINAPI GetListBoxInfo( IN HWND hwnd );

_windlg.c288
HB_FUNCGETLISTBOXINFO(void)
HB_FUNC( GETLISTBOXINFO )
{
HINSTANCE h    = LoadLibraryEx( "user32.dll", NULL, 0);
DWORD dwGLIRet = 0 ;
HWND  hWnd     = (HWND) hb_parnl( 1 );

if( h ){
    typedef DWORD (WINAPI *xdwGetListBoxInfo)( HWND hWnd );
    xdwGetListBoxInfo pfnGLI = (xdwGetListBoxInfo)
    GetProcAddress( h, "GetListBoxInfo") ;
    if( pfnGLI ){
        dwGLIRet = (DWORD) pfnGLI( hWnd ) ;
    }
    FreeLibrary( h );
}

   hb_retl( (ULONG) dwGLIRet );
}
_windlg.c359
_windll.c
TypeFunctionSourceLine
HB_FUNCLOADLIBRARYEX(void)
HB_FUNC( LOADLIBRARYEX )
{
   hb_retnl( (LONG) LoadLibraryExA( (LPCSTR) hb_parcx( 1 ) ,
                                    (HANDLE) hb_parnl( 2 ),
                                    (DWORD) hb_parnl( 3 )
                                    ) ) ;
}


//-----------------------------------------------------------------------------
// WINBASEAPI BOOL WINAPI FreeLibrary( IN OUT HMODULE hLibModule );
_windll.c51
HB_FUNCFREELIBRARYANDEXITTHREAD(void)
HB_FUNC( FREELIBRARYANDEXITTHREAD )
{
   FreeLibraryAndExitThread( (HMODULE) hb_parnl( 1 ),
                             (DWORD) hb_parnl( 2 )
                            ) ;
}

//-----------------------------------------------------------------------------
// WINBASEAPI FARPROC WINAPI GetProcAddress( IN HMODULE hModule, IN LPCSTR lpProcName );
/*
HB_FUNC( GETPROCADDRESS )
{
  ULONG dwProcAddr;
  char  cFuncName[MAX_PATH];

    if ((dwProcAddr = (ULONG) GetProcAddress( (HMODULE) hb_parnl(1),
                                              ISCHAR( 2 ) ? (LPCSTR) hb_parcx(2) :
                                              (LPCSTR) MAKELONG((WORD) hb_parni(2), 0) ) ) == 0 )
    {
       if ( ISCHAR( 2 ) )
       {
            // try forced ANSI flavour ?
           strcpy(cFuncName, hb_parcx(2));
           strcat(cFuncName, "A");
           dwProcAddr = (ULONG) GetProcAddress((HMODULE) hb_parnl(1), cFuncName);
       }
    }

    hb_retnl( dwProcAddr );

}
*/

//------------------------------------------------------------------


//////////////////////////////////////////////////////
//
//   This part used modified code of Vic McClung.
//   The modifications were to separate the library
//   loading and getting the procedure address
//   from the actual function call.
//   The parameters have been slightly re-arranged
//   to allow for C-like syntax, on function
//   declaration. The changes allow to load the library
//   and to get the procedure addresses in advance,
//   which makes it work similarly to C import libraries.
//   From experience, when using dynamic libraries, loading
//   the library and getting the address of the procedure
//   part of using the DLL.
//   Additionally the changes will allow to use standard
//   xHarbour C type defines, as used with structure types,
//   ande defined in cstruct.ch .
//
//
//   Andrew Wos.
//   20/07/2002.
//
//
//////////////////////////////////////////////////////




/*

Copyright 2002 Vic McClung 
www - http://www.vicmcclung.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).

As a special exception, you have permission for
additional uses of the text contained in this release of VMGUI.

The exception is that, if you link the VMGUI library with other
files to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public License.
Your use of that executable is in no way restricted on account of
linking the VMGUI library code into it.

*/



#define  DC_MICROSOFT           0x0000      // Default
#define  DC_BORLAND             0x0001      // Borland compat
#define  DC_CALL_CDECL          0x0010      // __cdecl
#define  DC_CALL_STD            0x0020      // __stdcall
#define  DC_RETVAL_MATH4        0x0100      // Return value in ST
#define  DC_RETVAL_MATH8        0x0200      // Return value in ST

#define  DC_CALL_STD_BO         (DC_CALL_STD | DC_BORLAND)
#define  DC_CALL_STD_MS         (DC_CALL_STD | DC_MICROSOFT)
#define  DC_CALL_STD_M8         (DC_CALL_STD | DC_RETVAL_MATH8)

#define  DC_FLAG_ARGPTR         0x00000002

#pragma pack(1)

typedef union RESULT {          // Various result types
    int     Int;                // Generic four-byte type
    long    Long;               // Four-byte long
    void   *Pointer;            // 32-bit pointer
    float   Float;              // Four byte real
    double  Double;             // 8-byte real
    __int64 int64;              // big int (64-bit)
} RESULT;

typedef struct DYNAPARM {
    DWORD       dwFlags;        // Parameter flags
    int         nWidth;         // Byte width
    union {                     //
        DWORD   dwArg;          // 4-byte argument
        void   *pArg;           // Pointer to argument
    };
} DYNAPARM;

#pragma pack()


#define CTYPE_VOID 0
#define CTYPE_CHAR 1

#define CTYPE_UNSIGNED_CHAR -1
#define CTYPE_CHAR_PTR 10
#define CTYPE_UNSIGNED_CHAR_PTR -10

#define CTYPE_SHORT 2
#define CTYPE_UNSIGNED_SHORT -2
#define CTYPE_SHORT_PTR 20
#define CTYPE_UNSIGNED_SHORT_PTR -20

#define CTYPE_INT 3
#define CTYPE_UNSIGNED_INT -3
#define CTYPE_INT_PTR 30
#define CTYPE_UNSIGNED_INT_PTR -30

#define CTYPE_LONG 4
#define CTYPE_UNSIGNED_LONG -4
#define CTYPE_LONG_PTR 40
#define CTYPE_UNSIGNED_LONG_PTR -40

#define CTYPE_FLOAT 5
#define CTYPE_FLOAT_PTR 50

#define CTYPE_DOUBLE 6
#define CTYPE_DOUBLE_PTR 60

#define CTYPE_VOID_PTR 7

#define CTYPE_BOOL 8 // NOTE: Not in xHarbour for structure support
                     //       Hopefully it will be added !!!

// ***Must*** be smaller than CTYPE_STRUCTURE_PTR
//  #define CTYPE_STRUCTURE 1000
#define CTYPE_STRUCTURE_PTR 10000

extern RESULT DynaCall(int Flags, DWORD lpFunction,
                int nArgs, DYNAPARM Parm[],
                LPVOID pRet, int nRetSiz);
_windll.c74
HB_FUNCCALLDLL(void)
HB_FUNC( CALLDLL )
{
    int i;
    int iCnt = 0;
    int iParams = hb_pcount();
    int iArgCnt = iParams - 3;
    int iReturn = ISNIL( 4 ) ? 0 : hb_parni( 4 );
    int Flags;
    double DblParms[15];
    DYNAPARM   Parm[15];
    HINSTANCE  hInst = (HINSTANCE) hb_parnl( 1 );
    DWORD      lpFunction = (DWORD) hb_parnl( 2 );
    RESULT     rc;

    if ( hInst == NULL )
       return;

    if ((LPVOID)lpFunction == NULL)
       return;

    if ( ISNIL(3) )
       Flags = DC_CALL_STD_BO;
    else
       Flags = hb_parni( 3 );
    memset(Parm, 0, sizeof(Parm));
    memset(DblParms, 0, sizeof(DblParms));

    if(iArgCnt > 0)
        iArgCnt /= 2;

    //printf( "\nNo. Parameters: %i\n", iArgCnt ) ;
    if( iArgCnt > 0)
    {
        for( i = 6; i <= iParams; i += 2)
        {
            //printf( "\nParameter Type: %i\n", hb_parni( i ) ) ;
            //printf( "Parameter: %i\n", hb_parni( i + 2) ) ;
            //printf( "Parameter: %i\n", hb_parni( i + 4) ) ;
            //printf( "Parameter: %i\n", hb_parni( i + 6) ) ;
            switch ( hb_parni( i-1 ) )
            {
            case CTYPE_CHAR_PTR          :
                Parm[iCnt].nWidth = sizeof(  char * );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else if (ISNUM(i) ) Parm[iCnt].dwArg = (DWORD) MAKEINTRESOURCE( hb_parni( i ) );
                else Parm[iCnt].dwArg = ( DWORD ) hb_parc ( i  );
                iCnt++;
                break;
            case CTYPE_STRUCTURE_PTR     :
            case CTYPE_UNSIGNED_CHAR_PTR :
                Parm[iCnt].nWidth = sizeof( unsigned char * );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else Parm[iCnt].dwArg = ( DWORD ) hb_parc ( i  );
                iCnt++;
                break;
            case CTYPE_BOOL              :
                Parm[iCnt].nWidth = sizeof( BOOL );
                Parm[iCnt].dwArg = ( DWORD ) hb_parl( i );
                iCnt++;
                break;
            case CTYPE_CHAR              :
                Parm[iCnt].nWidth = sizeof( char );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else Parm[iCnt].dwArg = ( DWORD ) hb_parni( i );
                iCnt++;
                break;
            case CTYPE_UNSIGNED_CHAR     :
                Parm[iCnt].nWidth = sizeof( unsigned char );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else Parm[iCnt].dwArg = ( DWORD ) hb_parni( i );
                iCnt++;
                break;
            case CTYPE_SHORT             :
            case CTYPE_UNSIGNED_SHORT    :
                Parm[iCnt].nWidth = sizeof( short int );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else Parm[iCnt].dwArg = ( DWORD ) hb_parni( i );
                iCnt++;
                break;
            case CTYPE_INT               :
            case CTYPE_UNSIGNED_INT      :
                Parm[iCnt].nWidth = sizeof( unsigned int );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else Parm[iCnt].dwArg = ( DWORD ) hb_parnd( i );
                iCnt++;
                break;
            case CTYPE_LONG              :
            case CTYPE_UNSIGNED_LONG     :
                Parm[iCnt].nWidth = sizeof( unsigned long int );
                if ( ISNIL(i) ) Parm[iCnt].dwArg = 0;
                else Parm[iCnt].dwArg = ( DWORD ) hb_parnd( i );
                iCnt++;
                break;
            case CTYPE_LONG_PTR          :
            case CTYPE_UNSIGNED_LONG_PTR :
            case CTYPE_VOID_PTR          :
            case CTYPE_INT_PTR           :
            case CTYPE_UNSIGNED_INT_PTR  :
            case CTYPE_SHORT_PTR         :
            case CTYPE_UNSIGNED_SHORT_PTR:
                Parm[iCnt].nWidth = sizeof( unsigned long int * );
                if ( ISNIL(i) ) Parm[iCnt].pArg = NULL;
                else Parm[iCnt].dwArg   = ( DWORD ) hb_parnl( i );
                iCnt++;
                break;
            case CTYPE_FLOAT_PTR         :
                Parm[iCnt].nWidth = sizeof( float * );
                Parm[iCnt].dwArg   = ( DWORD ) hb_parnl( i );
                iCnt++;
                break;
            case CTYPE_DOUBLE_PTR        :
                Parm[iCnt].nWidth = sizeof( double * );
                Parm[iCnt].dwArg   = ( DWORD ) hb_parnl( i );
                iCnt++;
                break;
            case CTYPE_FLOAT             :
                Parm[iCnt].nWidth = sizeof( float );
                DblParms[iCnt] = ( double ) hb_parnd( i );
                Parm[iCnt].pArg   = &DblParms[iCnt];
                Flags |= DC_RETVAL_MATH4;
                iCnt++;
                break;
            case CTYPE_DOUBLE            :
                Parm[iCnt].nWidth = sizeof( double );
                DblParms[iCnt] = ( double ) hb_parnd( i );
                Parm[iCnt].pArg   = &DblParms[iCnt];
                Parm[iCnt].dwFlags = DC_FLAG_ARGPTR;  // use the pointer
                Flags |= DC_RETVAL_MATH8;
                iCnt++;
                break;
            default:
                MessageBox( GetActiveWindow(), "UNKNOWN Parameter Type!", "CallDll Parameter Error!", MB_OK | MB_ICONERROR );
                printf( "Bad Parameter: %i\n", hb_parni( i-1 ) ) ;
                return;
            }
        }
    }

    rc = DynaCall(Flags, lpFunction, iArgCnt, Parm, NULL, 0);

    // return the correct value
    switch ( iReturn ) {
        case CTYPE_BOOL :
            //printf("\nAt BOOL Return\n");
            hb_retl( (BOOL) rc.Long );
            break;
        case CTYPE_VOID :
            break;
        case CTYPE_CHAR              :
            hb_retni ( (char) rc.Int );
            break;
        case CTYPE_SHORT             :
        case CTYPE_UNSIGNED_SHORT    :
            hb_retni ( (int) rc.Int );
            break;
        case CTYPE_INT               :
            hb_retni ( (int) rc.Long );
            break;
        case CTYPE_LONG              :
            hb_retnl ( (LONG) rc.Long );
            break;
        case CTYPE_CHAR_PTR          :
        case CTYPE_UNSIGNED_CHAR_PTR :
        case CTYPE_UNSIGNED_CHAR     :
        case CTYPE_UNSIGNED_INT      :
        case CTYPE_INT_PTR           :
        case CTYPE_UNSIGNED_SHORT_PTR:
        case CTYPE_UNSIGNED_LONG     :
        case CTYPE_UNSIGNED_INT_PTR  :
        case CTYPE_STRUCTURE_PTR     :
        case CTYPE_LONG_PTR          :
        case CTYPE_UNSIGNED_LONG_PTR :
        case CTYPE_VOID_PTR          :
        case CTYPE_FLOAT_PTR         :
        case CTYPE_DOUBLE_PTR        :
            hb_retnl ( (DWORD) rc.Long );
            break;
        case CTYPE_FLOAT             :
            hb_retnd( rc.Float );
            break;
        case CTYPE_DOUBLE            :
            hb_retnd( rc.Double );
            break;
        default:
            MessageBox( GetActiveWindow(), "UNKNOW Return Type!", "CallDll Parameter Error!", MB_OK | MB_ICONERROR );
            break;
    }
}
_windll.c252
_windraw.c
TypeFunctionSourceLine
HB_FUNCMOVETO(void)
HB_FUNC( MOVETO )
{

   hb_retl( MoveToEx(
                    (HDC) hb_parnl(1),   // device context handle
                    hb_parni(2)      ,   // x-coordinate of line's ending point
                    hb_parni(3)      ,   // y-coordinate of line's ending point
                    NULL
                 ) );
}
_windraw.c25
HB_FUNCMOVETOEX(void)
HB_FUNC( MOVETOEX )
{

   POINT Point ;
   PHB_ITEM aPt;


   if ( MoveToEx(
                    (HDC) hb_parnl(1),   // device context handle
                    hb_parni(2)      ,   // x-coordinate of line's ending point
                    hb_parni(3)      ,   // y-coordinate of line's ending point
                    &Point
                  ) )

     {

     aPt = Point2Array(&Point) ;
     _itemReturn( aPt );
     _itemRelease( aPt );

     }

}
_windraw.c42
HB_FUNCGETCURRENTPOSITIONEX(void)
HB_FUNC( GETCURRENTPOSITIONEX )
{
   POINT pt ;
   PHB_ITEM aPt;

   if ( GetCurrentPositionEx( (HDC) hb_parnl( 1 ), &pt ) )
   {
       aPt = Point2Array( &pt) ;
       _itemReturn( aPt );
       _itemRelease( aPt );

   }
}
_windraw.c73
HB_FUNCGETPIXELFORMAT(void)
HB_FUNC( GETPIXELFORMAT )
{
   hb_retni( GetPixelFormat( (HDC) hb_parnl( 1 ) ) ) ;
}
_windraw.c91
HB_FUNCSETPIXELFORMAT(void)
HB_FUNC( SETPIXELFORMAT )
{
   PIXELFORMATDESCRIPTOR *pfd = (PIXELFORMATDESCRIPTOR * ) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING )->item.asString.value;

   hb_retl( SetPixelFormat( (HDC) hb_parnl( 1 )   ,
                            hb_parni( 2 )         ,
                            pfd
                            ) ) ;
}
_windraw.c102
HB_FUNCDESCRIBEPIXELFORMAT(void)
HB_FUNC( DESCRIBEPIXELFORMAT )
{
   PIXELFORMATDESCRIPTOR pfd ;
   UINT nBytes = sizeof(pfd);

   hb_retni( DescribePixelFormat( (HDC) hb_parnl( 1 )    ,
                                  hb_parni( 2 )          ,
                                  nBytes                 ,
                                  &pfd
                                  ) ) ;
    if ( ISBYREF(3) )
       hb_storclen( (char*) &pfd, sizeof(PIXELFORMATDESCRIPTOR), 3 ) ;
    //hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) pfd , sizeof( PIXELFORMATDESCRIPTOR ) );

}
_windraw.c121
HB_FUNCSETPIXEL(void)
HB_FUNC( SETPIXEL )
{

   hb_retnl( (ULONG) SetPixel( (HDC) hb_parnl( 1 ),
                               hb_parni( 2 )      ,
                               hb_parni( 3 )      ,
                               (COLORREF) hb_parnl( 4 )
                             ) ) ;
}
_windraw.c142
HB_FUNCGETPIXEL(void)
HB_FUNC( GETPIXEL )
{
   hb_retnl( (ULONG) GetPixel( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_windraw.c157
HB_FUNCSETPIXELV(void)
HB_FUNC( SETPIXELV )
{

   hb_retl( SetPixelV( (HDC) hb_parnl( 1 ),
                       hb_parni( 2 )      ,
                       hb_parni( 3 )      ,
                       (COLORREF) hb_parnl( 4 )
                       ) ) ;
}
_windraw.c166
HB_FUNCLINETO(void)
HB_FUNC( LINETO )
{
   hb_retl( LineTo( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI LineDDA( IN int, IN int, IN int, IN int, IN LINEDDAPROC, IN LPARAM);

_windraw.c187
HB_FUNCGETARCDIRECTION(void)
HB_FUNC( GETARCDIRECTION )
{
   hb_retni( GetArcDirection( (HDC) hb_parnl( 1 ) ) ) ;
}
_windraw.c224
HB_FUNCSETARCDIRECTION(void)
HB_FUNC( SETARCDIRECTION )
{
   hb_retni( SetArcDirection( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_windraw.c236
HB_FUNCARC(void)
HB_FUNC( ARC )
{
   hb_retl( Arc( (HDC) hb_parnl( 1 ),
                 hb_parni( 2 )      ,
                 hb_parni( 3 )      ,
                 hb_parni( 4 )      ,
                 hb_parni( 5 )      ,
                 hb_parni( 6 )      ,
                 hb_parni( 7 )      ,
                 hb_parni( 8 )      ,
                 hb_parni( 9 )
                 ) ) ;
}



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI ArcTo( IN HDC, IN int, IN int, IN int, IN int, IN int, IN int, IN int, IN int);

// NT ??

_windraw.c247
HB_FUNCPOLYLINE(void)
HB_FUNC( POLYLINE )
{

   POINT * Point ;
   POINT pt ;
   DWORD iCount ;
   UINT i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) )
   {
       iCount = (DWORD) hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_windraw.c292
HB_FUNCPOLYLINETO(void)
HB_FUNC( POLYLINETO )
{
   POINT * Point ;
   POINT pt ;
   DWORD iCount ;
   UINT i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) )
   {
       iCount = (DWORD) hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_windraw.c341
HB_FUNCPOLYPOLYLINE(void)
HB_FUNC( POLYPOLYLINE )
{
   POINT * Point ;
   DWORD * PolyPoints ;
   DWORD iPolyCount ;
   DWORD iCount ;
   POINT pt ;
   UINT i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) && ISARRAY( 3 ) )
   {
       iPolyCount = hb_parinfa(3,0) ;
       PolyPoints = (DWORD *) hb_xgrab( iPolyCount * sizeof( DWORD ) ) ;

       for ( i=0 ; i < iPolyCount ; i++ )
       {
          *(PolyPoints+i) = hb_parnl( 3,i+1) ;
       }

       iCount = hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i lSuccess

// Great Function !!!
// NT ?

_windraw.c390
HB_FUNCPOLYBEZIER(void)
HB_FUNC( POLYBEZIER )
{

   POINT * Point ;
   POINT pt ;
   DWORD iCount ;
   UINT i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) )
   {
       iCount = (DWORD) hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_windraw.c519
HB_FUNCPOLYBEZIERTO(void)
HB_FUNC( POLYBEZIERTO )
{

   POINT * Point ;
   POINT pt ;
   DWORD iCount ;
   UINT i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) )
   {
       iCount = (DWORD) hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_windraw.c569
HB_FUNCRECTANGLE(void)
HB_FUNC( RECTANGLE )
{
   hb_retl( Rectangle( (HDC) hb_parnl( 1 ),
                       hb_parni( 2 )      ,
                       hb_parni( 3 )      ,
                       hb_parni( 4 )      ,
                       hb_parni( 5 )
                       ) ) ;
}
_windraw.c626
HB_FUNCROUNDRECT(void)
HB_FUNC( ROUNDRECT )
{
   hb_retl( RoundRect( (HDC) hb_parnl( 1 ),
                       hb_parni( 2 )      ,
                       hb_parni( 3 )      ,
                       hb_parni( 4 )      ,
                       hb_parni( 5 )      ,
                       hb_parni( 6 )      ,
                       hb_parni( 7 )
                       ) ) ;
}
_windraw.c641
HB_FUNCCHORD(void)
HB_FUNC( CHORD )
{
   hb_retl( Chord( (HDC) hb_parnl( 1 ),
                   hb_parni( 2 )      ,
                   hb_parni( 3 )      ,
                   hb_parni( 4 )      ,
                   hb_parni( 5 )      ,
                   hb_parni( 6 )      ,
                   hb_parni( 7 )      ,
                   hb_parni( 8 )      ,
                   hb_parni( 9 )
                   ) ) ;
}
_windraw.c660
HB_FUNCPIE(void)
HB_FUNC( PIE )
{
   hb_retl( Pie( (HDC) hb_parnl( 1 ),
                 hb_parni( 2 )      ,
                 hb_parni( 3 )      ,
                 hb_parni( 4 )      ,
                 hb_parni( 5 )      ,
                 hb_parni( 6 )      ,
                 hb_parni( 7 )      ,
                 hb_parni( 8 )      ,
                 hb_parni( 9 )
                 ) ) ;
}
_windraw.c679
HB_FUNCELLIPSE(void)
HB_FUNC( ELLIPSE )
{
   hb_retl( Ellipse( (HDC) hb_parnl( 1 ),
                     hb_parni( 2 )      ,
                     hb_parni( 3 )      ,
                     hb_parni( 4 )      ,
                     hb_parni( 5 )
                     ) ) ;
}
_windraw.c698
HB_FUNCPOLYGON(void)
HB_FUNC( POLYGON )
{
   POINT * Point ;
   POINT pt ;
   int iCount ;
   int i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) )
   {
       iCount = (int) hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_windraw.c718
HB_FUNCPOLYPOLYGON(void)
HB_FUNC( POLYPOLYGON )
{
   POINT * Point ;
   INT * PolyPoints ;
   int iPolyCount ;
   int iCount ;
   POINT pt ;
   int i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 2 ) && ISARRAY( 3 ) )
   {
       iPolyCount = hb_parinfa(3,0) ;
       PolyPoints = ( INT *) hb_xgrab( iPolyCount * sizeof( INT ) ) ;

       for ( i=0 ; i < iPolyCount ; i++ )
       {
          *(PolyPoints+i) = hb_parni( 3,i+1) ;
       }

       iCount = hb_parinfa( 2, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_windraw.c767
HB_FUNCFILLRECT(void)
HB_FUNC( FILLRECT )
{
  RECT rc ;

  if ( ISARRAY(2) && Array2Rect( hb_param(2,HB_IT_ARRAY), &rc ))
     hb_retni( FillRect((HDC) hb_parnl( 1 ), &rc, (HBRUSH) hb_parnl( 3 ) ) ) ;
  else
     hb_retni(0);

}
_windraw.c829
HB_FUNCFRAMERECT(void)
HB_FUNC( FRAMERECT )
{
   RECT rc ;

   if ( ISARRAY(2) && Array2Rect( hb_param(2,HB_IT_ARRAY), &rc ))
      hb_retni( FrameRect((HDC) hb_parnl( 1 ), &rc, (HBRUSH) hb_parnl( 3 ) ) ) ;
   else
      hb_retni(0);
}
_windraw.c849
HB_FUNCINVERTRECT(void)
HB_FUNC( INVERTRECT )
{
   RECT rc ;

   if ( ISARRAY(2) && Array2Rect( hb_param(2,HB_IT_ARRAY), &rc ))
      hb_retni( InvertRect((HDC) hb_parnl( 1 ), &rc ) ) ;
   else
      hb_retni(0);
}
_windraw.c866
HB_FUNCSETPOLYFILLMODE(void)
HB_FUNC( SETPOLYFILLMODE )
{
   hb_retni( SetPolyFillMode( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_windraw.c886
HB_FUNCEXTFLOODFILL(void)
HB_FUNC( EXTFLOODFILL )
{

   hb_retl( ExtFloodFill( (HDC) hb_parnl( 1 ) ,
                          hb_parni( 2 )       ,
                          hb_parni( 3 )       ,
                          (COLORREF) hb_parnl( 4 ) ,
                          (UINT) hb_parni( 5 )
                          ) ) ;
}
_windraw.c896
HB_FUNCFILLPATH(void)
HB_FUNC( FILLPATH )
{
   hb_retl( FillPath( (HDC) hb_parnl( 1 ) ) ) ;
}
_windraw.c912
HB_FUNCFLATTENPATH(void)
HB_FUNC( FLATTENPATH )
{
   hb_retl( FlattenPath( (HDC) hb_parnl( 1 ) ) ) ;
}
_windraw.c921
HB_FUNCFLOODFILL(void)
HB_FUNC( FLOODFILL )
{

   hb_retl( FloodFill( (HDC) hb_parnl( 1 ),
                       hb_parni( 2 )      ,
                       hb_parni( 3 )      ,
                       (COLORREF) hb_parnl( 4 )
                       ) ) ;
}
_windraw.c929
HB_FUNCGETPOLYFILLMODE(void)
HB_FUNC( GETPOLYFILLMODE )
{
   hb_retni( GetPolyFillMode( (HDC) hb_parnl( 1 ) ) ) ;
}



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GradientFill( IN HDC, IN PTRIVERTEX, IN ULONG, IN PVOID, IN ULONG, IN ULONG);

_windraw.c944
_winfont.c
TypeFunctionSourceLine
HB_FUNCCREATEFONT(void)
HB_FUNC( CREATEFONT )
{

   if ( ISARRAY(1))
   {
      hb_retnl( (LONG) CreateFont( hb_parni( 1, 1 )         ,  // nHeight
                                    hb_parni( 1, 2 )         ,  // nWidth
                                    hb_parni( 1, 3 )         ,  // nEscapement
                                    hb_parni( 1, 4 )         ,  // nOrientation
                                    hb_parni( 1, 5 )         ,  // fnWeight
                                    (DWORD) hb_parnl( 1, 6 ) ,  // fdwItalic
                                    (DWORD) hb_parnl( 1, 7 ) ,  // fdwUnderline
                                    (DWORD) hb_parnl( 1, 8 ) ,  // fdwStrikeOut
                                    (DWORD) hb_parnl( 1, 9 ) ,  // fdwCharSet
                                    (DWORD) hb_parnl( 1, 10 ),  // fdwOutputPrecision
                                    (DWORD) hb_parnl( 1, 11 ),  // fdwClipPrecision
                                    (DWORD) hb_parnl( 1, 12 ),  // fdwQuality
                                    (DWORD) hb_parnl( 1, 13 ),  // fdwPitchAndFamily
                                    (LPCSTR) hb_parcx( 1, 14 )   // lpszFace
                                   ) ) ;

   }
   else
   {
      hb_retnl( (LONG) CreateFont( ISNIL(1) ? 0 : hb_parni( 1 )         ,  // nHeight
                                    ISNIL(2) ? 0 : hb_parni( 2 )         ,  // nWidth
                                    ISNIL(3) ? 0 : hb_parni( 3 )         ,  // nEscapement
                                    ISNIL(4) ? 0 : hb_parni( 4 )         ,  // nOrientation
                                    ISNIL(5) ? 0 : hb_parni( 5 )         ,  // fnWeight
                                    (DWORD) hb_parnl( 6 ) ,  // fdwItalic
                                    (DWORD) hb_parnl( 7 ) ,  // fdwUnderline
                                    (DWORD) hb_parnl( 8 ) ,  // fdwStrikeOut
                                    (DWORD) hb_parnl( 9 ) ,  // fdwCharSet
                                    (DWORD) hb_parnl( 10 ),  // fdwOutputPrecision
                                    (DWORD) hb_parnl( 11 ),  // fdwClipPrecision
                                    (DWORD) hb_parnl( 12 ),  // fdwQuality
                                    (DWORD) hb_parnl( 13 ),  // fdwPitchAndFamily
                                    (LPCSTR) hb_parcx( 14 )   // lpszFace
                                   ) ) ;

   }

}
_winfont.c35
HB_FUNCADDFONTRESOURCE(void)
HB_FUNC( ADDFONTRESOURCE )
{
   hb_retni( AddFontResource( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_winfont.c82
HB_FUNCCREATEFONTINDIRECT(void)
HB_FUNC( CREATEFONTINDIRECT )
{
   LOGFONT *lf = (LOGFONT * ) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value;

   hb_retnl( (LONG) CreateFontIndirect( lf ) ) ;
}

//-----------------------------------------------------------------------------
// WINGDIAPI HFONT WINAPI CreateFontIndirectEx( IN CONST ENUMLOGFONTEXDVA *);

// No info

_winfont.c90
HB_FUNCCREATESCALABLEFONTRESOURCE(void)
HB_FUNC( CREATESCALABLEFONTRESOURCE )
{
   hb_retl( CreateScalableFontResource( (DWORD) hb_parnl( 1 ),
                                         (LPCSTR) hb_parcx( 2 ),
                                         (LPCSTR) hb_parcx( 3 ),
                                         (LPCSTR) hb_parcx( 4 )
                                         ) ) ;
}
_winfont.c119
HB_FUNCENUMFONTFAMILIES(void)
HB_FUNC( ENUMFONTFAMILIES )
{
   LPARAM        lParam        ;

   if ( ISBLOCK( 3 ) )
   {
     lParam = (LPARAM) (PHB_ITEM ) hb_param( 3, HB_IT_BLOCK ) ;


     hb_retni( EnumFontFamilies( (HDC) hb_parnl( 1 )  ,
                                (LPCSTR) hb_parcx( 2 ),
                                (FONTENUMPROC) GenericCallblockProc  ,
                                lParam
                                ) ) ;
   }
   else
     OutputDebugString("EnumFontFamilies(): No codeblock");


}
_winfont.c135
HB_FUNCENUMFONTFAMILIESEX(void)
HB_FUNC( ENUMFONTFAMILIESEX )
{
   LOGFONT *LogFont = (LOGFONT * ) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;
   LPARAM  lParam  ;

   if ( ISBLOCK( 3 ) )
   {
     lParam = (LPARAM) (PHB_ITEM ) hb_param( 3, HB_IT_BLOCK ) ;



   hb_retni( EnumFontFamiliesEx( (HDC) hb_parnl( 1 )  ,
                                  LogFont            ,
                                  (FONTENUMPROC) GenericCallblockProc  ,
                                  lParam               ,
                                  0
                                  ) ) ;

  }
   else
     OutputDebugString("EnumFontFamiliesEx(): No codeblock");

}
_winfont.c164
HB_FUNCENUMFONTS(void)
HB_FUNC( ENUMFONTS )
{
   LPARAM lParam ;

   if ( ISBLOCK( 3 ) )
   {
     lParam = (LPARAM) (PHB_ITEM ) hb_param( 3, HB_IT_BLOCK ) ;

     hb_retni( EnumFonts( (HDC) hb_parnl( 1 )  ,
                         (LPCSTR) hb_parcx( 2 ),
                         (FONTENUMPROC) GenericCallblockProc  ,
                         lParam
                         ) ) ;
   }
   else
     OutputDebugString("EnumFonts(): No codeblock");

}


_winfont.c198
INT CALLBACKGenericCallblockProc( LONG param1, LONG param2, int wParam, LPARAM lParam )
int CALLBACK GenericCallblockProc( LONG param1, LONG param2, int wParam, LPARAM lParam )
{
   PHB_ITEM pItem ;
   long int res   ;
   static PHB_DYNS s_pEval = NULL;

   if( s_pEval == NULL )
   {
      s_pEval = hb_dynsymFind( "__EVAL" );
   }

   pItem = (PHB_ITEM ) lParam ;

   if ( pItem )
   {
      hb_vmPushSymbol( hb_itemGetSymbol( s_pEval ) );//s_pEval->pSymbol );
      hb_vmPush(pItem);

      hb_vmPushLong( (LONG ) param1 );
      hb_vmPushLong( (LONG ) param2 );
      hb_vmPushLong( (LONG ) wParam );
      hb_vmPushLong( (LONG ) lParam );

      hb_vmSend( 4 );
      res = hb_itemGetNL( (PHB_ITEM) hb_param( -1, HB_IT_ANY ) );

      return res;
   }
   else // shouldn't happen
   {
      return( 0 );
   }
}
_winfont.c254
HB_FUNCGETFONTDATA(void)
HB_FUNC( GETFONTDATA )
{
   char * cBuffer = NULL;
   DWORD dwRet ;
   if ( ! ISNIL( 5 ) && ( hb_parnl( 5 ) > 0 ) )
      cBuffer = (char *) hb_xgrab( hb_parnl(5));

   dwRet = GetFontData( (HDC) hb_parnl( 1 )  ,
                                 (DWORD) hb_parnl( 2 ),
                                 (DWORD) hb_parnl( 3 ),
                                 ( ISNIL( 5 ) || ( hb_parnl( 5 ) <= 0 ) ) ? NULL :cBuffer  ,
                                 (DWORD) ISNIL( 5 ) ? 0 : hb_parnl( 5 )
                      ) ;

   hb_retnl( (LONG) dwRet ) ;

   if ( ! ISNIL( 5 ) && ( hb_parnl( 5 ) > 0 ) )
   {
      hb_storclen(cBuffer, dwRet, 4 ) ;
      hb_xfree( cBuffer ) ;
   }

}
_winfont.c297
HB_FUNCGETFONTLANGUAGEINFO(void)
HB_FUNC( GETFONTLANGUAGEINFO )
{
   hb_retnl( (LONG) GetFontLanguageInfo( (HDC) hb_parnl( 1 ) ) ) ;
}

//-----------------------------------------------------------------------------
// WINGDIAPI DWORD WINAPI GetFontUnicodeRanges( IN HDC, OUT LPGLYPHSET);

// no prototype ?

/*

HB_FUNC( GETFONTUNICODERANGES )
{
   LPGLYPHSET lpglyphSet ;

   // Your code goes here

   hb_retnl( (LONG) GetFontUnicodeRanges( (HDC) hb_parnl( 1 ), lpglyphSet ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI HANDLE WINAPI AddFontMemResourceEx( IN PVOID, IN DWORD, IN PVOID , IN DWORD*);

// no info

/*

HB_FUNC( ADDFONTMEMRESOURCEEX )
{
   PVOID pVoid1 ;
   PVOID pVoid2 ;

   // Your code goes here

   hb_retnl( (LONG) AddFontMemResourceEx( pVoid1               ,
                                          (DWORD) hb_parnl( 2 ),
                                          pVoid2               ,
                                          (DWORD) hb_parnl( 4 )
                                          ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI AddFontResourceExA( IN LPCSTR, IN DWORD, IN PVOID);

// no info

/*

HB_FUNC( ADDFONTRESOURCEEXA )
{
   PVOID  pVoid  ;

   // Your code goes here

   hb_retni( AddFontResourceExA( (LPCSTR) hb_parcx( 1 ),
                                 (DWORD) hb_parnl( 2 ),
                                 pVoid
                                 ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI RemoveFontMemResourceEx( IN HANDLE);

// no prototype ?

_winfont.c326
HB_FUNCREMOVEFONTRESOURCE(void)
HB_FUNC( REMOVEFONTRESOURCE )
{
   hb_retl( RemoveFontResource( (LPCSTR) hb_parcx( 1 ) ) ) ;
}



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI RemoveFontResourceExA( IN LPCSTR, IN DWORD, IN PVOID);

// no info

_winfont.c411
_wingdi.c
TypeFunctionSourceLine
HB_FUNCRGB(void)
HB_FUNC( RGB )
{
   hb_retnl((ULONG)(COLORREF)(((BYTE)(hb_parni(1))|
                              ((WORD)((BYTE)(hb_parni(2)))<<8))|
                              (((DWORD)(BYTE)(hb_parni(3)))<<16)));
}
_wingdi.c44
HB_FUNCGETGVALUE(void)
HB_FUNC( GETGVALUE )
{
  hb_retni( (INT) GetGValue( (DWORD) hb_parnl( 1 ) ) );
}
_wingdi.c54
HB_FUNCGETBVALUE(void)
HB_FUNC( GETBVALUE )
{
  hb_retni( (INT) GetBValue( (DWORD) hb_parnl( 1 ) ) );
}
_wingdi.c62
HB_FUNCGETRVALUE(void)
HB_FUNC( GETRVALUE )
{
  hb_retni( (INT) GetRValue( (DWORD) hb_parnl( 1 ) ) );
}
_wingdi.c70
HB_FUNCSETTEXTCOLOR(void)
HB_FUNC( SETTEXTCOLOR )
{

  hb_retnl( (ULONG) SetTextColor( (HDC) hb_parnl( 1 ), (COLORREF) hb_parnl(2) ) ) ;

}
_wingdi.c79
HB_FUNCGETTEXTCOLOR(void)
HB_FUNC( GETTEXTCOLOR )
{
   hb_retnl((ULONG) GetTextColor( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c91
HB_FUNCGETBKCOLOR(void)
HB_FUNC( GETBKCOLOR )
{
   hb_retnl( (ULONG) GetBkColor( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c102
HB_FUNCSETBKCOLOR(void)
HB_FUNC( SETBKCOLOR )
{

   hb_retnl( (ULONG) SetBkColor( (HDC) hb_parnl( 1 ), (COLORREF) hb_parnl(2) ) ) ;
}
_wingdi.c112
HB_FUNCUPDATECOLORS(void)
HB_FUNC( UPDATECOLORS )
{
   hb_retl( UpdateColors( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c122
HB_FUNCGETSTOCKOBJECT(void)
HB_FUNC( GETSTOCKOBJECT )
{
   hb_retnl( (LONG) GetStockObject( hb_parni( 1 ) ) ) ;
}
_wingdi.c138
HB_FUNCSELECTOBJECT(void)
HB_FUNC( SELECTOBJECT )
{
   hb_retnl( (LONG) SelectObject( (HDC) hb_parnl( 1 ), (HGDIOBJ) hb_parnl( 2 ) ) ) ;
}
_wingdi.c149
HB_FUNCDELETEOBJECT(void)
HB_FUNC( DELETEOBJECT )
{
   hb_retl( DeleteObject( (HGDIOBJ) hb_parnl( 1 ) ) ) ;
}
_wingdi.c160
HB_FUNCUNREALIZEOBJECT(void)
HB_FUNC( UNREALIZEOBJECT )
{
   hb_retl( UnrealizeObject( (HGDIOBJ) hb_parnl( 1 ) ) ) ;
}
_wingdi.c170
HB_FUNCGETOBJECTTYPE(void)
HB_FUNC( GETOBJECTTYPE )
{
   hb_retnl( (LONG) GetObjectType( (HGDIOBJ) hb_parnl( 1 ) ) ) ;
}
_wingdi.c182
HB_FUNCGETCURRENTOBJECT(void)
HB_FUNC( GETCURRENTOBJECT )
{
   hb_retnl( (LONG) GetCurrentObject( (HDC) hb_parnl( 1 ), (UINT) hb_parni( 2 ) ) ) ;
}
_wingdi.c193
HB_FUNCGETOBJECT(void)
HB_FUNC( GETOBJECT )
{

   int nBytes = GetObject( (HGDIOBJ) hb_parnl( 1 ), 0, NULL );
   LPVOID  lpObj = (VOID *) hb_xgrab(nBytes) ;

   nBytes = GetObject( (HGDIOBJ) hb_parnl( 1 ), nBytes, lpObj )  ;

   hb_retclen( (char *) lpObj,nBytes) ;
   hb_xfree(lpObj);

}


//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI EnumObjects( IN HDC, IN int, IN GOBJENUMPROC, IN LPVOID);

_wingdi.c205
HB_FUNCGETMAPMODE(void)
HB_FUNC( GETMAPMODE )
{
   hb_retni( GetMapMode( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c248
HB_FUNCSETMAPMODE(void)
HB_FUNC( SETMAPMODE )
{
   hb_retni( SetMapMode( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_wingdi.c259
HB_FUNCSETMAPPERFLAGS(void)
HB_FUNC( SETMAPPERFLAGS )
{
   hb_retnl( (LONG) SetMapperFlags( (HDC) hb_parnl( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_wingdi.c268
HB_FUNCBEGINPAINT(void)
HB_FUNC( BEGINPAINT )
{
   PAINTSTRUCT pps ;
   hb_retnl( (LONG) BeginPaint( (HWND) hb_parnl( 1 ), &pps ) ) ;
   hb_storclen( (char *) &pps, sizeof(PAINTSTRUCT), 2 );
}
_wingdi.c286
HB_FUNCENDPAINT(void)
HB_FUNC( ENDPAINT )
{
   hb_retl( EndPaint( (HWND) hb_parnl( 1 ), (PAINTSTRUCT*) hb_parcx( 2 ) ) );
}
_wingdi.c299
HB_FUNCGETGRAPHICSMODE(void)
HB_FUNC( GETGRAPHICSMODE )
{
   hb_retni( GetGraphicsMode( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c309
HB_FUNCGDICOMMENT(void)
HB_FUNC( GDICOMMENT )
{

   hb_retl( GdiComment( (HDC) hb_parnl( 1 ), (UINT) hb_parni( 2 ), ( const BYTE * ) hb_parcx( 3 ) ) ) ;

}
_wingdi.c320
HB_FUNCGDISETBATCHLIMIT(void)
HB_FUNC( GDISETBATCHLIMIT )
{
   hb_retnl( (LONG) GdiSetBatchLimit( (DWORD) hb_parnl( 1 ) ) ) ;
}
_wingdi.c333
HB_FUNCSELECTCLIPPATH(void)
HB_FUNC( SELECTCLIPPATH )
{
   hb_retl( SelectClipPath( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_wingdi.c350
HB_FUNCWIDENPATH(void)
HB_FUNC( WIDENPATH )
{
   hb_retl( WidenPath( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c363
HB_FUNCSTROKEANDFILLPATH(void)
HB_FUNC( STROKEANDFILLPATH )
{
   hb_retl( StrokeAndFillPath( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c374
HB_FUNCSTROKEPATH(void)
HB_FUNC( STROKEPATH )
{
   hb_retl( StrokePath( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c383
HB_FUNCENDPATH(void)
HB_FUNC( ENDPATH )
{
   hb_retl( EndPath( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c394
HB_FUNCABORTPATH(void)
HB_FUNC( ABORTPATH )
{
   hb_retl( AbortPath( (HDC) hb_parnl( 1 ) ) ) ;
}



//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI GetPath(IN HDC, OUT LPPOINT, OUT LPBYTE, IN int);

_wingdi.c405
HB_FUNCLPTODP(void)
HB_FUNC( LPTODP )
{
   POINT * Point ;
   POINT pt;
   INT iCount ;
   INT i ;
   PHB_ITEM aParam;
   PHB_ITEM aSub;


   if (ISARRAY( 2 ) )
   {
       iCount = hb_parinfa( 2, 0 ) ;
       Point = ( POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_wingdi.c438
HB_FUNCDPTOLP(void)
HB_FUNC( DPTOLP )
{
   POINT * Point ;
   POINT pt;
   INT iCount ;
   INT i ;
   PHB_ITEM aParam;
   PHB_ITEM aSub;


   if (ISARRAY( 2 ) )
   {
       iCount = hb_parinfa( 2, 0 ) ;
       Point = ( POINT * ) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(2,HB_IT_ARRAY);

       for ( i = 0 ; i
_wingdi.c496
HB_FUNCGETDEVICECAPS(void)
HB_FUNC( GETDEVICECAPS )
{
   hb_retni( GetDeviceCaps( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_wingdi.c550
HB_FUNCPAINTDESKTOP(void)
HB_FUNC( PAINTDESKTOP )
{
   hb_retl( PaintDesktop( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c560
HB_FUNCGETGUIRESOURCES(void)
HB_FUNC( GETGUIRESOURCES )
{
   hb_retnl( (LONG) GetGuiResources( (HANDLE) hb_parnl( 1 ),
                                     (DWORD) hb_parnl( 2 )
                                   ) ) ;
}
_wingdi.c574
HB_FUNCPTVISIBLE(void)
HB_FUNC( PTVISIBLE )
{
   hb_retl( PtVisible( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_wingdi.c587
HB_FUNCSETGRAPHICSMODE(void)
HB_FUNC( SETGRAPHICSMODE )
{
   hb_retni( SetGraphicsMode( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}


//-----------------------------------------------------------------------------
// WINGDIAPI DWORD WINAPI SetLayout(IN HDC, IN DWORD);

_wingdi.c597
HB_FUNCSWAPBUFFERS(void)
HB_FUNC( SWAPBUFFERS )
{
   hb_retl( SwapBuffers( (HDC) hb_parnl( 1 ) ) ) ;
}
_wingdi.c617
HB_FUNCGETCLIPBOX(void)
HB_FUNC( GETCLIPBOX )
{
   RECT Rect ;
   PHB_ITEM aRect ;

   hb_retni( GetClipBox( (HDC) hb_parnl( 1 ), &Rect ) ) ;

      aRect = Rect2Array( &Rect ) ;
      _itemReturn( aRect );
      _itemRelease( aRect );


}


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetMiterLimit(IN HDC, OUT PFLOAT);

_wingdi.c629
HB_FUNCGETRASTERIZERCAPS(void)
HB_FUNC( GETRASTERIZERCAPS )
{
   LPRASTERIZER_STATUS lprs = (LPRASTERIZER_STATUS) hb_parc(1); //hb_param( 1,HB_IT_STRING )->item.asString.value;

   if( GetRasterizerCaps( lprs, (UINT) hb_parni( 2 ) ) )
       hb_retclen( (char*) lprs, sizeof(RASTERIZER_STATUS) ) ;
   //hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) lprs, sizeof(RASTERIZER_STATUS ) );

}
_wingdi.c665
HB_FUNCGETASPECTRATIOFILTEREX(void)
HB_FUNC( GETASPECTRATIOFILTEREX )
{
   SIZE lpSize ;
   PHB_ITEM pArray=hb_param(2,HB_IT_ARRAY);
   // Your code goes here

   if( GetAspectRatioFilterEx( (HDC) hb_parnl( 1 ), &lpSize ) )
      {
      Size2ArrayEx(&lpSize,pArray);
      hb_retl(TRUE);
      }
   else
      hb_retl(FALSE);


}




//-----------------------------------------------------------------------------
// WINSPOOLAPI int WINAPI DeviceCapabilitiesA( IN LPCSTR, IN LPCSTR, IN WORD, OUT LPSTR, IN CONST DEVMODEA *);

_wingdi.c683
HB_FUNCGETUPDATERECT(void)
HB_FUNC( GETUPDATERECT )
{
   RECT Rect ;
   PHB_ITEM aRect ;

   if ( GetUpdateRect( (HWND) hb_parnl( 1 ), &Rect, hb_parl( 2 ) ) )
   {
      aRect = Rect2Array( &Rect ) ;
      _itemReturn( aRect );
      _itemRelease( aRect );
   }

}


//-----------------------------------------------------------------------------
// WINUSERAPI DWORD WINAPI DragObject( IN HWND, IN HWND, IN UINT, IN ULONG_PTR, IN HCURSOR);

/*

HB_FUNC( DRAGOBJECT )
{
   ULONG_PTR uLong_ptr ;

   // Your code goes here

   hb_retnl( (LONG) DragObject( (HWND) hb_parnl( 1 )   ,
                                (HWND) hb_parnl( 2 )   ,
                                (UINT) hb_parni( 3 )   ,
                                uLong_ptr              ,
                                (HCURSOR) hb_parnl( 5 )
                              ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI DragDetect( IN HWND, IN POINT);

_wingdi.c732
HB_FUNCDRAGDETECT(void)
HB_FUNC( DRAGDETECT )
{
   POINT PoInt ;
   PHB_ITEM pArray;
   if (ISARRAY(2))
   {
      pArray = hb_param(2, HB_IT_ARRAY) ;
      Array2Point(pArray,&PoInt);
      hb_retl( DragDetect( (HWND) hb_parnl( 1 ), PoInt ) ) ;
   }
   else
      hb_retl(FALSE);
}
_wingdi.c777
HB_FUNCGETDRAWITEMSTRUCT(void)
HB_FUNC( GETDRAWITEMSTRUCT )
{

  DRAWITEMSTRUCT *dis =(DRAWITEMSTRUCT*) hb_parnl( 1 ) ;

  PHB_ITEM arrDis = _itemArrayNew(12) ;
  PHB_ITEM temp ;

  temp = _itemPutNL( NULL, dis->CtlType );
  hb_arraySet( arrDis, 1, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->CtlID );
  hb_arraySet( arrDis, 2, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->itemID );
  hb_arraySet( arrDis, 3, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->itemAction );
  hb_arraySet( arrDis, 4, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->itemState );
  hb_arraySet( arrDis, 5, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, (LONG) dis->hwndItem );
  hb_arraySet( arrDis, 6, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, (LONG) dis->hDC );
  hb_arraySet( arrDis, 7, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->rcItem.left );
  hb_arraySet( arrDis, 8, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->rcItem.top );
  hb_arraySet( arrDis, 9, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->rcItem.right );
  hb_arraySet( arrDis, 10, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->rcItem.bottom );
  hb_arraySet( arrDis, 11, temp );
  _itemRelease( temp );

  temp = _itemPutNL( NULL, dis->itemData );
  hb_arraySet( arrDis, 12, temp );
  _itemRelease( temp );

  _itemReturn( arrDis );
  _itemRelease( arrDis );
}
_wingdi.c795
HB_FUNCDRAWFRAMECONTROL(void)
HB_FUNC( DRAWFRAMECONTROL )
{
   RECT lpRect ;
   PHB_ITEM pArray=hb_param(2,HB_IT_ARRAY);

   // Your code goes here
   if (Array2Rect(pArray,&lpRect))
   {
      if( DrawFrameControl( (HDC) hb_parnl( 1 ) ,
                              &lpRect              ,
                              (UINT) hb_parni( 3 ),
                              (UINT) hb_parni( 4 )
                            ) )
   {
         Rect2ArrayEx(&lpRect,pArray);
         hb_retl(TRUE);
   }
      else
         hb_retl(FALSE);
}
else
   hb_retl(FALSE);
}
_wingdi.c861
HB_FUNCDRAWANIMATEDRECTS(void)
HB_FUNC( DRAWANIMATEDRECTS )
{
   RECT lprcFrom ;
   RECT lprcTo   ;

   // Your code goes here
   if ( Array2Rect(hb_param(3,HB_IT_ARRAY),&lprcFrom ) && Array2Rect(hb_param(4,HB_IT_ARRAY) ,&lprcFrom ))
   {
      if(DrawAnimatedRects( (HWND) hb_parnl( 1 ),
                               hb_parni( 2 )       ,
                               &lprcFrom           ,
                               &lprcTo
                             ) )
         hb_retl(TRUE);
      else
         hb_retl(FALSE);
   }
   else
      hb_retl(FALSE);

}
_wingdi.c893
HB_FUNCGETWINDOWORGEX(void)
HB_FUNC( GETWINDOWORGEX )
{
   POINT lpPoInt ;
   PHB_ITEM pArray=hb_param(2,HB_IT_ARRAY);


   if( GetWindowOrgEx( (HDC) hb_parnl( 1 ), &lpPoInt ) )
      {
         Point2ArrayEx(&lpPoInt,pArray);
         hb_retl(TRUE);
      }
   else
      hb_retl(FALSE);
}



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetWorldTransform( IN HDC, OUT LPXFORM);

/*

HB_FUNC( GETWORLDTRANSFORM )
{
   LPXFORM lpxForm ;

   // Your code goes here

   hb_retl( GetWorldTransform( (HDC) hb_parnl( 1 ), lpxForm ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI ModifyWorldTransform( IN HDC, IN CONST XFORM *, IN DWORD);

/*

HB_FUNC( MODIFYWORLDTRANSFORM )
{
   CONST XFORM ;

   // Your code goes here

   hb_retl( ModifyWorldTransform( (HDC) hb_parnl( 1 )  ,
                                  &XFORM               ,
                                  (DWORD) hb_parnl( 3 )
                                  ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI OffsetViewportOrgEx( IN HDC, IN int, IN int, OUT LPPOINT);

/*

HB_FUNC( OFFSETVIEWPORTORGEX )
{
   LPPOINT lpPoInt ;

   // Your code goes here

   hb_retl( OffsetViewportOrgEx( (HDC) hb_parnl( 1 ),
                                 hb_parni( 2 )      ,
                                 hb_parni( 3 )      ,
                                 lpPoInt
                                 ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI OffsetWindowOrgEx( IN HDC, IN int, IN int, OUT LPPOINT);

_wingdi.c923
HB_FUNCSCALEWINDOWEXTEX(void)
HB_FUNC( SCALEWINDOWEXTEX )
{
   SIZE lpSize ;
   PHB_ITEM pArray=hb_param(6,HB_IT_ARRAY);


   if( ScaleWindowExtEx( (HDC) hb_parnl( 1 ),
                              hb_parni( 2 )      ,
                              hb_parni( 3 )      ,
                              hb_parni( 4 )      ,
                              hb_parni( 5 )      ,
                              &lpSize
                              ) )
   {
      Size2ArrayEx(&lpSize,pArray);
      hb_retl(TRUE);
   }
   else
   hb_retl(FALSE);
}



//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI SetBoundsRect(IN HDC, IN CONST RECT *, IN UINT);

/*

HB_FUNC( SETBOUNDSRECT )
{
   CONST RECT ;

   // Your code goes here

   hb_retni( SetBoundsRect( (HDC) hb_parnl( 1 ), &RECT, (UINT) hb_parni( 3 ) ) ) ;
}

*/



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI SetWorldTransform( IN HDC, IN CONST XFORM *);

/*

HB_FUNC( SETWORLDTRANSFORM )
{
   CONST XFORM ;

   // Your code goes here

   hb_retl( SetWorldTransform( (HDC) hb_parnl( 1 ), &XFORM ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI SetMiterLimit(IN HDC, IN FLOAT, OUT PFLOAT);

_wingdi.c1021
_winhead.c
TypeFunctionSourceLine
HB_FUNCHEADER_CREATE(void)
HB_FUNC( HEADER_CREATE )
{

   hb_retnl( (LONG) CreateWindow(  "SysHeader32"         ,
                                   ""                    ,
                                   (DWORD) hb_parnl( 1 ) ,
                                   hb_parni( 2 )         ,
                                   hb_parni( 3 )         ,
                                   hb_parni( 4 )         ,
                                   hb_parni( 5 )         ,
                                   (HWND) hb_parnl( 6 )  ,
                                   (HMENU) hb_parni( 7 ) ,
                                   GetModuleHandle(NULL) ,
                                   NULL ) ) ;
}
_winhead.c30
HB_FUNCHEADER_GETITEMCOUNT(void)
HB_FUNC( HEADER_GETITEMCOUNT )
{
   hb_retni( Header_GetItemCount( (HWND) hb_parnl(1) ) );
}
_winhead.c50
HB_FUNCHEADER_INSERTITEM(void)
HB_FUNC( HEADER_INSERTITEM )
{
   HDITEM *hdi = ( HDITEM *) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING )->item.asString.value ;
   hb_retni( Header_InsertItem( (HWND) hb_parnl(1), hb_parni(2), hdi ) ) ;
}
_winhead.c59
HB_FUNCHEADER_DELETEITEM(void)
HB_FUNC( HEADER_DELETEITEM  )
{
   hb_retl( Header_DeleteItem( (HWND) hb_parnl(1), hb_parni(2) ) ) ;
}
_winhead.c69
HB_FUNCHEADER_GETITEM(void)
HB_FUNC( HEADER_GETITEM )
{
   HDITEM hdi ;
   BOOL lRet = Header_GetItem( (HWND) hb_parnl(1), hb_parni(2), &hdi ) ;
   if ( lRet )
       hb_retclen( (char*) &hdi, sizeof(HDITEM) ) ;
      //hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) hdi, sizeof( HDITEM ) );

}
_winhead.c81
HB_FUNCHEADER_SETITEM(void)
HB_FUNC( HEADER_SETITEM )
{
   HDITEM *hdi = ( HDITEM * ) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING )->item.asString.value ;
   hb_retl( Header_SetItem( (HWND) hb_parnl(1), hb_parni(2), hdi ) ) ;
}
_winhead.c95
HB_FUNCHEADER_CREATEDRAGIMAGE(void)
HB_FUNC( HEADER_CREATEDRAGIMAGE )
{

   hb_retnl( (ULONG) Header_CreateDragImage( (HWND) hb_parnl(1), hb_parni(2) ) ) ;

}
_winhead.c105
HB_FUNCHEADER_GETORDERARRAY(void)
HB_FUNC( HEADER_GETORDERARRAY )
{

  UINT iCount = Header_GetItemCount((HWND)hb_parnl(1) );
  PHB_ITEM aInt ;
  PHB_ITEM temp ;
  INT *lpi = (INT*) hb_xgrab( iCount*sizeof(INT)) ;
  BOOL lRet = Header_GetOrderArray((HWND) hb_parnl(1), iCount, lpi )  ;
  UINT i;

  if ( lRet )
  {
      aInt  = _itemArrayNew(iCount ) ;
      for ( i = 0; i
_winhead.c119
HB_FUNCHEADER_SETORDERARRAY(void)
HB_FUNC(  HEADER_SETORDERARRAY )
{
   UINT iCount ;
   INT *lpi    ;
   UINT i      ;

   if( hb_parinfo( 2 ) == HB_IT_ARRAY  )
      {

          iCount = hb_parinfa( 2, 0 );
          lpi = (INT*) hb_xgrab( iCount*sizeof(INT) ) ;
          for ( i= 0 ; i
_winhead.c159
HB_FUNCHEADER_GETITEMRECT(void)
HB_FUNC( HEADER_GETITEMRECT )
{
   RECT rc ;
   PHB_ITEM aRc ;

   if ( Header_GetItemRect((HWND) hb_parnl(1), (WPARAM) hb_parni(2), &rc ) )
   {
      aRc = Rect2Array( &rc );
      _itemReturn( aRc );
      _itemRelease( aRc );

   }

}
_winhead.c190
HB_FUNCHEADER_GETIMAGELIST(void)
HB_FUNC( HEADER_GETIMAGELIST )
{

    hb_retnl( (ULONG)Header_GetImageList((HWND) hb_parnl(1) ) ) ;

}
_winhead.c210
HB_FUNCHEADER_SETIMAGELIST(void)
HB_FUNC( HEADER_SETIMAGELIST )
{

   hb_retnl( (ULONG) Header_SetImageList((HWND) hb_parnl(1), (LPARAM) hb_parnl(2) ) ) ;

}
_winhead.c221
HB_FUNCHEADER_ORDERTOINDEX(void)
HB_FUNC( HEADER_ORDERTOINDEX )
{

   hb_retni( Header_OrderToIndex((HWND) hb_parnl(1), hb_parni(2) ) ) ;

}
_winhead.c232
HB_FUNCHEADER_SETHOTDIVIDER(void)
HB_FUNC( HEADER_SETHOTDIVIDER )
{

   hb_retni( Header_SetHotDivider((HWND) hb_parnl(1), hb_parl(2), (LPARAM) hb_parnl(3)));

}
_winhead.c247
HB_FUNCHEADER_SETBITMAPMARGIN(void)
HB_FUNC( HEADER_SETBITMAPMARGIN )
{

   hb_retni( Header_SetBitmapMargin( (HWND) hb_parnl(1), hb_parni(2) ) ) ;

}
_winhead.c258
HB_FUNCHEADER_GETBITMAPMARGIN(void)
HB_FUNC( HEADER_GETBITMAPMARGIN )
{

   hb_retni( Header_GetBitmapMargin( (HWND) hb_parnl(1) ) ) ;

}
_winhead.c269
HB_FUNCHEADER_SETUNICODEFORMAT(void)
HB_FUNC( HEADER_SETUNICODEFORMAT )
{

   hb_retl( Header_SetUnicodeFormat( (HWND) hb_parnl(1), hb_parl( 2 ) ) ) ;

}
_winhead.c280
HB_FUNCHEADER_GETUNICODEFORMAT(void)
HB_FUNC( HEADER_GETUNICODEFORMAT )
{

   hb_retl( Header_GetUnicodeFormat((HWND) hb_parnl(1) ) ) ;

}
_winhead.c291
HB_FUNCHEADER_SETFILTERCHANGETIMEOUT(void)
HB_FUNC( HEADER_SETFILTERCHANGETIMEOUT )
{

   hb_retni( Header_SetFilterChangeTimeout((HWND) hb_parnl(1), hb_parni( 2 ) ) ) ;

}
_winhead.c302
HB_FUNCHEADER_EDITFILTER(void)
HB_FUNC( HEADER_EDITFILTER )
{

   hb_retni( Header_EditFilter( (HWND) hb_parnl(1), hb_parni( 2 ), hb_parl( 3 ) ) ) ;

}
_winhead.c313
HB_FUNCHEADER_CLEARALLFILTERS(void)
HB_FUNC( HEADER_CLEARALLFILTERS )
{

   hb_retni( Header_ClearAllFilters( (HWND) hb_parnl(1) ) ) ;

}
_winhead.c324
HB_FUNCHEADER_CLEARFILTER(void)
HB_FUNC( HEADER_CLEARFILTER )
{

   hb_retni( Header_ClearFilter( (HWND) hb_parnl(1), hb_parni( 2 ) ) ) ;

}
_winhead.c338
HB_FUNCHEADER_LAYOUT(void)
HB_FUNC( HEADER_LAYOUT )
{
   HD_LAYOUT *hdLayout = ( HD_LAYOUT *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;
   hb_retl( Header_Layout( (HWND) hb_parnl(1), hdLayout ) );
}
_winhead.c349
_winicon.c
TypeFunctionSourceLine
HB_FUNCLOADICON(void)
HB_FUNC( LOADICON )
{
   hb_retnl( (LONG) LoadIcon(  ( ISNIL(1) ? NULL : (HINSTANCE) hb_parnl( 1 ) ) ,
             (hb_parinfo(2)==HB_IT_STRING ? hb_parcx(2) : MAKEINTRESOURCE( (WORD) hb_parni(2))) ) ) ;
}
_winicon.c28
HB_FUNCCREATEICON(void)
HB_FUNC( CREATEICON )
{

   hb_retnl( (LONG) CreateIcon(  ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ),
                                hb_parni( 2 )            ,
                                hb_parni( 3 )            ,
                                (BYTE) hb_parni( 4 )     ,
                                (BYTE) hb_parni( 5 )     ,
                                (BYTE *) hb_parcx( 5 )    ,
                                (BYTE *) hb_parcx( 6 )
                              ) ) ;
}
_winicon.c40
HB_FUNCDESTROYICON(void)
HB_FUNC( DESTROYICON )
{
   hb_retl( DestroyIcon( (HICON) hb_parnl( 1 ) ) ) ;
}
_winicon.c58
HB_FUNCLOOKUPICONIDFROMDIRECTORY(void)
HB_FUNC( LOOKUPICONIDFROMDIRECTORY )
{

   hb_retni( LookupIconIdFromDirectory( (PBYTE) hb_parcx( 1 ), hb_parl( 2 ) ) ) ;
}
_winicon.c67
HB_FUNCLOOKUPICONIDFROMDIRECTORYEX(void)
HB_FUNC( LOOKUPICONIDFROMDIRECTORYEX )
{

   hb_retni( LookupIconIdFromDirectoryEx( (PBYTE) hb_parcx( 1 ) ,
                                          hb_parl( 2 )         ,
                                          hb_parni( 3 )        ,
                                          hb_parni( 4 )        ,
                                          (UINT) hb_parni( 5 )
                                        ) ) ;
}
_winicon.c78
HB_FUNCCREATEICONFROMRESOURCE(void)
HB_FUNC( CREATEICONFROMRESOURCE )
{

   hb_retnl( (LONG) CreateIconFromResource( (PBYTE) hb_parcx( 1 ) ,
                                            (DWORD) hb_parnl( 2 ),
                                            hb_parl( 3 )         ,
                                            (DWORD) hb_parnl( 4 )
                                          ) ) ;
}
_winicon.c93
HB_FUNCCREATEICONFROMRESOURCEEX(void)
HB_FUNC( CREATEICONFROMRESOURCEEX )
{

   hb_retnl( (LONG) CreateIconFromResourceEx( (PBYTE) hb_parcx( 1 )  ,
                                              (DWORD) hb_parnl( 2 ) ,
                                              hb_parl( 3 )          ,
                                              (DWORD) hb_parnl( 4 ) ,
                                              hb_parni( 5 )         ,
                                              hb_parni( 6 )         ,
                                              (UINT) hb_parni( 7 )
                                            ) ) ;
}
_winicon.c107
HB_FUNCLOADIMAGE(void)
HB_FUNC( LOADIMAGE )
{
   hb_retnl( (LONG) LoadImage( ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ),
                               (LPCSTR) hb_parcx( 2 )    ,
                               (UINT) hb_parni( 3 )     ,
                               hb_parni( 4 )            ,
                               hb_parni( 5 )            ,
                               (UINT) hb_parni( 6 )
                             ) ) ;
}
_winicon.c125
HB_FUNCCOPYIMAGE(void)
HB_FUNC( COPYIMAGE )
{
   hb_retnl( (LONG) CopyImage( (HANDLE) hb_parnl( 1 ),
                               (UINT) hb_parni( 2 )  ,
                               hb_parni( 3 )         ,
                               hb_parni( 4 )         ,
                               (UINT) hb_parni( 5 )
                             ) ) ;
}
_winicon.c140
HB_FUNCDRAWICON(void)
HB_FUNC( DRAWICON )
{
   hb_retl( DrawIcon( (HDC) hb_parnl( 1 )  ,
                      hb_parni( 2 )        ,
                      hb_parni( 3 )        ,
                      (HICON) hb_parnl( 4 )
                    ) ) ;
}
_winicon.c154
HB_FUNCDRAWICONEX(void)
HB_FUNC( DRAWICONEX )
{
   hb_retl( DrawIconEx( (HDC) hb_parnl( 1 )   ,
                        hb_parni( 2 )         ,
                        hb_parni( 3 )         ,
                        (HICON) hb_parnl( 4 ) ,
                        hb_parni( 5 )         ,
                        hb_parni( 6 )         ,
                        (UINT) hb_parni( 7 )  ,
                        (HBRUSH) hb_parnl( 8 ),
                        (UINT) hb_parni( 9 )
                      ) ) ;
}
_winicon.c168
HB_FUNCCREATEICONINDIRECT(void)
HB_FUNC( CREATEICONINDIRECT )
{
   ICONINFO *ii =  (ICONINFO * ) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value;

   hb_retnl( (LONG) CreateIconIndirect( ii ) ) ;
}
_winicon.c186
HB_FUNCCOPYICON(void)
HB_FUNC( COPYICON )
{
   hb_retnl( (LONG) CopyIcon( (HICON) hb_parnl( 1 ) ) ) ;
}
_winicon.c199
HB_FUNCGETICONINFO(void)
HB_FUNC( GETICONINFO )
{
   ICONINFO ii;

   hb_retl( GetIconInfo( (HICON) hb_parnl( 1 ), &ii ) ) ;

   // verify !!
   // assign into structure

   hb_storclen( (char *) &ii, sizeof( ICONINFO ), 2 );

}
_winicon.c207
HB_FUNCDUPLICATEICON(void)
HB_FUNC( DUPLICATEICON )
{
   hb_retnl( (LONG) DuplicateIcon(  ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ),
                                   (HICON) hb_parnl( 2 )
                                 ) ) ;
}
_winicon.c225
HB_FUNCEXTRACTASSOCIATEDICON(void)
HB_FUNC( EXTRACTASSOCIATEDICON )
{
   WORD lpiIcon  ;
   HICON  hiRet ;

   lpiIcon = (WORD) hb_parni( 2 );

   hiRet = ExtractAssociatedIcon( ( ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ) ) ,
                                             (LPSTR) hb_parcx( 2 )     ,
                                             &lpiIcon
                                ) ;

   if ( hiRet )
      hb_storni( lpiIcon, 2 );

   hb_retnl( (LONG) hiRet );

}
_winicon.c235
HB_FUNCEXTRACTICON(void)
HB_FUNC( EXTRACTICON )
{
   hb_retnl( (LONG) ExtractIcon( ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ),
                                 (LPCSTR) hb_parcx( 2 )    ,
                                 (UINT) hb_parni( 3 )
                               ) ) ;
}
_winicon.c259
_winilst.c
TypeFunctionSourceLine
HB_FUNCIMAGELIST_CREATE(void)
HB_FUNC( IMAGELIST_CREATE )
{
   HIMAGELIST ilist;
   ilist = ImageList_Create( hb_parni(1), hb_parni(2), hb_parnl(3), hb_parni(4), hb_parni(5));
   hb_retnl((LONG) ilist);
}
_winilst.c22
HB_FUNCIMAGELIST_REPLACEICON(void)
HB_FUNC( IMAGELIST_REPLACEICON )
{
   hb_retni( ImageList_ReplaceIcon( (HIMAGELIST) hb_parnl(1),
                          (int) hb_parni(2)                 ,
                          (HICON) hb_parnl(3) ) )           ;
}
_winilst.c32
HB_FUNCIMAGELIST_ADDICON(void)
HB_FUNC( IMAGELIST_ADDICON )
{
   hb_retni( ImageList_AddIcon( (HIMAGELIST) hb_parnl(1), (HICON) hb_parnl(2) ) );
}
_winilst.c42
HB_FUNCIMAGELIST_DESTROY(void)
HB_FUNC( IMAGELIST_DESTROY )
{
   hb_retl( ImageList_Destroy( (HIMAGELIST) hb_parnl(1) ) );
}
_winilst.c50
HB_FUNCIMAGELIST_GETIMAGECOUNT(void)
HB_FUNC( IMAGELIST_GETIMAGECOUNT )
{

   hb_retni( ImageList_GetImageCount((HIMAGELIST) hb_parnl(1) ) );

}
_winilst.c58
HB_FUNCIMAGELIST_SETIMAGECOUNT(void)
HB_FUNC( IMAGELIST_SETIMAGECOUNT )
{
   hb_retl(  ImageList_SetImageCount((HIMAGELIST) hb_parnl( 1 ),
                                     (UINT) hb_parni( 2 ) ) )  ;
}
_winilst.c68
HB_FUNCIMAGELIST_ADD(void)
HB_FUNC( IMAGELIST_ADD )
{
   hb_retni( ImageList_Add((HIMAGELIST) hb_parnl( 1 ),
                           (HBITMAP) hb_parnl( 2 )   ,
                           (HBITMAP) hb_parnl( 3 ))) ;
}
_winilst.c77
HB_FUNCIMAGELIST_SETBKCOLOR(void)
HB_FUNC( IMAGELIST_SETBKCOLOR )
{
   hb_retnl( (LONG) ImageList_SetBkColor((HIMAGELIST) hb_parnl( 1 ),
                                         (COLORREF) hb_parnl( 2 )));
}
_winilst.c87
HB_FUNCIMAGELIST_GETBKCOLOR(void)
HB_FUNC( IMAGELIST_GETBKCOLOR )
{
   hb_retnl( (LONG) ImageList_GetBkColor((HIMAGELIST) hb_parnl( 1 )));
}
_winilst.c96
HB_FUNCIMAGELIST_SETOVERLAYIMAGE(void)
HB_FUNC( IMAGELIST_SETOVERLAYIMAGE )
{
   hb_retl(  ImageList_SetOverlayImage((HIMAGELIST) hb_parnl( 1 ) ,
                                        hb_parni(2), hb_parni(3)));
}
_winilst.c104
HB_FUNCIMAGELIST_DRAW(void)
HB_FUNC( IMAGELIST_DRAW )
{
   hb_retl( ImageList_Draw((HIMAGELIST) hb_parnl( 1 ), hb_parni(2)    ,
                           (HDC) hb_parnl(3), hb_parni(4), hb_parni(5),
                           (UINT) hb_parni(6)))                       ;

}
_winilst.c114
HB_FUNCIMAGELIST_REPLACE(void)
HB_FUNC( IMAGELIST_REPLACE )
{
   hb_retl(  ImageList_Replace((HIMAGELIST) hb_parnl( 1 ),
                                hb_parni( 2 )            ,
                                (HBITMAP) hb_parnl(3)    ,
                                (HBITMAP) hb_parnl(4)))  ;
}
_winilst.c125
HB_FUNCIMAGELIST_ADDMASKED(void)
HB_FUNC( IMAGELIST_ADDMASKED )
{
   hb_retni( ImageList_AddMasked((HIMAGELIST) hb_parnl( 1 ) ,
                                  (HBITMAP) hb_parnl( 2 )   ,
                                  (COLORREF) hb_parnl( 3 )));

}
_winilst.c136
HB_FUNCIMAGELIST_DRAWEX(void)
HB_FUNC( IMAGELIST_DRAWEX )
{
   hb_retl(  ImageList_DrawEx((HIMAGELIST) hb_parnl( 1 ), hb_parni( 2 )     ,
                              (HDC) hb_parnl( 3 ), hb_parni(4), hb_parni(5) ,
                              hb_parni(6), hb_parni(7),(COLORREF)hb_parnl(8),
                              (COLORREF) hb_parnl(9), (UINT) hb_parni(10))) ;
}
_winilst.c148
HB_FUNCIMAGELIST_DRAWINDIRECT(void)
HB_FUNC( IMAGELIST_DRAWINDIRECT )
{
  IMAGELISTDRAWPARAMS *pimldp  = ( IMAGELISTDRAWPARAMS *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value ;

   hb_retl(  ImageList_DrawIndirect( pimldp ) );
}
_winilst.c161
HB_FUNCIMAGELIST_REMOVE(void)
HB_FUNC( IMAGELIST_REMOVE )
{
   hb_retl( ImageList_Remove((HIMAGELIST) hb_parnl( 1 ), hb_parni( 2 )));
}
_winilst.c171
HB_FUNCIMAGELIST_GETICON(void)
HB_FUNC( IMAGELIST_GETICON )
{
   hb_retnl( (LONG) ImageList_GetIcon((HIMAGELIST) hb_parnl( 1 ),
                                       hb_parni( 2 )            ,
                                       (UINT) hb_parni(3)))     ;
}
_winilst.c179
HB_FUNCIMAGELIST_LOADIMAGE(void)
HB_FUNC( IMAGELIST_LOADIMAGE )
{
   hb_retnl( (LONG) ImageList_LoadImageA( (HINSTANCE) hb_parnl(1),
                                          ISCHAR(2)?(LPCSTR) hb_parcx(2) : MAKEINTRESOURCE(hb_parni(2))   ,
                                           hb_parni(3)           ,
                                           hb_parni(4)           ,
                                           (COLORREF) hb_parnl(5),
                                           (UINT) hb_parni(6)    ,
                                           (UINT) hb_parni(7)))  ;
}
_winilst.c190
HB_FUNCIMAGELIST_COPY(void)
HB_FUNC( IMAGELIST_COPY  )
{
   hb_retl( ImageList_Copy((HIMAGELIST) hb_parnl( 1 ),
                           hb_parni( 2 )             ,
                           (HIMAGELIST) hb_parnl( 3 ),
                           hb_parni( 4 )             ,
                           (UINT) hb_parni(5)))      ;
}
_winilst.c204
HB_FUNCIMAGELIST_BEGINDRAG(void)
HB_FUNC( IMAGELIST_BEGINDRAG )
{
   hb_retl( ImageList_BeginDrag((HIMAGELIST) hb_parnl( 1 ),
                                 hb_parni( 2 )            ,
                                 hb_parni( 3 )            ,
                                 hb_parni( 4 )))          ;

}

//-----------------------------------------------------------------------------
#if defined(__MINGW32__) || defined(__WATCOMC__)
void WINAPI ImageList_EndDrag(void);
#else
WINCOMMCTRLAPI void WINAPI ImageList_EndDrag(void);
_winilst.c216
HB_FUNCIMAGELIST_ENDDRAG(void)
HB_FUNC( IMAGELIST_ENDDRAG )
{
   ImageList_EndDrag() ;
}
_winilst.c232
HB_FUNCIMAGELIST_DRAGENTER(void)
HB_FUNC( IMAGELIST_DRAGENTER  )
{
   hb_retl( ImageList_DragEnter( (HWND) hb_parnl(1), hb_parni(2), hb_parni(3)));
}
_winilst.c240
HB_FUNCIMAGELIST_DRAGLEAVE(void)
HB_FUNC( IMAGELIST_DRAGLEAVE )
{
   hb_retl( ImageList_DragLeave( (HWND) hb_parnl(1)));
}
_winilst.c248
HB_FUNCIMAGELIST_MOVE(void)
HB_FUNC( IMAGELIST_MOVE )
{
   hb_retl( ImageList_DragMove( hb_parni(1), hb_parni(2)));

}
_winilst.c256
HB_FUNCIMAGELIST_SETDRAGCURSORIMAGE(void)
HB_FUNC( IMAGELIST_SETDRAGCURSORIMAGE  )
{
   hb_retl( ImageList_SetDragCursorImage((HIMAGELIST) hb_parnl( 1 ),
                                         hb_parni( 2 )             ,
                                         hb_parni( 3 )             ,
                                         hb_parni( 4 )))           ;
}
_winilst.c265
HB_FUNCIMAGELIST_DRAGSHOWNOLOCK(void)
HB_FUNC( IMAGELIST_DRAGSHOWNOLOCK )
{
   hb_retl( ImageList_DragShowNolock( hb_parl( 1 )));
}
_winilst.c276
HB_FUNCIMAGELIST_GETDRAGIMAGE(void)
HB_FUNC( IMAGELIST_GETDRAGIMAGE )
{
   POINT pt        ;
   POINT ptHotspot ;
   PHB_ITEM aPt1 = hb_param(1,HB_IT_ARRAY);
   PHB_ITEM aPt2 = hb_param(2,HB_IT_ARRAY);

   if ( Array2Point(aPt1,&pt) )
       if( Array2Point(aPt2,&ptHotspot) )
           hb_retnl( (LONG) ImageList_GetDragImage( &pt, &ptHotspot));
}
_winilst.c285
HB_FUNCIMAGELIST_GETICONSIZE(void)
HB_FUNC( IMAGELIST_GETICONSIZE )
{
   int cx ;
   int cy ;

   if ( ImageList_GetIconSize((HIMAGELIST) hb_parnl( 1 ), &cx, &cy) )
   {
      hb_storni( cx, 2 );
      hb_storni( cy, 3 );
      hb_retl( 1 );
   }
   else
     hb_retl(0);
}
_winilst.c301
HB_FUNCIMAGELIST_SETICONSIZE(void)
HB_FUNC( IMAGELIST_SETICONSIZE )
{
   hb_retl(  ImageList_SetIconSize((HIMAGELIST) hb_parnl( 1 )      ,
                                   hb_parni( 2 ), hb_parni( 3 ) ) );

}
_winilst.c319
HB_FUNCIMAGELIST_GETIMAGEINFO(void)
HB_FUNC( IMAGELIST_GETIMAGEINFO )
{
   IMAGEINFO ii ;

   if (  ImageList_GetImageInfo((HIMAGELIST) hb_parnl( 1 ), hb_parni( 2 ), &ii ) )
      hb_retclen( (char*) &ii, sizeof(IMAGEINFO));

}
_winilst.c331
HB_FUNCIMAGELIST_MERGE(void)
HB_FUNC( IMAGELIST_MERGE )
{
   hb_retnl( (LONG) ImageList_Merge((HIMAGELIST) hb_parnl( 1 ),
                                    hb_parni( 2 )             ,
                                    (HIMAGELIST) hb_parnl( 3 ),
                                    hb_parni( 4 )             ,
                                    hb_parni( 5 )             ,
                                    hb_parni( 6 )))           ;

}
_winilst.c344
HB_FUNCIMAGELIST_DUPLICATE(void)
HB_FUNC( IMAGELIST_DUPLICATE )
{
   hb_retnl( (LONG) ImageList_Duplicate((HIMAGELIST) hb_parnl( 1 )));
}
_winilst.c358
_wininet.c
TypeFunctionSourceLine
HB_FUNCINTERNETDIAL(void)
//
//     InternetDial()
//
HB_FUNC( INTERNETDIAL )
{
   HWND    hWnd   = ISNIL( 1 ) ? 0    : ( HWND ) hb_parnl( 1 ) ;
   LPTSTR  lpszId = ISNIL( 2 ) ? NULL : hb_parcx( 2 ) ;
   DWORD   nFlags = INTERNET_AUTODIAL_FORCE_ONLINE ;
   DWORD   nRet   = 0;

   hb_retnl( InternetDial( hWnd, lpszId, nFlags, &nRet, 0 ) );

}
_wininet.c38
HB_FUNCINTERNETGETCONNECTEDSTATE(void)
//
//     lIsOn := InternetGetConnectedState()
//
HB_FUNC( INTERNETGETCONNECTEDSTATE )
{
   hb_retl( InternetGetConnectedState( NULL, 0 ) ) ;
}
_wininet.c62
HB_FUNCINTERNETOPEN(void)
//
//   hInternet := InternetOpen()
//   if hInternet <> 0
//       hFtp := InternetConnect( hInternet, 'vouchcac.com', ;
//                   INTERNET_DEFAULT_FTP_PORT, cUserName, cPassword, ;
//                        INTERNET_SERVICE_FTP )
//       if hFtp <> 0
//          if FtpOpenFile( hFtp, 'Temp/Testing.txt', GENERIC_WRITE )
//             cBuffer  := 'This is testing string' + chr( 13 ) + chr( 10 )
//             lSuccess := InternetWrite( hFtp, cBuffer, len( cBuffer ), @nWritten )
//             if lSuccess
//                ? nWritten
//             endif
//          endif
//          InternetCloseHandle( hFtp )
//       endif
//       InternetCloseHandle( hInternet )
//   endif
//
//
//
HB_FUNC( INTERNETOPEN )
{
   LPCTSTR lpszAgent       = ISNIL( 1 ) ? NULL : hb_parcx( 1 ) ;
   DWORD   dwAccessType    = ISNIL( 2 ) ? INTERNET_OPEN_TYPE_DIRECT : hb_parnl( 2 ) ;
   LPCTSTR lpszProxyName   = ISNIL( 3 ) ? NULL : hb_parcx( 3 ) ;
   LPCTSTR lpszProxyBypass = ISNIL( 4 ) ? NULL : hb_parcx( 4 ) ;
   DWORD   dwFlags         = ISNIL( 5 ) ? 0    : hb_parnl( 5 ) ;

   hb_retnl( ( ULONG ) InternetOpen( lpszAgent, dwAccessType, lpszProxyName, lpszProxyBypass, dwFlags ) ) ;
}
_wininet.c77
HB_FUNCINTERNETCONNECT(void)
//
//       hFtp := InternetConnect( hInternet, 'chcac.com', ;
//                   INTERNET_DEFAULT_FTP_PORT, cUserName, cPassword, ;
//                        INTERNET_SERVICE_FTP )
//
HB_FUNC( INTERNETCONNECT )
{
   HINTERNET     hInternet      = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR       lpszServerName = hb_parcx( 2 )  ;
   INTERNET_PORT nServerPort    = ISNIL( 3 ) ? INTERNET_DEFAULT_HTTP_PORT : hb_parni( 3 ) ;
   LPCTSTR       lpszUserName   = ISNIL( 4 ) ? NULL : hb_parcx( 4 ) ;
   LPCTSTR       lpszPassword   = ISNIL( 5 ) ? NULL : hb_parcx( 5 ) ;
   DWORD         dwService      = ISNIL( 6 ) ? INTERNET_SERVICE_HTTP : hb_parnl( 6 ) ;
   DWORD         dwFlags        = ISNIL( 7 ) ? 0    : hb_parnl( 7 ) ;
   DWORD_PTR     dwContext      = ISNIL( 8 ) ? 0    : hb_parnl( 8 ) ;

   hb_retnl( ( ULONG ) InternetConnect( hInternet,    lpszServerName,
                              nServerPort, lpszUserName, lpszPassword,
                              dwService, dwFlags,      dwContext ) ) ;
}
_wininet.c119
HB_FUNCFTPOPENFILE(void)
//
//    if FtpOpenFile( hInternet, 'Temp/Config.sys', GENERIC_WRITE )
//       // take next step
//    endif
//
HB_FUNC( FTPOPENFILE )
{
   HINTERNET hFtp         = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszFileName = hb_parcx( 2 ) ;
   DWORD     dwAccess     = ISNIL( 3 ) ? GENERIC_READ : hb_parni( 3  ) ;
   DWORD     dwFlags      = ISNIL( 4 ) ? FTP_TRANSFER_TYPE_BINARY : hb_parni( 4 ) ;
   DWORD_PTR dwContext    = ISNIL( 5 ) ? 0            : hb_parnl( 5 ) ;

   hb_retl( FtpOpenFile( hFtp, lpszFileName, dwAccess, dwFlags, dwContext ) != NULL ) ;
}
_wininet.c153
HB_FUNCINTERNETWRITEFILE(void)
//
//    if InternetWriteFile( hFile, @cBuffer, len( cBuffer ), @nWritten )
//       // Take next step
//    endif
//
HB_FUNC( INTERNETWRITEFILE )
{
   HINTERNET hFile                    = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCVOID   lpBuffer                 = hb_parcx( 2 ) ;
   DWORD     dwNumberOfBytesToWrite   = ( DWORD ) hb_parnl( 3 ) ;
   LPDWORD   lpdwNumberOfBytesWritten = ( LPDWORD ) 0 ;

   hb_retl( InternetWriteFile( hFile, lpBuffer, dwNumberOfBytesToWrite,
                                                lpdwNumberOfBytesWritten ) ) ;

   if ISBYREF( 4 )
      hb_stornl( ( ULONG ) lpdwNumberOfBytesWritten, 4 ) ;
}
_wininet.c179
HB_FUNCINTERNETREADFILE(void)
//
//     if InternetReadFile( hFile, @cBuffer, len( cBuffer ), @nRead )
//        // Write to local handle
//     endif
//
HB_FUNC( INTERNETREADFILE )
{
   HINTERNET hFile                    = ( HINTERNET ) hb_parnl( 1 ) ;
   LPVOID    lpBuffer                 = hb_parcx( 2 ) ;
   DWORD     dwNumberOfBytesToRead    = ( DWORD ) hb_parnl( 3 ) ;
   LPDWORD   lpdwNumberOfBytesRead    = ( LPDWORD ) 0  ;
   BOOL      bRet ;

   bRet = InternetReadFile( hFile, &lpBuffer,
                            dwNumberOfBytesToRead, lpdwNumberOfBytesRead ) ;

   hb_retl( bRet );

   if( bRet )
   {
      if ISBYREF( 4 )
      {
         hb_stornl( ( ULONG ) lpdwNumberOfBytesRead, 4 ) ;
      }
      hb_storclen( ( char * ) lpBuffer, ( ULONG ) lpdwNumberOfBytesRead, 2 ) ;
   }
}
_wininet.c207
HB_FUNCFTPCOMMAND(void)
//
//
//
HB_FUNC( FTPCOMMAND )
{
   HINTERNET hInternet       = ( HINTERNET ) hb_parnl( 1 ) ;
   BOOL      fExpectResponse = ISNIL( 2 ) ? 0 : hb_parl( 2 ) ;
   DWORD     dwFlags         = ISNIL( 3 ) ? FTP_TRANSFER_TYPE_BINARY : hb_parnl( 3 ) ;
   LPCTSTR   lpszCommand     = hb_parcx( 4 ) ;
   DWORD_PTR dwContext       = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
   HINTERNET phFtpCommand ;

   BOOL      bRet ;

   bRet = FtpCommand( hInternet, fExpectResponse, dwFlags, lpszCommand,
                      dwContext, &phFtpCommand ) ;

   hb_retl( bRet ) ;

   if ( bRet )
   {
      if ( ISBYREF( 6 ) )
         hb_stornl( ( ULONG ) phFtpCommand, 6 ) ;
   }
}
_wininet.c244
HB_FUNCFTPFINDFIRSTFILE(void)
//
//   #include  'WinTypes.ch'
//   #include  'cStruct.ch'
//
//
//   pragma pack(4)
//
//   typedef struct { ;
//       DWORD    dwLowDateTime;
//       DWORD    dwHighDateTime;
//   } FILETIME
//
//   typedef struct { ;
//       DWORD    dwFileAttributes;
//       FILETIME ftCreationTime;
//       FILETIME ftLastAccessTime;
//       FILETIME ftLastWriteTime;
//       DWORD    nFileSizeHigh;
//       DWORD    nFileSizeLow;
//       DWORD    dwReserved0;
//       DWORD    dwReserved1;
//       char     cFileName[ MAX_PATH ];
//       char     cAlternateFileName[ 14 ];
//   } WIN32_FIND_DATA
//
//
//
//   Function FtpDirectory( hInternet, cFileSpec )
//   local hFile
//   local FindData IS WIN32_FIND_DATA
//   local cDirInfo := FindData:value
//
//   DEFAULT cFileSpec TO '*.*'
//
//   hFind := FtpFindFirstFile( hInternet, cFileSpec, @cDirInfo )
//   if hFind <> 0
//      FindData:Buffer( cDirInfo )
//
//      ? FindData:cFileName:value                // Name
//      ? FindData:dwFileAttributes               // Attribute in numeric, 16 for directory, 128 for file
//      ? FindData:nFileSizeLow                   // Size in bytes
//      ? findData:ftLastWriteTime:dwHighDateTime // Date, time in DWORD
//
//      do while .t.
//         if !InternetFindNextFile( hFind, @cDirInfo )
//            exit
//         endif
//         FindData:Buffer( cDirInfo )
//
//         ? FindData:cFileName:value                // Name
//         ? FindData:dwFileAttributes               // Attribute in numeric, 16 for directory, 128 for file
//         ? FindData:nFileSizeLow                   // Size in bytes
//         ? findData:ftLastWriteTime:dwHighDateTime // Date, time in DWORD
//      enddo
//
//   endif
//
//   return nil
//
//
HB_FUNC( FTPFINDFIRSTFILE )
{
   HINTERNET hInternet              = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszSearchFile         = ISNIL( 2 ) ? TEXT ("*.*") : hb_parcx( 2 ) ;
   WIN32_FIND_DATA FindFileData ;
   DWORD     dwFlags                = ISNIL( 4 ) ? INTERNET_FLAG_NEED_FILE : hb_parnl( 4 ) ;
   DWORD_PTR dwContext              = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
   HINTERNET hResult ;

   hResult = FtpFindFirstFile( hInternet, lpszSearchFile,
                                     &FindFileData, dwFlags, dwContext ) ;

   if ( hResult )
      if ( ISBYREF( 3 ) )
         hb_storclen( (char *) &FindFileData , sizeof( WIN32_FIND_DATA ), 3 ) ;

   hb_retnl( ( ULONG ) hResult ) ;
}
_wininet.c280
HB_FUNCINTERNETFINDNEXTFILE(void)
//
HB_FUNC( INTERNETFINDNEXTFILE )
{
   HINTERNET       hFind       = ( HINTERNET ) hb_parnl( 1 ) ;
   WIN32_FIND_DATA FindFileData ;

   if ( InternetFindNextFile( hFind, &FindFileData ) )
      {
         hb_retl( TRUE ) ;
         if ( ISBYREF( 2 ) )
            hb_storclen( ( char * ) &FindFileData, sizeof( WIN32_FIND_DATA ), 2 ) ;
      }
   else
      hb_retl( FALSE ) ;
}
_wininet.c369
HB_FUNCFTPGETFILE(void)
//
//   if FtpGetFile( hInternet, cRemoteFile, cLocalFile, lFailIfExist )
//      ? 'Success'
//   endif
//
HB_FUNC( FTPGETFILE )
{
   HINTERNET hInternet            = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszRemoteFile       = hb_parcx( 2 ) ;
   LPCTSTR   lpszLocalFile        = hb_parcx( 3 ) ;
   BOOL      fFailIfExist         = ISNIL( 4 ) ? FALSE : hb_parl( 4 ) ;
   DWORD     dwFlagsAndAttributes = ISNIL( 5 ) ? FILE_ATTRIBUTE_NORMAL : hb_parnl( 5 ) ;
   DWORD     dwFlags              = ISNIL( 6 ) ? FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_RELOAD : hb_parnl( 6 ) ;
   DWORD_PTR dwContext            = ISNIL( 7 ) ? 0 : hb_parnl( 7 ) ;

   hb_retl( FtpGetFile( hInternet, lpszRemoteFile, lpszLocalFile,
                        fFailIfExist, dwFlagsAndAttributes,
                        dwFlags, dwContext ) ) ;
}
_wininet.c392
HB_FUNCFTPPUTFILE(void)
//
//   if FtpPutFile( hInternet, cLocalFile, cRemoteFile )
//      ?
//   endif
//
HB_FUNC( FTPPUTFILE )
{
   HINTERNET hInternet            = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszLocalFile        = hb_parcx( 2 ) ;
   LPCTSTR   lpszRemoteFile       = hb_parcx( 3 ) ;
   DWORD     dwFlags              = ISNIL( 4 ) ? FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_RELOAD : hb_parnl( 4 ) ;
   DWORD_PTR dwContext            = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;

   hb_retl( FtpPutFile( hInternet, lpszLocalFile, lpszRemoteFile, dwFlags, dwContext ) ) ;
}
_wininet.c424
HB_FUNCFTPCREATEDIRECTORY(void)
//
//   if FtpCreateDirectory( hInternet, 'Temp' )
//      ? 'Success'
//   endif
//
HB_FUNC( FTPCREATEDIRECTORY )
{
   HINTERNET hInternet     = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszDirectory = hb_parcx( 2 ) ;

   hb_retl( FtpCreateDirectoryA( hInternet, lpszDirectory ) ) ;

}
_wininet.c450
HB_FUNCFTPREMOVEDIRECTORY(void)
//
//   if FtpRemoveDirectory( hInternet, cDirectory )
//      ? 'Success'
//   endif
//
HB_FUNC( FTPREMOVEDIRECTORY )
{
   HINTERNET hInternet     = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszDirectory = hb_parcx( 2 ) ;

   hb_retl( FtpRemoveDirectoryA( hInternet, lpszDirectory ) ) ;

}
_wininet.c471
HB_FUNCFTPDELETEFILE(void)
//
//   if FtpDeleteFile( hInternet, 'Temp\Config.sys' )
//      ? 'Sucess'
//   endif
//
HB_FUNC( FTPDELETEFILE )
{
   HINTERNET hInternet    = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszFileName = hb_parcx( 2 ) ;

   hb_retl( FtpDeleteFile( hInternet, lpszFileName ) ) ;

}
_wininet.c492
HB_FUNCFTPRENAMEFILE(void)
//
//   if FtpRenameFile( hInternet, cExisting, cNew )
//      ? 'Success'
//   endif
//
HB_FUNC( FTPRENAMEFILE )
{
   HINTERNET hInternet    = ( HINTERNET ) hb_parnl( 1 ) ;
   LPCTSTR   lpszExisting = hb_parcx( 2 ) ;
   LPCTSTR   lpszNew      = hb_parcx( 3 ) ;

   hb_retl( FtpRenameFileA( hInternet, lpszExisting, lpszNew ) ) ;

}
_wininet.c513
HB_FUNCFTPGETCURRENTDIRECTORY(void)
//
//   if FtpGetCurrentDirectory( hInternet, @cDirectory )
//      ? cDirectory
//   endif
//
HB_FUNC( FTPGETCURRENTDIRECTORY )
{
   HINTERNET hInternet           = ( HINTERNET ) hb_parnl( 1 ) ;
   LPTSTR   lpszCurrentDirectory = ( LPTSTR ) hb_xgrab( MAX_PATH ) ;
   DWORD    dwCurrentDirectory   = MAX_PATH     ;
   BOOL     bRet ;

   bRet = FtpGetCurrentDirectory( hInternet, lpszCurrentDirectory, &dwCurrentDirectory ) ;
   hb_retl( bRet ) ;

   if ( bRet )
   {
      if ( ISBYREF( 2 ) )
         hb_storclen( ( char * ) lpszCurrentDirectory, ( ULONG ) dwCurrentDirectory, 2 ) ;
   }

   hb_xfree( lpszCurrentDirectory ) ;
}
_wininet.c536
HB_FUNCFTPSETCURRENTDIRECTORY(void)
//
//    if FtpSetCurrentDirectory( hInternet, cDirectory )
//       ? 'Success'
//    endif
//
HB_FUNC( FTPSETCURRENTDIRECTORY )
{
   HINTERNET hInternet     = ( HINTERNET ) hb_parnl( 1 ) ;
   LPTSTR    lpszDirectory = hb_parcx( 2 ) ;

   hb_retl( FtpSetCurrentDirectoryA( hInternet, lpszDirectory ) ) ;
}
_wininet.c568
HB_FUNCINTERNETCLOSEHANDLE(void)
//
//    if InternetCloseHandle( hInternet )
//       ? 'Success'
//    endif
//
HB_FUNC( INTERNETCLOSEHANDLE )
{
   HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;

   hb_retl( InternetCloseHandle( hInternet ) ) ;
}
_wininet.c588
HB_FUNCINTERNETATTEMPTCONNECT(void)
//
//    InternetAttempConnect()
//
HB_FUNC( INTERNETATTEMPTCONNECT )
{
   DWORD dwReserved = 0 ;

   hb_retnl( ( ULONG ) InternetAttemptConnect( dwReserved ) ) ;
}
_wininet.c606
_winini.c
TypeFunctionSourceLine
HB_FUNCGETPROFILESTRING(void)
HB_FUNC( GETPROFILESTRING )
{
   DWORD nSize = 1024 ;
   LPTSTR bBuffer = (LPTSTR) hb_xgrab( nSize ) ;
   DWORD dwLen ;
   char * lpSection = ISNIL( 1 ) ? NULL : hb_parcx( 1 ) ;
   char * lpEntry   = ISNIL( 2 ) ? NULL : hb_parcx( 2 ) ;
   char * lpDefault = hb_parc ( 3 );

   while ( TRUE )
   {
      dwLen = GetProfileString( lpSection , lpEntry ,lpDefault , bBuffer, nSize );
      if ( ( ( ( lpSection == NULL ) || ( lpEntry == NULL ) ) && ( nSize - dwLen == 2 ) ) || ( ( lpSection && lpEntry ) && ( nSize - dwLen == 1 ) ) )
      {
        hb_xfree( bBuffer ) ;
        nSize *= 2 ;
        bBuffer = (LPTSTR) hb_xgrab( nSize ) ;
      }
      else
        break ;

   }

   if( dwLen )
     hb_retclen( ( char * ) bBuffer, dwLen );
   else
      hb_retc( lpDefault );

   hb_xfree( bBuffer ) ;

}
_winini.c68
HB_FUNCGETPRIVATEPROFILESTRING(void)
HB_FUNC( GETPRIVATEPROFILESTRING )
{
   DWORD nSize = 1024 ;
   LPTSTR bBuffer = (LPTSTR) hb_xgrab( nSize ) ;
   DWORD dwLen ;
   char * lpSection  = ISNIL( 1 ) ? NULL : hb_parcx( 1 );
   char * lpEntry    = ISNIL( 2 ) ? NULL : hb_parcx( 2 ) ;
   char * lpDefault  = hb_parcx( 3 );
   char * lpFileName = hb_parcx( 4 );

   while ( TRUE )
   {
      dwLen = GetPrivateProfileString( lpSection , lpEntry ,lpDefault , bBuffer, nSize , lpFileName) ;
      if ( ( ( ( lpSection == NULL ) || ( lpEntry == NULL ) ) && ( nSize - dwLen == 2 ) ) || ( ( lpSection && lpEntry ) && ( nSize - dwLen == 1 ) ) )
      {
        hb_xfree( bBuffer ) ;
        nSize *= 2 ;
        bBuffer = (LPTSTR) hb_xgrab( nSize ) ;
      }
      else
        break ;

   }
   if( dwLen )
     hb_retclen( ( char * ) bBuffer, dwLen );
   else
      hb_retc( lpDefault );

   hb_xfree( bBuffer ) ;

}
_winini.c101
HB_FUNCWRITEPROFILESTRING(void)
HB_FUNC( WRITEPROFILESTRING )
{
   char * lpSection = hb_parcx( 1 );
   char * lpEntry = ISCHAR(2) ? hb_parcx( 2 ) : NULL ;
   char * lpData = ISCHAR(3) ? hb_parcx( 3 ) : NULL ;

   if ( WriteProfileString( lpSection , lpEntry , lpData) )
      hb_retl( TRUE ) ;
   else
      hb_retl(FALSE);
}
_winini.c134
HB_FUNCWRITEPRIVATEPROFILESTRING(void)
HB_FUNC( WRITEPRIVATEPROFILESTRING )
{
   char * lpSection = hb_parcx( 1 );
   char * lpEntry = ISCHAR(2) ? hb_parcx( 2 ) : NULL ;
   char * lpData = ISCHAR(3) ? hb_parcx( 3 ) : NULL ;
   char * lpFileName= hb_parcx( 4 );

   if ( WritePrivateProfileString( lpSection , lpEntry , lpData , lpFileName ) )
      hb_retl( TRUE ) ;
   else
      hb_retl(FALSE);
}
_winini.c147
HB_FUNCGETPRIVATEPROFILEINT(void)
HB_FUNC( GETPRIVATEPROFILEINT )
{
   hb_retni( GetPrivateProfileIntA( (LPCSTR) hb_parcx( 1 ),
                                    (LPCSTR) hb_parcx( 2 ),
                                    hb_parni( 3 )        ,
                                    (LPCSTR) hb_parcx( 4 )
                                    ) ) ;
}
_winini.c166
HB_FUNCGETPROFILEINT(void)
HB_FUNC( GETPROFILEINT )
{
   hb_retni( GetProfileIntA( (LPCSTR) hb_parcx( 1 ),
                             (LPCSTR) hb_parcx( 2 ),
                             hb_parni( 3 )
                             ) ) ;
}

//-----------------------------------------------------------------------------
// WINBASEAPI DWORD WINAPI GetProfileSection( IN LPCSTR lpAppName, OUT LPSTR lpReturnedString, IN DWORD nSize );

_winini.c180
HB_FUNCWRITEPROFILESECTION(void)
HB_FUNC( WRITEPROFILESECTION )
{
   hb_retl( WriteProfileSectionA( (LPCSTR) hb_parcx( 1 ), (LPCSTR) hb_parcx( 2 ) ) ) ;
}

_winini.c205
HB_FUNCWRITEPRIVATEPROFILESECTION(void)
HB_FUNC( WRITEPRIVATEPROFILESECTION )
{
   hb_retl( WritePrivateProfileSectionA( (LPCSTR) hb_parcx( 1 ),
                                         (LPCSTR) hb_parcx( 2 ),
                                         (LPCSTR) hb_parcx( 3 )
                                         ) ) ;
}

/*
//-----------------------------------------------------------------------------
// WINBASEAPI DWORD WINAPI GetPrivateProfileSectionNamesA( OUT LPSTR lpszReturnBuffer, IN DWORD nSize, IN LPCSTR lpFileName );


HB_FUNC( GETPRIVATEPROFILESECTIONNAMES )
{
   hb_retnl( (LONG) GetPrivateProfileSectionNames( (LPSTR) hb_parcx( 1 ) ,
                                                    (DWORD) hb_parnl( 2 ),
                                                    (LPCSTR) hb_parcx( 3 )
                                                    ) ) ;
}
*/
//-----------------------------------------------------------------------------
// WINBASEAPI BOOL WINAPI GetPrivateProfileStruct( IN LPCSTR lpszSection, IN LPCSTR lpszKey, OUT LPVOID lpStruct, IN UINT uSizeStruct, IN LPCSTR szFile );

/*

HB_FUNC( GETPRIVATEPROFILESTRUCT )
{
   LPVOID lpStruct    ;

   // Your code goes here

   hb_retl( GetPrivateProfileStructA( (LPCSTR) hb_parcx( 1 ),
                                      (LPCSTR) hb_parcx( 2 ),
                                      lpStruct             ,
                                      (UINT) hb_parni( 4 ) ,
                                      (LPCSTR) hb_parcx( 5 )
                                      ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINBASEAPI BOOL WINAPI WritePrivateProfileStruct( IN LPCSTR lpszSection, IN LPCSTR lpszKey, IN LPVOID lpStruct, IN UINT uSizeStruct, IN LPCSTR szFile );

_winini.c229
_winkbrd.c
TypeFunctionSourceLine
HB_FUNCOEMKEYSCAN(void)
HB_FUNC( OEMKEYSCAN )
{
   hb_retnl( OemKeyScan( (WORD) hb_parni(1) ) ) ;
}
_winkbrd.c34
HB_FUNCVKKEYSCAN(void)
HB_FUNC( VKKEYSCAN )
{
   char *Buffer ;
   Buffer =hb_parcx( 1 );

   hb_retni( VkKeyScan( *Buffer ) ) ;
}
_winkbrd.c43
HB_FUNCVKKEYSCANEX(void)
HB_FUNC( VKKEYSCANEX )
{
   char *Buffer ;
   Buffer = hb_parcx( 1 ) ;

   hb_retni( VkKeyScanEx( *Buffer, (HKL) hb_parnl( 2 ) ) ) ;
}
_winkbrd.c55
HB_FUNCGETKBCODEPAGE(void)
HB_FUNC( GETKBCODEPAGE )
{
   hb_retni( GetKBCodePage(  ) ) ;
}
_winkbrd.c67
HB_FUNCGETKEYSTATE(void)
HB_FUNC( GETKEYSTATE )
{
   hb_retni( GetKeyState( hb_parni( 1 ) ) ) ;
}
_winkbrd.c76
HB_FUNCGETASYNCKEYSTATE(void)
HB_FUNC( GETASYNCKEYSTATE )
{
  hb_retni( GetAsyncKeyState( hb_parni( 1 ) ) ) ;
}
_winkbrd.c85
HB_FUNCGETKEYBOARDSTATE(void)
HB_FUNC( GETKEYBOARDSTATE )
{
   BYTE lpKeyState[256] ;

   if ( GetKeyboardState( lpKeyState ))
     hb_retclen( ( char *) lpKeyState, 256 ) ;
}
_winkbrd.c96
HB_FUNCSETKEYBOARDSTATE(void)
HB_FUNC( SETKEYBOARDSTATE )
{
   hb_retl( SetKeyboardState( (LPBYTE) hb_parcx(1) ) ) ;
}
_winkbrd.c112
HB_FUNCGETKEYNAMETEXT(void)
HB_FUNC( GETKEYNAMETEXT )
{

   char cText[MAX_PATH] ;
   int iRet = GetKeyNameText( hb_parnl( 1 ), cText, MAX_PATH ) ;
   if ( iRet )
     hb_retclen( cText, iRet ) ;

}
_winkbrd.c124
HB_FUNCGETKEYBOARDTYPE(void)
HB_FUNC( GETKEYBOARDTYPE )
{
   hb_retni( GetKeyboardType( hb_parni( 1 ) ) ) ;
}
_winkbrd.c139
HB_FUNCMAPVIRTUALKEY(void)
HB_FUNC( MAPVIRTUALKEY )
{
   hb_retni( MapVirtualKey( (UINT) hb_parni( 1 ), (UINT) hb_parni( 2 ) ) ) ;
}
_winkbrd.c149
HB_FUNCMAPVIRTUALKEYEX(void)
HB_FUNC( MAPVIRTUALKEYEX )
{
   hb_retni( MapVirtualKeyEx( (UINT) hb_parni( 1 ),
                              (UINT) hb_parni( 2 ),
                              (HKL) hb_parnl( 3 )
                            ) ) ;
}
_winkbrd.c158
HB_FUNCGETINPUTSTATE(void)
HB_FUNC( GETINPUTSTATE )
{
   hb_retl( GetInputState(  ) ) ;
}
_winkbrd.c169
HB_FUNCGETQUEUESTATUS(void)
HB_FUNC( GETQUEUESTATUS )
{
   hb_retnl( (LONG) GetQueueStatus( (UINT) hb_parni( 1 ) ) ) ;
}
_winkbrd.c178
HB_FUNCLOADACCELERATORS(void)
HB_FUNC( LOADACCELERATORS )
{
   hb_retnl( (LONG) LoadAccelerators( (HINSTANCE) hb_parnl( 1 ),
                                      (LPCSTR) hb_parcx( 2 )
                                    ) ) ;
}
_winkbrd.c188
HB_FUNCCREATEACCELERATORTABLE(void)
HB_FUNC( CREATEACCELERATORTABLE )
{

   ACCEL * aAccel ;
   INT iCount ;
   INT i ;
   PHB_ITEM aSub ;
   PHB_ITEM aParam ;

   if ( hb_parinfo( 1 ) == HB_IT_ARRAY  )
   {
       iCount = hb_parinfa( 1, 0 );
       aAccel = (ACCEL *) hb_xgrab( iCount*sizeof(ACCEL) ) ;
       aParam = hb_param( 1, HB_IT_ARRAY ) ;
       for ( i= 0 ; i
_winkbrd.c205
HB_FUNCDESTROYACCELERATORTABLE(void)
HB_FUNC( DESTROYACCELERATORTABLE )
{
   hb_retl( DestroyAcceleratorTable( (HACCEL) hb_parnl( 1 ) ) ) ;
}
_winkbrd.c237
HB_FUNCCOPYACCELERATORTABLE(void)
HB_FUNC( COPYACCELERATORTABLE )
{
   LPACCEL lpAccelDst = NULL;
   int iCount = 0;
   int iRet ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;
   PHB_ITEM item ;
   int i ;

   if ( ISARRAY(2) && ((iCount=hb_parinfa(2,0)) > 0 ) )
      lpAccelDst = (LPACCEL) hb_xgrab( iCount * sizeof(ACCEL) ) ;

   iRet = CopyAcceleratorTable( (HACCEL) hb_parnl( 1 ) ,
                                   (iCount==0 ? NULL : lpAccelDst ) ,
                                   iCount
                              ) ;

   if ( ( iCount > 0 ) && (iRet > 0 ) )
   {
      // read accelerator table elements into a subarrays
      // and store them into the original array elements

      aParam = hb_param( 2, HB_IT_ARRAY ) ;
      aSub = hb_itemArrayNew( 3 ) ;
      item = hb_itemNew( NULL ) ;
      for ( i = 0 ; i < iCount ; i++ )
      {
         hb_arraySet( aSub, 1, hb_itemPutNI( item, lpAccelDst->fVirt ) ) ;
         hb_arraySet( aSub, 2, hb_itemPutNI( item, lpAccelDst->key   ) ) ;
         hb_arraySet( aSub, 3, hb_itemPutNI( item, lpAccelDst->cmd   ) ) ;
         hb_arraySet( aParam, i+1, hb_arrayClone(aSub) ) ;
      }
      hb_itemRelease(item) ;
      hb_itemRelease(aSub) ;
   }

   if ( iCount > 0 )
      hb_xfree( lpAccelDst );
   hb_retni( iRet ) ;
}
_winkbrd.c251
HB_FUNCTRANSLATEACCELERATOR(void)
HB_FUNC( TRANSLATEACCELERATOR )
{
   LPMSG  lpMsg = ( MSG * ) hb_parc( 3 ); //hb_param(3, HB_IT_STRING)->item.asString.value;
   hb_retni( TranslateAccelerator( (HWND) hb_parnl( 1 )  ,
                                   (HACCEL) hb_parnl( 2 ),
                                   lpMsg
                                 ) ) ;
}

_winkbrd.c298
_winlv.c
TypeFunctionSourceLine
HB_FUNCLISTVIEW_DELETEALLITEMS(void)
HB_FUNC( LISTVIEW_DELETEALLITEMS )
{
   ListView_DeleteAllItems( (HWND) hb_parnl(1) );
}
_winlv.c19
HB_FUNCLISTVIEW_DELETECOLUMN(void)
HB_FUNC( LISTVIEW_DELETECOLUMN )
{
   ListView_DeleteColumn( (HWND) hb_parnl(1), (INT) hb_parni(2) );
}
_winlv.c24
HB_FUNCLISTVIEW_ENSUREVISIBLE(void)
HB_FUNC( LISTVIEW_ENSUREVISIBLE )
{
   hb_retl(ListView_EnsureVisible( (HWND) hb_parnl(1), hb_parni(2), hb_parl(3) ));
}
_winlv.c29
HB_FUNCLISTVIEW_INSERTCOLUMN(void)
HB_FUNC( LISTVIEW_INSERTCOLUMN )
{
   LV_COLUMN *lvColumn = ( LV_COLUMN *) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING )->item.asString.value ;
   ListView_InsertColumn( (HWND)hb_parnl(1), hb_parni(2), lvColumn );
}
_winlv.c34
HB_FUNCLISTVIEW_SETITEMCOUNT(void)
HB_FUNC( LISTVIEW_SETITEMCOUNT )
{
   ListView_SetItemCount( (HWND) hb_parnl(1), hb_parnl(2) );
}
_winlv.c40
HB_FUNCLISTVIEW_GETNEXTITEM(void)
HB_FUNC( LISTVIEW_GETNEXTITEM )
{
   hb_retnl(ListView_GetNextItem( (HWND) hb_parnl(1), hb_parni(2), hb_parnl(3) ));
}
_winlv.c45
HB_FUNCLISTVIEWNOTIFY(void)
HB_FUNC( LISTVIEWNOTIFY )
{
   LPARAM lParam = (LPARAM) hb_parnl(2);
   LPNMHDR lpnmh = (LPNMHDR) lParam;
   LPCSTR cRet;
   PHB_ITEM pArray;
   PHB_ITEM DArray;
   LPSTR cAlias;
   static PHB_DYNS pSymTest = 0 ;
   switch(lpnmh->code)
   {
   case LVN_GETDISPINFO:
      {
      LV_DISPINFO *lpdi = (LV_DISPINFO *)lParam;
      // TCHAR szString[MAX_PATH];
      if(lpdi->item.iSubItem)
         {
         if(lpdi->item.mask & LVIF_TEXT)
            {
            if ( !pSymTest )
               pSymTest = hb_dynsymFind( "_WINLVGETDBINFO" );
            if ( pSymTest )
               {
               pArray = hb_param( 3, HB_IT_ARRAY ) ;
               DArray = hb_param( 4, HB_IT_ARRAY ) ;
               cAlias = hb_parcx(5);
               hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); //pSymTest->pSymbol );
               hb_vmPushNil();
               hb_vmPushLong( (LONG) lpdi->item.iItem );
               hb_vmPushLong( (LONG) lpdi->item.iSubItem );
               hb_vmPush( pArray );
               hb_vmPush( DArray );
               hb_vmPushString( cAlias,strlen(cAlias) );
               hb_vmPushInteger( hb_parni(6) );
               hb_vmDo( 6 );
               cRet=hb_itemGetC( hb_param( -1, HB_IT_ANY ) );
               lstrcpy(lpdi->item.pszText, cRet);
               }
            }
         }
      else
         {
         if(lpdi->item.mask & LVIF_TEXT)
            {
            if ( !pSymTest )
               pSymTest = hb_dynsymFind( "_WINLVGETDBINFO" );
            if ( pSymTest )
               {
               pArray = hb_param( 3, HB_IT_ARRAY ) ;
               DArray = hb_param( 4, HB_IT_ARRAY ) ;
               cAlias = hb_parcx(5);
               hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); //pSymTest->pSymbol );
               hb_vmPushNil();
               hb_vmPushLong( (LONG) lpdi->item.iItem );
               hb_vmPushLong( (LONG) lpdi->item.iSubItem );
               hb_vmPush( pArray );
               hb_vmPush( DArray );
               hb_vmPushString( cAlias,strlen(cAlias) );
               hb_vmPushInteger( hb_parni(6) );
               hb_vmDo( 6 );
               cRet=hb_itemGetC( hb_param( -1, HB_IT_ANY ) );
               lstrcpy(lpdi->item.pszText, cRet);
               }
            }
         if(lpdi->item.mask & LVIF_IMAGE)
            {
            lpdi->item.iImage = lpdi->item.iItem;
            }
         }
      }
      hb_retni(0);
   }
hb_retni(0);
}
_winlv.c50
_winmain.c
TypeFunctionSourceLine
INT WINAPIWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow )
int WINAPI WinMain( HINSTANCE hInstance,      /* handle to current instance */
                    HINSTANCE hPrevInstance,  /* handle to previous instance */
                    LPSTR lpCmdLine,          /* pointer to command line */
                    int iCmdShow )            /* show state of window */
{
   LPSTR pArgs = ( LPSTR ) LocalAlloc( LMEM_FIXED, strlen( lpCmdLine ) + 1 ), pArg = pArgs;
   char szAppName[ 250 ];

   hb_hInstance = hInstance;
   hb_hPrevInstance = hPrevInstance;
   hb_iCmdShow = iCmdShow;

   strcpy( pArgs, lpCmdLine );

   HB_TRACE(HB_TR_DEBUG, ("WinMain(%p, %p, %s, %d)", hInstance, hPrevInstance, lpCmdLine, iCmdShow));

   HB_SYMBOL_UNUSED( hPrevInstance );
   HB_SYMBOL_UNUSED( iCmdShow );

   hb_hInstance = hInstance;
   hb_hPrevInstance = hPrevInstance;
   hb_iCmdShow = iCmdShow;

   GetModuleFileName( hInstance, szAppName, 249 );
   argv[ 0 ] = szAppName;

   if( * pArgs != 0 )
      argv[ ++argc ] = pArgs;

   while( *pArg != 0 )
   {
      if( *pArg == ' ' )
      {
         *pArg++ = 0;
         argc++;

         while( *pArg == ' ' )
            pArg++;

         if( *pArg != 0 )
            argv[ argc ] = pArg++;
         else
            argc--;
      }
      else
         pArg++;
   }
   argc++;

   hb_cmdargInit( argc, argv );
   hb_vmInit( TRUE );
   hb_vmQuit();

   LocalFree( pArgs );  /* QUESTION: It seems we never reach here,
                                     so how may we free it ? */

   /* NOTE: The exit value is set by exit() */
   /* NOTE: This point is never reached */

   return 0;
}
_winmain.c67
HB_FUNCHINSTANCE(void)
HB_FUNC( HINSTANCE )
{
  hb_retnl( (LONG) hb_hInstance );
}
_winmain.c129
HB_FUNCHPREVINSTANCE(void)
HB_FUNC( HPREVINSTANCE )
{
  hb_retnl( (LONG) hb_hPrevInstance );
}
_winmain.c135
HB_FUNCNCMDSHOW(void)
HB_FUNC( NCMDSHOW )
{
  hb_retni( hb_iCmdShow );
}
_winmain.c140
_winmapi.c
TypeFunctionSourceLine
HB_FUNCMAPISENDMAIL(void)
HB_FUNC( MAPISENDMAIL )
{
   MapiRecipDesc orig ;
   MapiRecipDesc rcpt ;
   MapiFileDesc  file ;
   MapiMessage   mssg ;

   orig.ulReserved         = 0            ;  // Reserved
   orig.ulRecipClass       = MAPI_ORIG    ;  // Reciepient Class MAPI_TO MAPI_CC MAPI_BCC
   orig.lpszName           = hb_parcx( 4 ) ;  // Originator's Name
   orig.lpszAddress        = hb_parcx( 5 ) ;  // Originators Address
   orig.ulEIDSize          = 0            ;  // Count in bytes of size of pEntryID
   orig.lpEntryID          = NULL         ;  // System-specific Originator reference

   rcpt.ulReserved         = 0            ;  // Reserved
   rcpt.ulRecipClass       = MAPI_TO      ;  // Reciepient Class MAPI_TO MAPI_CC MAPI_BCC
   rcpt.lpszName           = hb_parcx( 6 ) ;  // Reciepient's Name, e.g., vouchcac@hotmail.com
   rcpt.lpszAddress        = hb_parcx( 7 ) ;  // Reciepient's Address
   rcpt.ulEIDSize          = 0            ;  // Count in bytes of size of pEntryID
   rcpt.lpEntryID          = 0            ;  // System-specific Recipient reference

   file.ulReserved         = 0            ;  // Reserved for future usage
   file.flFlags            = 0            ;  // Flags ?
   file.nPosition          = -1           ;  // Character of text to be replaced by attachment
   file.lpszPathName       = hb_parcx( 8 ) ;  // Full Path Name with Extension of the attached file
   file.lpszFileName       = NULL         ;  // Original File Name ( optional )
   file.lpFileType         = NULL         ;  // Attachment file type ( can be lpMapiFileTagExt )

   mssg.ulReserved         = 0            ;  // Reserved
   mssg.lpszSubject        = hb_parcx( 2 ) ;  // Message Subject
   mssg.lpszNoteText       = hb_parcx( 3 ) ;  // Message Text
   mssg.lpszMessageType    = NULL         ;  // Message Class
   mssg.lpszDateReceived   = NULL         ;  // in yyyy/mm/dd hh:mm format
   mssg.lpszConversationID = NULL         ;  // Conversation thread ID
   mssg.flFlags            = 0            ;  // unread, return receipt
   mssg.lpOriginator       = &orig        ;  // Originator's descriptor
   mssg.nRecipCount        = 1            ;  // Number of receipients
   mssg.lpRecips           = &rcpt        ;  // Recipient descriptors
   mssg.nFileCount         = 1            ;  // Number of file attachments
   mssg.lpFiles            = &file        ;  // Attachment descriptors

   // to send the mail direcly and without intervenstion
   hb_retnl( (ULONG) MAPISendMail( 0, 0, &mssg, 0, 0 ) ) ;

   // to open default mail client's dialog box
   // hb_retnl( (ULONG) MAPISendMail( 0, 0, &mssg, 8, 0 ) ) ;
}
_winmapi.c21
_winmem.c
TypeFunctionSourceLine
HB_FUNCGLOBALALLOC(void)
HB_FUNC( GLOBALALLOC )
{
   hb_retnl( (LONG) GlobalAlloc( (UINT) hb_parni( 1 ),(SIZE_T) hb_parnl(2) ) ) ;
}
_winmem.c23
HB_FUNCGLOBALREALLOC(void)
HB_FUNC( GLOBALREALLOC )
{

   hb_retnl( (LONG) GlobalReAlloc( (HGLOBAL) hb_parnl( 1 ),
                                   (SIZE_T) hb_parnl( 2 )   ,
                                   (UINT) hb_parni( 3 )
                                   ) ) ;
}
_winmem.c32
HB_FUNCGLOBALSIZE(void)
HB_FUNC( GLOBALSIZE )
{
   hb_retnl( (LONG) GlobalSize( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c44
HB_FUNCGLOBALFLAGS(void)
HB_FUNC( GLOBALFLAGS )
{
   hb_retni( (UINT) GlobalFlags( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c52
HB_FUNCGLOBALLOCK(void)
HB_FUNC( GLOBALLOCK )
{
   hb_retnl( (LONG) GlobalLock( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c61
HB_FUNCGLOBALHANDLE(void)
HB_FUNC( GLOBALHANDLE )
{
   hb_retnl( (LONG) GlobalHandle( (LPCVOID) hb_parnl(1) ) ) ;
}
_winmem.c69
HB_FUNCGLOBALUNLOCK(void)
HB_FUNC( GLOBALUNLOCK )
{
   hb_retl( GlobalUnlock( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c79
HB_FUNCGLOBALFREE(void)
HB_FUNC( GLOBALFREE )
{
   hb_retnl( (LONG) GlobalFree( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c89
HB_FUNCGLOBALCOMPACT(void)
HB_FUNC( GLOBALCOMPACT )
{
// (SIZE_T) GlobalCompact( (DWORD) hb_parnl( 1 ) ) ) ;
}
_winmem.c100
HB_FUNCGLOBALFIX(void)
HB_FUNC( GLOBALFIX )
{
   GlobalFix( (HGLOBAL) hb_parnl( 1 ) ) ;
}
_winmem.c110
HB_FUNCGLOBALUNFIX(void)
HB_FUNC( GLOBALUNFIX )
{
   GlobalUnfix( (HGLOBAL) hb_parnl( 1 ) ) ;
}
_winmem.c120
HB_FUNCGLOBALWIRE(void)
HB_FUNC( GLOBALWIRE )
{
   hb_retnl( (LONG) GlobalWire( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c130
HB_FUNCGLOBALUNWIRE(void)
HB_FUNC( GLOBALUNWIRE )
{
   hb_retl( GlobalUnWire( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}

//-----------------------------------------------------------------------------
// WINBASEAPI VOID WINAPI GlobalMemoryStatus( IN OUT LPMEMORYSTATUS lpBuffer );


// T.B.D.


/*

HB_FUNC( GLOBALMEMORYSTATUS )
{
   LPMEMORYSTATUS lpBuffer ;

   // Your code goes here

   GlobalMemoryStatus( lpBuffer ) ;
}

   Last change:  WN   29 May 2002   11:26 pm
*/

//-----------------------------------------------------------------------------
// WINBASEAPI BOOL WINAPI GlobalMemoryStatusEx( IN OUT LPMEMORYSTATUSEX lpBuffer );


// T.B.D.

_winmem.c140
HB_FUNCLOCALALLOC(void)
HB_FUNC( LOCALALLOC )
{
   hb_retnl( (LONG) LocalAlloc( (UINT) hb_parni( 1 ), (SIZE_T) hb_parni( 2 ) ) ) ;
}
_winmem.c188
HB_FUNCLOCALREALLOC(void)
HB_FUNC( LOCALREALLOC )
{

   hb_retnl( (LONG) LocalReAlloc( (HLOCAL) hb_parnl( 1 ),
                                  (SIZE_T) hb_parni( 2 )         ,
                                  (UINT) hb_parni( 3 )  
                                  ) ) ;
}
_winmem.c197
HB_FUNCLOCALLOCK(void)
HB_FUNC( LOCALLOCK )
{
   hb_retnl( (LONG) LocalLock( (HLOCAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c211
HB_FUNCLOCALHANDLE(void)
HB_FUNC( LOCALHANDLE )
{
   hb_retnl( (LONG) LocalHandle( (LPCVOID) hb_parnl(1) ) ) ;
}
_winmem.c220
HB_FUNCLOCALUNLOCK(void)
HB_FUNC( LOCALUNLOCK )
{
   hb_retl( LocalUnlock( (HLOCAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c230
HB_FUNCLOCALSIZE(void)
HB_FUNC( LOCALSIZE )
{
   hb_retni( LocalSize( (HLOCAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c239
HB_FUNCLOCALFLAGS(void)
HB_FUNC( LOCALFLAGS )
{
   hb_retni( LocalFlags( (HLOCAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c248
HB_FUNCLOCALFREE(void)
HB_FUNC( LOCALFREE )
{
   hb_retnl( (LONG) LocalFree( (HLOCAL) hb_parnl( 1 ) ) ) ;
}
_winmem.c257
HB_FUNCLOCALSHRINK(void)
HB_FUNC( LOCALSHRINK )
{
   hb_retni( LocalShrink( (HLOCAL) hb_parnl( 1 ), (UINT) hb_parni( 2 ) ) ) ;
}
_winmem.c266
HB_FUNCLOCALCOMPACT(void)
HB_FUNC( LOCALCOMPACT )
{
   hb_retni( LocalCompact( (UINT) hb_parni( 1 ) ) ) ;
}
_winmem.c275
_winmenu.c
TypeFunctionSourceLine
HB_FUNCAPPENDMENU(void)
HB_FUNC( APPENDMENU )
{
  hb_retl( AppendMenu( (HMENU) hb_parnl(1), hb_parni(2), hb_parni(3), hb_parcx(4)) ) ;
}
_winmenu.c23
HB_FUNCCHECKMENUITEM(void)
HB_FUNC( CHECKMENUITEM )
{
  hb_retnl( CheckMenuItem((HMENU) hb_parnl(1), hb_parni(2), hb_parni(3)) ) ;
}
_winmenu.c31
HB_FUNCCREATEMENU(void)
HB_FUNC( CREATEMENU )
{
  hb_retnl( (LONG) CreateMenu() ) ;
}
_winmenu.c38
HB_FUNCCREATEPOPUPMENU(void)
HB_FUNC( CREATEPOPUPMENU )
{
  hb_retnl( (LONG) CreatePopupMenu() ) ;
}
_winmenu.c45
HB_FUNCDELETEMENU(void)
HB_FUNC( DELETEMENU )
{
  hb_retl( DeleteMenu( (HMENU) hb_parnl(1), hb_parni(2), hb_parni(3) ) );
}

//-----------------------------------------------------------------------------

HB_FUNC( DESTROYMENU )
_winmenu.c52
HB_FUNCDESTROYMENU(void)
{
  hb_retl( DestroyMenu( (HMENU) hb_parnl(1) ) ) ;
}

//-----------------------------------------------------------------------------

HB_FUNC( GETMENU )
_winmenu.c61
HB_FUNCGETMENU(void)
{
  hb_retnl( (LONG) GetMenu( (HWND) hb_parnl(1) ) ) ;
}
_winmenu.c69
HB_FUNCGETMENUITEMID(void)
HB_FUNC( GETMENUITEMID )
{
   hb_retni( GetMenuItemID(
                            (HMENU) hb_parnl( 1 ),  // handle to menu
                            (int) hb_parni( 2 )     // position of menu item
                          ) ) ;
}
_winmenu.c75
HB_FUNCDRAWMENUBAR(void)
HB_FUNC( DRAWMENUBAR )
{
  hb_retl( DrawMenuBar( (HWND) hb_parnl(1))) ;
}
_winmenu.c85
HB_FUNCENABLEMENUITEM(void)
HB_FUNC( ENABLEMENUITEM )
{
  hb_retl( EnableMenuItem( (HMENU) hb_parnl(1), hb_parni(2), hb_parni(3) ) ) ;
}
_winmenu.c92
HB_FUNCGETMENUSTATE(void)
HB_FUNC( GETMENUSTATE )
{
  hb_retni( GetMenuState( (HMENU) hb_parnl(1), hb_parni(2), hb_parni(3)) ) ;
}
_winmenu.c99
HB_FUNCGETMENUSTRING(void)
HB_FUNC( GETMENUSTRING )
{
   char cText[MAX_PATH+1] ={0};

   GetMenuString( (HMENU) hb_parnl(1), hb_parni(2),(LPSTR) cText, MAX_PATH, hb_parni(3) );

   hb_retc( cText );

}
_winmenu.c106
HB_FUNCHILITEMENUITEM(void)
HB_FUNC( HILITEMENUITEM )
{
  hb_retl( HiliteMenuItem( (HWND) hb_parnl(1), (HMENU) hb_parnl(2), hb_parni(3), hb_parni(4)) ) ;
}
_winmenu.c118
HB_FUNCINSERTMENU(void)
HB_FUNC( INSERTMENU )
{
  hb_retl( InsertMenu( (HMENU) hb_parnl(1), hb_parni(2), hb_parni(3), hb_parni(4), hb_parcx(5)) );
}
_winmenu.c125
HB_FUNCSETMENUITEMBITMAPS(void)
HB_FUNC( SETMENUITEMBITMAPS )
{
  hb_retl( SetMenuItemBitmaps( (HMENU) hb_parnl(1), hb_parni(2), hb_parni(3), (HBITMAP) hb_parnl(4), (HBITMAP)  hb_parnl(5)) );
}
_winmenu.c132
HB_FUNCGETMENUITEMCOUNT(void)
HB_FUNC( GETMENUITEMCOUNT )
{
  hb_retni( GetMenuItemCount( (HMENU) hb_parnl(1) )) ;
}
_winmenu.c139
HB_FUNCSETMENU(void)
HB_FUNC( SETMENU )
{
  hb_retl( SetMenu ((HWND) hb_parnl(1), (HMENU) hb_parnl(2) ) );
}
_winmenu.c146
HB_FUNCGETSUBMENU(void)
HB_FUNC( GETSUBMENU )
{
  hb_retnl( (LONG) GetSubMenu( (HMENU) hb_parnl(1), hb_parni(2)) );
}
_winmenu.c153
HB_FUNCTRACKPOPUPMENU(void)
HB_FUNC( TRACKPOPUPMENU )
{
 RECT rc ;

 if (!ISNIL(7)) {
   rc.left   = hb_parni(7,1);
   rc.top    = hb_parni(7,2);
   rc.right  = hb_parni(7,3);
   rc.bottom = hb_parni(7,4);
 }
 hb_retnl( TrackPopupMenu((HMENU) hb_parnl(1), hb_parni(2), hb_parni(3), hb_parni(4),
                         hb_parni(5), (HWND) hb_parnl(6), (ISNIL(7) ? NULL : &rc) ) ) ;
}
_winmenu.c160
HB_FUNCGETSYSTEMMENU(void)
HB_FUNC( GETSYSTEMMENU )
{
  hb_retnl( (LONG) GetSystemMenu( (HWND) hb_parnl(1), hb_parl(2) ) );
}
_winmenu.c176
HB_FUNCLOADMENU(void)
HB_FUNC( LOADMENU )
{
   hb_retnl( (LONG) LoadMenu( (HINSTANCE) hb_parnl( 1 ), (LPCSTR) hb_parcx( 2 ) ) ) ;
}
_winmenu.c186
HB_FUNCLOADMENUINDIRECT(void)
HB_FUNC( LOADMENUINDIRECT )
{
   MENUTEMPLATE *mt =(MENUTEMPLATE * ) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value;

   hb_retnl( (LONG) LoadMenuIndirect( mt ) ) ;
}
_winmenu.c196
HB_FUNCCHANGEMENU(void)
HB_FUNC( CHANGEMENU )
{
   hb_retl( ChangeMenu( (HMENU) hb_parnl( 1 ),
                        (UINT) hb_parni( 2 ) ,
                        (LPCSTR) hb_parcx( 3 ),
                        (UINT) hb_parni( 4 ) ,
                        (UINT) hb_parni( 5 )
                      ) ) ;
}
_winmenu.c207
HB_FUNCREMOVEMENU(void)
HB_FUNC( REMOVEMENU )
{
   hb_retl( RemoveMenu( (HMENU) hb_parnl( 1 ),
                        (UINT) hb_parni( 2 ) ,
                        (UINT) hb_parni( 3 )
                      ) ) ;
}
_winmenu.c221
HB_FUNCGETMENUCHECKMARKDIMENSIONS(void)
HB_FUNC( GETMENUCHECKMARKDIMENSIONS )
{
   hb_retnl( (LONG) GetMenuCheckMarkDimensions(  ) ) ;
}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI ModifyMenuA( IN HMENU hMnu, IN UINT uPosition, IN UINT uFlags, IN UINT_PTR uIDNewItem, IN LPCSTR lpNewItem );

/*

HB_FUNC( MODIFYMENU )
{
   UINT_PTR uIDNewItem ;

   // Your code goes here

   hb_retl( ModifyMenu( (HMENU) hb_parnl( 1 ),
                        (UINT) hb_parni( 2 ) ,
                        (UINT) hb_parni( 3 ) ,
                        uIDNewItem           ,
                        (LPCSTR) hb_parcx( 5 )
                      ) ) ;
}

*/




//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI GetMenuInfo( IN HMENU, OUT LPMENUINFO);

/*

HB_FUNC( GETMENUINFO )
{
   LPMENUINFO lpmenuInfo ;

   // Your code goes here

   hb_retl( GetMenuInfo( (HMENU) hb_parnl( 1 ), lpmenuInfo ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI SetMenuInfo( IN HMENU, IN LPCMENUINFO);


_winmenu.c234
HB_FUNCENDMENU(void)
HB_FUNC( ENDMENU )
{
   hb_retl( EndMenu() ) ;
}
_winmenu.c298
HB_FUNCINSERTMENUITEM(void)
HB_FUNC( INSERTMENUITEM )
{
   LPCMENUITEMINFOA lpcmenuitemInfoa =(LPCMENUITEMINFOA) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value;

   hb_retl( InsertMenuItem( (HMENU) hb_parnl( 1 ),
                            (UINT) hb_parni( 2 ) ,
                            hb_parl( 3 )         ,
                            lpcmenuitemInfoa
                          ) ) ;
}
_winmenu.c308
HB_FUNCGETMENUITEMINFO(void)
HB_FUNC( GETMENUITEMINFO )
{
   LPCMENUITEMINFOA lpcmenuitemInfoa =(LPCMENUITEMINFOA) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value;
   hb_retl( GetMenuItemInfo( (HMENU) hb_parnl( 1 ),
                             (UINT) hb_parni( 2 ) ,
                             hb_parl( 3 )         ,
                             ( struct tagMENUITEMINFOA * ) lpcmenuitemInfoa
                           ) ) ;
}
_winmenu.c326
HB_FUNCSETMENUITEMINFO(void)
HB_FUNC( SETMENUITEMINFO )
{
   LPCMENUITEMINFOA lpcmenuitemInfoa =(LPCMENUITEMINFOA) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value;
   hb_retl( SetMenuItemInfo( (HMENU) hb_parnl( 1 ),
                             (UINT) hb_parni( 2 ) ,
                             hb_parl( 3 )         ,
                             lpcmenuitemInfoa
                           ) ) ;
}




//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI GetMenuBarInfo( IN HWND hwnd, IN LONG idObject, IN LONG idItem, OUT PMENUBARINFO pmbi );

_winmenu.c343
HB_FUNCCHECKMENURADIOITEM(void)
HB_FUNC( CHECKMENURADIOITEM )
{
  hb_retl( CheckMenuRadioItem( (HMENU) hb_parnl( 1 ), (UINT) hb_parni(2),
                               (UINT) hb_parni(3), (UINT) hb_parni(4), (UINT) hb_parni(5) ) ) ;
}
_winmenu.c384
HB_FUNCISMENU(void)
HB_FUNC( ISMENU )
{
   hb_retl( IsMenu((HMENU) hb_parnl(1) ) );
}
_winmenu.c390
_winmeta.c
TypeFunctionSourceLine
HB_FUNCCREATEMETAFILE(void)
HB_FUNC( CREATEMETAFILE )
{
   hb_retnl( (LONG) CreateMetaFile( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_winmeta.c41
HB_FUNCCOPYMETAFILE(void)
HB_FUNC( COPYMETAFILE )
{
   hb_retnl( (LONG) CopyMetaFile( (HMETAFILE) hb_parnl( 1 ),
                                   (LPCSTR) hb_parcx( 2 )
                                   ) ) ;
}
_winmeta.c50
HB_FUNCCLOSEMETAFILE(void)
HB_FUNC( CLOSEMETAFILE )
{
   hb_retnl( (LONG) CloseMetaFile( (HDC) hb_parnl( 1 ) ) ) ;
}
_winmeta.c61
HB_FUNCDELETEMETAFILE(void)
HB_FUNC( DELETEMETAFILE )
{
   hb_retl( DeleteMetaFile( (HMETAFILE) hb_parnl( 1 ) ) ) ;
}
_winmeta.c71
HB_FUNCGETMETAFILE(void)
HB_FUNC( GETMETAFILE )
{
   hb_retnl( (LONG) GetMetaFile( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_winmeta.c81
HB_FUNCPLAYMETAFILE(void)
HB_FUNC( PLAYMETAFILE )
{
   hb_retl( PlayMetaFile( (HDC) hb_parnl( 1 ), (HMETAFILE) hb_parnl( 2 ) ) ) ;
}


//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI GetMetaFileBitsEx( IN HMETAFILE, IN UINT, OUT LPVOID);

/*

HB_FUNC( GETMETAFILEBITSEX )
{
   LPVOID    lpVoid    ;

   // Your code goes here

   hb_retni( GetMetaFileBitsEx( (HMETAFILE) hb_parnl( 1 ),
                                (UINT) hb_parni( 2 )     ,
                                lpVoid
                                ) ) ;
}

*/



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI EnumMetaFile( IN HDC, IN HMETAFILE, IN MFENUMPROC, IN LPARAM);

/*

HB_FUNC( ENUMMETAFILE )
{
   MFENUMPROC mfEnumProc ;
   LPARAM     lParam     ;

   // Your code goes here

   hb_retl( EnumMetaFile( (HDC) hb_parnl( 1 )      ,
                          (HMETAFILE) hb_parnl( 2 ),
                          mfEnumProc               ,
                          lParam
                          ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI HMETAFILE WINAPI SetMetaFileBitsEx(IN UINT, IN CONST BYTE *);

_winmeta.c95
HB_FUNCCREATEENHMETAFILE(void)
HB_FUNC( CREATEENHMETAFILE )
{
   RECT rc ;

   if ( ISARRAY(3) && Array2Rect( hb_param(3,HB_IT_ARRAY), &rc ))
      hb_retnl( (LONG) CreateEnhMetaFile( (HDC) hb_parnl( 1 )  ,
                                           (LPCSTR) hb_parcx( 2 ),
                                           &rc                  ,
                                           ISNIL(4) ? NULL : (LPCSTR) hb_parcx( 4 )
                                        ) ) ;


}
_winmeta.c170
HB_FUNCGETENHMETAFILE(void)
HB_FUNC( GETENHMETAFILE )
{
   hb_retnl( (LONG) GetEnhMetaFile( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_winmeta.c188
HB_FUNCGETMETARGN(void)
HB_FUNC( GETMETARGN )
{
   hb_retni( GetMetaRgn( (HDC) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winmeta.c197
HB_FUNCSETMETARGN(void)
HB_FUNC( SETMETARGN )
{
   hb_retni( SetMetaRgn( (HDC) hb_parnl( 1 ) ) ) ;
}
_winmeta.c207
HB_FUNCCLOSEENHMETAFILE(void)
HB_FUNC( CLOSEENHMETAFILE )
{
   hb_retnl( (LONG) CloseEnhMetaFile( (HDC) hb_parnl(1) ) );
}
_winmeta.c215
HB_FUNCDELETEENHMETAFILE(void)
HB_FUNC( DELETEENHMETAFILE )
{
   hb_retl( DeleteEnhMetaFile( (HENHMETAFILE) hb_parnl( 1 ) ) ) ;
}
_winmeta.c226
HB_FUNCPLAYENHMETAFILE(void)
HB_FUNC( PLAYENHMETAFILE )
{
   RECT  rc ;

   if ( ISARRAY(3) && Array2Rect( hb_param(3,HB_IT_ARRAY), &rc ))
      hb_retl( PlayEnhMetaFile( (HDC) hb_parnl( 1 )         ,
                                (HENHMETAFILE) hb_parnl( 2 ),
                                &rc
                             ) ) ;
}
_winmeta.c236
HB_FUNCCOPYENHMETAFILEA(void)
HB_FUNC( COPYENHMETAFILEA )
{
   hb_retnl( (LONG) CopyEnhMetaFileA( (HENHMETAFILE) hb_parnl( 1 ),
                                      (LPCSTR) hb_parcx( 2 )
                                      ) ) ;
}
_winmeta.c252
HB_FUNCGETWINMETAFILEBITS(void)
HB_FUNC( GETWINMETAFILEBITS )
{
   BYTE  *Buffer ;

   UINT nBytes ;

   nBytes = GetWinMetaFileBits( (HENHMETAFILE) hb_parnl( 1 ),
                                 0 , NULL, hb_parni( 2 ), (HDC) hb_parnl( 3 ) ) ;

   if ( nBytes )
   {
       Buffer = (BYTE *) hb_xgrab( nBytes) ;

       if ( GetWinMetaFileBits( (HENHMETAFILE) hb_parnl( 1 ) ,
                                 nBytes  , Buffer            ,
                                 hb_parni( 2 )               ,
                                 (HDC) hb_parnl( 3 )
                                 ) )
           hb_retclen( ( char *)Buffer, nBytes );

       hb_xfree(Buffer);

   }
}


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI PlayEnhMetaFileRecord( IN HDC, IN LPHANDLETABLE, IN CONST ENHMETARECORD *, IN UINT);

_winmeta.c266
HB_FUNCGETENHMETAFILEDESCRIPTION(void)
HB_FUNC( GETENHMETAFILEDESCRIPTION )
{
   hb_retni( GetEnhMetaFileDescription( (HENHMETAFILE) hb_parnl( 1 ),
                                         (UINT) hb_parni( 2 )        ,
                                         (LPSTR) hb_parcx( 3 )
                                         ) ) ;
}


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI PlayMetaFileRecord( IN HDC, IN LPHANDLETABLE, IN LPMETARECORD, IN UINT);

/*

HB_FUNC( PLAYMETAFILERECORD )
{
   LPHANDLETABLE lpHandleTable ;
   LPMETARECORD  lpMetaRecord  ;

   // Your code goes here

   hb_retl( PlayMetaFileRecord( (HDC) hb_parnl( 1 ) ,
                                lpHandleTable       ,
                                lpMetaRecord        ,
                                (UINT) hb_parni( 4 )
                                ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI HENHMETAFILE WINAPI SetEnhMetaFileBits( IN UINT, IN CONST BYTE *);

/*

HB_FUNC( SETENHMETAFILEBITS )
{
   CONST BYTE ;

   // Your code goes here

   hb_retnl( (LONG) SetEnhMetaFileBits( (UINT) hb_parni( 1 ), &BYTE ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI HENHMETAFILE WINAPI SetWinMetaFileBits( IN UINT, IN CONST BYTE *, IN HDC, IN CONST METAFILEPICT *);

/*

HB_FUNC( SETWINMETAFILEBITS )
{
   CONST BYTE         ;
   CONST METAFILEPICT ;

   // Your code goes here

   hb_retnl( (LONG) SetWinMetaFileBits( (UINT) hb_parni( 1 ),
                                        &BYTE               ,
                                        (HDC) hb_parnl( 3 ) ,
                                        &&METAFILEPICT
                                        ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI EnumEnhMetaFile( IN HDC, IN HENHMETAFILE, IN ENHMFENUMPROC, IN LPVOID, IN CONST RECT *);

/*

HB_FUNC( ENUMENHMETAFILE )
{
   ENHMFENUMPROC enhmfEnumProc ;
   LPVOID        lpVoid        ;


   RECT  rc ;

   if ( ISARRAY(5) && Array2Rect( hb_param(5,HB_IT_ARRAY), &rc ))

   hb_retl( EnumEnhMetaFile( (HDC) hb_parnl( 1 )         ,
                             (HENHMETAFILE) hb_parnl( 2 ),
                             enhmfEnumProc               ,
                             lpVoid                      ,
                             &rc
                             ) ) ;
}

*/







//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI GetEnhMetaFileBits( IN HENHMETAFILE, IN UINT, OUT LPBYTE);

/*

HB_FUNC( GETENHMETAFILEBITS )
{
   LPBYTE       lpByte       ;

   // Your code goes here

   hb_retni( GetEnhMetaFileBits( (HENHMETAFILE) hb_parnl( 1 ),
                                 (UINT) hb_parni( 2 )        ,
                                 lpByte
                                 ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI GetEnhMetaFileHeader( IN HENHMETAFILE, IN UINT, OUT LPENHMETAHEADER );

/*

HB_FUNC( GETENHMETAFILEHEADER )
{
   LPENHMETAHEADER lPenhMetaHeader ;

   // Your code goes here

   hb_retni( GetEnhMetaFileHeader( (HENHMETAFILE) hb_parnl( 1 ),
                                   (UINT) hb_parni( 2 )        ,
                                   lPenhMetaHeader
                                   ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI GetEnhMetaFilePaletteEntries( IN HENHMETAFILE, IN UINT, OUT LPPALETTEENTRY );

/*

HB_FUNC( GETENHMETAFILEPALETTEENTRIES )
{
   LPPALETTEENTRY lpPaletteEntry ;

   // Your code goes here

   hb_retni( GetEnhMetaFilePaletteEntries( (HENHMETAFILE) hb_parnl( 1 ),
                                           (UINT) hb_parni( 2 )        ,
                                           lpPaletteEntry
                                           ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI GetEnhMetaFilePixelFormat( IN HENHMETAFILE, IN UINT, OUT PIXELFORMATDESCRIPTOR *);

_winmeta.c317
_winmisc.c
TypeFunctionSourceLine
HB_FUNCSTR2PTR(void)
HB_FUNC( STR2PTR )
{
   char *cStr = hb_parcx( 1 )    ;
   hb_retnl( ( LONG_PTR ) cStr ) ;
}
_winmisc.c27
HB_FUNCPEEKW(void)
HB_FUNC( PEEKW )
{
   hb_retni( * ( LPWORD ) hb_parnl( 1 ) );
}
_winmisc.c35
HB_FUNCPEEKL(void)
HB_FUNC( PEEKL )
{
   hb_retnl( * (LPDWORD) hb_parnl( 1 ) ) ;
}
_winmisc.c42
HB_FUNCPEEKB(void)
HB_FUNC( PEEKB )
{
   hb_retni( * ( LPBYTE ) hb_parnl( 1 ) );
}
_winmisc.c49
HB_FUNCPOKEW(void)
HB_FUNC( POKEW )
{
   * ( LPWORD ) hb_parnl( 1 ) = (WORD) hb_parni( 2 ) ;
}
_winmisc.c56
HB_FUNCPOKEL(void)
HB_FUNC( POKEL )
{
   * ( LPLONG ) hb_parnl( 1 ) = (DWORD) hb_parnl( 2 ) ;
}
_winmisc.c63
HB_FUNCPOKEB(void)
HB_FUNC( POKEB )
{
   * ( LPBYTE ) hb_parnl( 1 ) = hb_parni( 2 ) ;
}
_winmisc.c71
HB_FUNCPEEK(void)
HB_FUNC( PEEK )
{
 if ( hb_pcount()==2 )
    hb_retclen( (char *) hb_parnl( 1 ), hb_parnl( 2 ) );
 else
    hb_retc( (char *) hb_parnl( 1 ) );
}
_winmisc.c80
HB_FUNCPOKE(void)
HB_FUNC( POKE )
{
   if( hb_pcount() ==3 )
      hb_xmemcpy( (char *) hb_parnl(1), hb_parcx( 2 ), hb_parnl( 3 ) );
   else
      hb_xmemcpy( (char *) hb_parnl(1), hb_parcx( 2 ), hb_parclen( 2 ) );
}
_winmisc.c91
HB_FUNCD2BIN(void)
HB_FUNC( D2BIN )
{
   BYTE  *Buffer;
   Buffer = (BYTE *) hb_xgrab( sizeof(double) );

   *( (double *) ( Buffer ) ) = ( double ) hb_parnd( 1 );
   hb_retclen( ( char *)Buffer, sizeof(double) );
   hb_xfree(Buffer);
}
_winmisc.c103
HB_FUNCF2BIN(void)
HB_FUNC( F2BIN )
{
   BYTE  *Buffer;
   Buffer = (BYTE *) hb_xgrab( sizeof(float) );

   *( ( float *) ( Buffer ) ) = (float) hb_parnd( 1 );

   hb_retclen( ( char *)Buffer,sizeof(float) ) ;
   hb_xfree(Buffer);

}
_winmisc.c115
HB_FUNCBIN2D(void)
HB_FUNC( BIN2D )
{
  hb_retnd( *( (double *) hb_parcx( 1 ) ) );
}
_winmisc.c129
HB_FUNCBIN2F(void)
HB_FUNC( BIN2F )
{
   hb_retnd( (double) *( (float *) hb_parcx( 1 ) ) );
}
_winmisc.c136
BOOLArray2Rect(PHB_ITEM aRect, RECT *rc )
BOOL Array2Rect(PHB_ITEM aRect, RECT *rc )
{
   if (HB_IS_ARRAY(aRect) && hb_arrayLen(aRect) == 4) {
      rc->left   = hb_arrayGetNL(aRect,1);
      rc->top    = hb_arrayGetNL(aRect,2);
      rc->right  = hb_arrayGetNL(aRect,3);
      rc->bottom = hb_arrayGetNL(aRect,4);
      return TRUE ;
   }
   return FALSE;
}

_winmisc.c150
PHB_ITEMRect2Array( RECT *rc )
PHB_ITEM Rect2Array( RECT *rc  )
{
   PHB_ITEM aRect = hb_itemArrayNew(4);
   PHB_ITEM element = hb_itemNew(NULL);

   hb_arraySet(aRect, 1, hb_itemPutNL(element, rc->left));
   hb_arraySet(aRect, 2, hb_itemPutNL(element, rc->top));
   hb_arraySet(aRect, 3, hb_itemPutNL(element, rc->right));
   hb_arraySet(aRect, 4, hb_itemPutNL(element, rc->bottom));
   hb_itemRelease(element);
   return aRect;
}
_winmisc.c202
BOOLArray2Point(PHB_ITEM aPoint, POINT *pt )
BOOL Array2Point(PHB_ITEM aPoint, POINT *pt )
{
   if (HB_IS_ARRAY(aPoint) && hb_arrayLen(aPoint) == 2) {
      pt->x = hb_arrayGetNL(aPoint,1);
      pt->y = hb_arrayGetNL(aPoint,2);
      return TRUE ;
   }
   return FALSE;
}


_winmisc.c220
PHB_ITEMPoint2Array( POINT *pt )
PHB_ITEM Point2Array( POINT *pt  )
{
   PHB_ITEM aPoint = hb_itemArrayNew(2);
   PHB_ITEM element = hb_itemNew(NULL);

   hb_arraySet(aPoint, 1, hb_itemPutNL(element, pt->x));
   hb_arraySet(aPoint, 2, hb_itemPutNL(element, pt->y));
   hb_itemRelease(element);
   return aPoint;
}
_winmisc.c262
BOOLArray2Size(PHB_ITEM aSize, SIZE *siz )
BOOL Array2Size(PHB_ITEM aSize, SIZE *siz )
{
   if (HB_IS_ARRAY(aSize) && hb_arrayLen(aSize) == 2) {
      siz->cx = hb_arrayGetNL(aSize,1);
      siz->cy = hb_arrayGetNL(aSize,2);
      return TRUE ;
   }
   return FALSE;
}

_winmisc.c275
PHB_ITEMSize2Array( SIZE *siz )
PHB_ITEM Size2Array( SIZE *siz  )
{
   PHB_ITEM aSize = hb_itemArrayNew(2);
   PHB_ITEM element = hb_itemNew(NULL);

   hb_arraySet(aSize, 1, hb_itemPutNL(element, siz->cx));
   hb_arraySet(aSize, 2, hb_itemPutNL(element, siz->cy));
   hb_itemRelease(element);
   return aSize;
}
_winmisc.c314
HB_FUNCMAKEINRESOURCE(void)
HB_FUNC( MAKEINRESOURCE )
{
  hb_retc( MAKEINTRESOURCE( (WORD) hb_parni( 1 ) ) ) ;
}
_winmisc.c330
HB_FUNCMESSAGEBOX(void)
HB_FUNC( MESSAGEBOX )
{
 // LPCSTR lpCaption =  hb_parcx(3) ;

  hb_retnl( MessageBox( ISNIL(1) ? NULL : (HWND) hb_parnl(1) ,
                        (LPCSTR) hb_parcx(2),
                        ISNIL(3) ? NULL : (LPCSTR) hb_parcx(3) ,
                        ISNIL(4) ? 0 : (UINT) hb_parnl(4) ) ) ;
}
_winmisc.c338
HB_FUNCMESSAGEBEEP(void)
HB_FUNC( MESSAGEBEEP )
{
  hb_retl( MessageBeep( ISNIL(1) ?  (0xFFFFFFFF) : hb_parnl(1) ) ) ;
}
_winmisc.c350
HB_FUNCSETBIT(void)
HB_FUNC( SETBIT )
{
   if( hb_pcount() < 3 || hb_parni( 3 ) )
      hb_retnl( hb_parnl(1) | ( 1 << (hb_parni(2)-1) ) );
   else
      hb_retnl( hb_parnl(1) & ~( 1 << (hb_parni(2)-1) ) );
}
_winmisc.c357
HB_FUNCCHECKBIT(void)
HB_FUNC( CHECKBIT )
{
   hb_retl( hb_parnl(1) & ( 1 << (hb_parni(2)-1) ) );
}
_winmisc.c368
HB_FUNCGETENVIRONMENTSTRINGS(void)
HB_FUNC( GETENVIRONMENTSTRINGS )
{
   hb_retnl( (LONG) GetEnvironmentStrings(  ) ) ;
}
_winmisc.c379
HB_FUNCFREEENVIRONMENTSTRINGS(void)
HB_FUNC( FREEENVIRONMENTSTRINGS )
{
   hb_retl( (LONG) FreeEnvironmentStrings( (LPTSTR) hb_parnl(1) ) ) ;
}
_winmisc.c389
HB_FUNCSLEEP(void)
HB_FUNC( SLEEP )
{
   Sleep( (DWORD) hb_parnl( 1 ) ) ;
}
_winmisc.c399
HB_FUNCSETHANDLECOUNT(void)
HB_FUNC( SETHANDLECOUNT )
{
   hb_retni( SetHandleCount( (UINT) hb_parni( 1 ) ) ) ;
}
_winmisc.c408
HB_FUNCGETENVIRONMENTVARIABLE(void)
HB_FUNC( GETENVIRONMENTVARIABLE )
{
   UINT dwLen = MAX_PATH ;
   char *cText = (char*) hb_xgrab( MAX_PATH+1 );
   DWORD dwRet ;

   dwRet = GetEnvironmentVariableA( (LPCSTR) hb_parcx( 1 ),
                                    (LPSTR) cText ,
                                    (DWORD) dwLen
                                  ) ;
   hb_retclen( cText, dwRet );
   hb_xfree( cText );

}
_winmisc.c417
HB_FUNCSETENVIRONMENTVARIABLE(void)
HB_FUNC( SETENVIRONMENTVARIABLE )
{
   hb_retl( SetEnvironmentVariableA( (LPCSTR) hb_parcx( 1 ),
                                     (LPCSTR) hb_parcx( 2 )
                                     ) ) ;
}
_winmisc.c436
HB_FUNCWINEXEC(void)
HB_FUNC( WINEXEC )
{
   hb_retni( WinExec( (LPCSTR) hb_parcx( 1 ), (UINT) hb_parni( 2 ) ) ) ;
}
_winmisc.c448
LPWORDlpwAlign ( LPWORD lpIn)
LPWORD lpwAlign ( LPWORD lpIn)
{
  ULONG ul;
  ul = (ULONG) lpIn;
  ul +=3;
  ul >>=2;
  ul <<=2;
  return (LPWORD) ul;
}
_winmisc.c458
INTnCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn)
int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn)
{
  int nChar = 0;

  do {
      *lpWCStr++ = (WORD) *lpAnsiIn;
      nChar++;
     } while (*lpAnsiIn++);

  return nChar;
}

_winmisc.c471
HB_FUNCCREATEMUTEX(void)
HB_FUNC( CREATEMUTEX )
{
   SECURITY_ATTRIBUTES *sa = NULL;

   if( ISCHAR(1) )
   {
       sa = (SECURITY_ATTRIBUTES *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value;
   }

   hb_retnl( (ULONG) CreateMutex( ISNIL( 1 ) ? NULL : sa, hb_parnl( 2 ), hb_parcx( 3 ) ) );
}
_winmisc.c508
HB_FUNCOPENMUTEX(void)
HB_FUNC( OPENMUTEX )
{
  hb_retnl( (ULONG) OpenMutex( hb_parnl( 1 ), hb_parl( 2 ), hb_parcx( 3 ) ) );
}
_winmisc.c523
HB_FUNCRELEASEMUTEX(void)
HB_FUNC( RELEASEMUTEX )
{
  hb_retl( ReleaseMutex( (HANDLE) hb_parnl( 1 ) ) );
}
_winmisc.c531
HB_FUNCREGISTERHOTKEY(void)
HB_FUNC( REGISTERHOTKEY )
{
   hb_retl( RegisterHotKey( (HWND) hb_parnl( 1 ),
                            hb_parni( 2 )       ,
                            (UINT) hb_parni( 3 ),
                            (UINT) hb_parni( 4 )
                          ) ) ;
}
_winmisc.c542
HB_FUNCUNREGISTERHOTKEY(void)
HB_FUNC( UNREGISTERHOTKEY )
{
   hb_retl( UnregisterHotKey( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winmisc.c555
HB_FUNCGETCLASSINFO(void)
HB_FUNC( GETCLASSINFO )
{
   WNDCLASS WndClass  ;

   if ( GetClassInfo( ISNIL(1) ? NULL : (HINSTANCE) hb_parnl( 1 ),
                      (LPCSTR) hb_parcx( 2 ), &WndClass ) )


     hb_retclen( (char*) &WndClass, sizeof(WNDCLASS) ) ;

   // the line below GPFs !
   // hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) &WndClass, sizeof( WNDCLASS ) );

}
_winmisc.c569
HB_FUNCGETCLASSINFOEX(void)
HB_FUNC( GETCLASSINFOEX )
{
   WNDCLASSEX WndClassEx ;

   if ( GetClassInfoEx( ISNIL(1) ? NULL : (HINSTANCE) hb_parnl( 1 ),
                            (LPCSTR) hb_parcx( 2 ), &WndClassEx ) )

      hb_retclen( (char*) &WndClassEx, sizeof(WNDCLASSEX) ) ;
      //hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) &WndClassEx, sizeof( WNDCLASSEX ) );

}
_winmisc.c594
HB_FUNCSIN(void)
HB_FUNC( SIN )
{
   hb_retnd(sin(hb_parnd(1)));
}
_winmisc.c611
HB_FUNCCOS(void)
HB_FUNC( COS )
{
   hb_retnd(cos(hb_parnd(1)));
}
_winmisc.c618
HB_FUNCTAN(void)
HB_FUNC( TAN )
{
   hb_retnd(tan(hb_parnd(1)));
}
_winmisc.c625
HB_FUNCASIN(void)
HB_FUNC( ASIN )
{
   hb_retnd(asin(hb_parnd(1)));
}
_winmisc.c632
HB_FUNCACOS(void)
HB_FUNC( ACOS )
{
   hb_retnd(acos(hb_parnd(1)));
}
_winmisc.c639
HB_FUNCATAN(void)
HB_FUNC( ATAN )
{
   hb_retnd(atan(hb_parnd(1)));
}
_winmisc.c646
VOIDRect2ArrayEx( RECT *rc ,PHB_ITEM aRect )
void  Rect2ArrayEx( RECT *rc ,PHB_ITEM aRect )
{
   PHB_ITEM element = hb_itemNew(NULL);

   hb_arraySet(aRect, 1, hb_itemPutNL(element, rc->left));
   hb_arraySet(aRect, 2, hb_itemPutNL(element, rc->top));
   hb_arraySet(aRect, 3, hb_itemPutNL(element, rc->right));
   hb_arraySet(aRect, 4, hb_itemPutNL(element, rc->bottom));
   hb_itemRelease(element);
}
_winmisc.c653
VOIDPoint2ArrayEx( POINT *pt , PHB_ITEM aPoint)
void Point2ArrayEx( POINT *pt  , PHB_ITEM aPoint)
{

   PHB_ITEM element = hb_itemNew(NULL);

   hb_arraySet(aPoint, 1, hb_itemPutNL(element, pt->x));
   hb_arraySet(aPoint, 2, hb_itemPutNL(element, pt->y));
   hb_itemRelease(element);

}
_winmisc.c667
VOIDSize2ArrayEx( SIZE *siz ,PHB_ITEM aSize )
void Size2ArrayEx( SIZE *siz ,PHB_ITEM aSize )
{
   PHB_ITEM element = hb_itemNew(NULL);

   hb_arraySet(aSize, 1, hb_itemPutNL(element, siz->cx));
   hb_arraySet(aSize, 2, hb_itemPutNL(element, siz->cy));
   hb_itemRelease(element);

}
_winmisc.c680
_winmmcap.c
TypeFunctionSourceLine
HB_FUNCCAPCREATECAPTUREWINDOW(void)
HB_FUNC( CAPCREATECAPTUREWINDOW )
{
 hb_retnl( (LONG) capCreateCaptureWindow( (LPCSTR) hb_parc(1),
                                          (DWORD) hb_parnl(2),
                                          hb_parni(3), hb_parni(4),
                                          hb_parni(5), hb_parni(6),
                                          (HWND) hb_parnl(7),
                                          hb_parni(8) ) );
}

/* ------------------------------------------------------------------------ */

/* LRESULT CALLBACK capErrorCallback( HWND hWnd, int nID, LPCSTR lpsz ); */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL VFWAPI capGetDriverDescription( WORD wDriverIndex, LPSTR lpszName, INT cbName, LPSTR lpszVer, INT cbVer ); */
/*
HB_FUNC( CAPGETDRIVERDESCRIPTION )
{
 TCHAR lpszName[255];
 int cbName = 255;
 TCHAR lpszVer[255];
 int cbVer = 255;
 BOOL bRet;
 bRet = capGetDriverDescription( (WORD) hb_parnl(1), lpszName, cbName, lpszVer, cbVer );
 hb_storc( lpszName, 2 );
 hb_storni( cbName, 3 );
 hb_storc( lpszVer, 4 );
 hb_storni( cbVer, 5 );
 hb_retl(bRet);
}
*/

/* ------------------------------------------------------------------------ */

/* LRESULT CALLBACK capStatusCallback( HWND hWnd, int nID, LPCSTR lpsz ); */
/* To Do */

/* ------------------------------------------------------------------------ */

/* LRESULT CALLBACK capVideoStreamCallback( HWND hWnd, LPVIDEOHDR lpVHdr ); */
/* To Do */

/* ------------------------------------------------------------------------ */

/* LRESULT CALLBACK capWaveStreamCallback( HWND hWnd, LPWAVEHDR lpWHdr ); */
/* To Do */

/* ------------------------------------------------------------------------ */

/* LRESULT CALLBACK capYieldCallback( HWND hWnd ); */
/* To Do */

/* ======================================================================== */
/* Video Capture Macros                                                     */
_winmmcap.c29
HB_FUNCCAPCAPTUREABORT(void)
/* WM_CAP_ABORT */
/* SendMessage( hwnd, WM_CAP_ABORT, 0, 0 ) */
HB_FUNC( CAPCAPTUREABORT )
{
 hb_retl( capCaptureAbort( (HWND) hb_parnl(1) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capCaptureGetSetup( hwnd, s, wSize ); */
/* WM_CAP_GET_SEQUENCE_SETUP */
/* SendMessage( hwnd, WM_CAP_GET_SEQUENCE_SETUP, 0, 0 ) */
/* To Do */

_winmmcap.c94
HB_FUNCCAPCAPTURESEQUENCE(void)
/* WM_CAP_SEQUENCE */
/* SendMessage( hwnd, WM_CAP_SEQUENCE, 0, 0 ) */
HB_FUNC( CAPCAPTURESEQUENCE )
{
 hb_retl( capCaptureSequence( (HWND) hb_parnl(1) ) );
}

_winmmcap.c111
HB_FUNCCAPCAPTURESEQUENCENOFILE(void)
/* WM_CAP_SEQUENCE_NOFILE */
/* SendMessage( hwnd, WM_CAP_SEQUENCE_NOFILE, 0, 0 ) */
HB_FUNC( CAPCAPTURESEQUENCENOFILE )
{
 hb_retl( capCaptureSequenceNoFile( (HWND) hb_parnl(1) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capCaptureSetSetup( hwnd, psCapParms, wSize ); */
/* WM_CAP_SET_SEQUENCE_SETUP */
/* SendMessage( hwnd, WM_CAP_SET_SEQUENCE_SETUP, 0, 0 ) */
/* To Do */

_winmmcap.c121
HB_FUNCCAPCAPTURESINGLEFRAME(void)
/* WM_CAP_SINGLE_FRAME */
/* SendMessage( hwnd, WM_CAP_SINGLE_FRAME, 0, 0 ) */
HB_FUNC( CAPCAPTURESINGLEFRAME )
{
 hb_retl( capCaptureSingleFrame( (HWND) hb_parnl(1) ) );
}

_winmmcap.c138
HB_FUNCCAPCAPTURESINGLEFRAMECLOSE(void)
/* WM_CAP_SINGLE_FRAME_CLOSE */
/* SendMessage( hwnd, WM_CAP_SINGLE_FRAME_CLOSE, 0, 0 ) */
HB_FUNC( CAPCAPTURESINGLEFRAMECLOSE )
{
 hb_retl( capCaptureSingleFrameClose( (HWND) hb_parnl(1) ) );
}

_winmmcap.c148
HB_FUNCCAPCAPTURESINGLEFRAMEOPEN(void)
/* WM_CAP_SINGLE_FRAME_OPEN */
/* SendMessage( hwnd, WM_CAP_SINGLE_FRAME_OPEN, 0, 0 ) */
HB_FUNC( CAPCAPTURESINGLEFRAMEOPEN )
{
 hb_retl( capCaptureSingleFrameOpen( (HWND) hb_parnl(1) ) );
}

_winmmcap.c158
HB_FUNCCAPCAPTURESTOP(void)
/* WM_CAP_STOP */
/* SendMessage( hwnd, WM_CAP_STOP, 0, 0 ) */
HB_FUNC( CAPCAPTURESTOP )
{
 hb_retl( capCaptureStop( (HWND) hb_parnl(1) ) );
}

_winmmcap.c168
HB_FUNCCAPDLGVIDEOCOMPRESSION(void)
/* WM_CAP_DLG_VIDEOCOMPRESSION */
/* SendMessage( hwnd, WM_CAP_DLG_VIDEOCOMPRESSION, 0, 0 ) */
HB_FUNC( CAPDLGVIDEOCOMPRESSION )
{
 hb_retl( capDlgVideoCompression( (HWND) hb_parnl(1) ) );
}

_winmmcap.c178
HB_FUNCCAPDLGVIDEODISPLAY(void)
/* WM_CAP_DLG_VIDEODISPLAY */
/* SendMessage( hwnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0 ) */
HB_FUNC( CAPDLGVIDEODISPLAY )
{
 hb_retl( capDlgVideoDisplay( (HWND) hb_parnl(1) ) );
}

_winmmcap.c188
HB_FUNCCAPDLGVIDEOFORMAT(void)
/* WM_CAP_DLG_VIDEOFORMAT */
/* SendMessage( hwnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0 ) */
HB_FUNC( CAPDLGVIDEOFORMAT )
{
 hb_retl( capDlgVideoFormat( (HWND) hb_parnl(1) ) );
}

_winmmcap.c198
HB_FUNCCAPDLGVIDEOSOURCE(void)
/* WM_CAP_DLG_VIDEOSOURCE */
/* SendMessage( hwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0 ) */
HB_FUNC( CAPDLGVIDEOSOURCE )
{
 hb_retl( capDlgVideoSource( (HWND) hb_parnl(1) ) );
}

_winmmcap.c208
HB_FUNCCAPDRIVERCONNECT(void)
/* WM_CAP_DRIVER_CONNECT */
/* SendMessage( hwnd, WM_CAP_DRIVER_CONNECT, 0, 0 ) */
HB_FUNC( CAPDRIVERCONNECT )
{
 hb_retl( capDriverConnect( (HWND) hb_parnl(1), hb_parni(2) ) );
}

_winmmcap.c218
HB_FUNCCAPDRIVERDISCONNECT(void)
/* WM_CAP_DRIVER_DISCONNECT */
/* SendMessage( hwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0 ) */
HB_FUNC( CAPDRIVERDISCONNECT )
{
 hb_retl( capDriverDisconnect( (HWND) hb_parnl(1) ) );
}

/* ------------------------------------------------------------------------ */

/* capDriverGetCaps( hwnd, psCaps, wSize ); */
/* WM_CAP_DRIVER_GET_CAPS */
/* SendMessage( hwnd, WM_CAP_DRIVER_GET_CAPS, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capDriverGetName( hwnd, szName, wSize ); */
/* WM_CAP_DRIVER_GET_NAME */
/* SendMessage( hwnd, WM_CAP_DRIVER_GET_NAME, 0, 0 ) */
/*
HB_FUNC( CAPDRIVERGETNAME )
{
 TCHAR szName[255];
 WORD wSize = 255;
 BOOL bRet;
 bRet = capDriverGetName( (HWND) hb_parnl(1), szName, &wSize );
 hb_storc( szName, 2 );
 hb_storni( wSize, 3 );
 hb_retl(bRet);
}
*/

/* ------------------------------------------------------------------------ */

/* BOOL capDriverGetVersion( hwnd, szVer, wSize ); */
/* WM_CAP_DRIVER_GET_VERSION */
/* SendMessage( hwnd, WM_CAP_DRIVER_GET_VERSION, 0, 0 ) */
/*
HB_FUNC( CAPDRIVERGETVERSION )
{
 TCHAR szVer[40];
 WORD wSize = 40;
 BOOL bRet;
 bRet = capDriverGetVersion( (HWND) hb_parnl(1), szVer, &wSize );
 hb_storc( szVer, 2 );
 hb_storni( wSize, 3 );
 hb_retl(bRet);
}
*/

_winmmcap.c228
HB_FUNCCAPEDITCOPY(void)
/* WM_CAP_EDIT_COPY */
/* SendMessage( hwnd, WM_CAP_EDIT_COPY, 0, 0 ) */
HB_FUNC( CAPEDITCOPY )
{
 hb_retl( capEditCopy( (HWND) hb_parnl(1) ) );
}

_winmmcap.c281
HB_FUNCCAPFILEALLOC(void)
/* WM_CAP_FILE_ALLOCATE */
/* SendMessage( hwnd, WM_CAP_FILE_ALLOCATE, 0, 0 ) */
HB_FUNC( CAPFILEALLOC )
{
 hb_retl( capFileAlloc( (HWND) hb_parnl(1), (DWORD) hb_parnl(2) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capFileGetCaptureFile( hwnd, szName, wSize ); */
/* WM_CAP_FILE_GET_CAPTURE_FILE */
/* SendMessage( hwnd, WM_CAP_FILE_GET_CAPTURE_FILE, 0, 0 ) */
/*
HB_FUNC( CAPFILEGETCAPTUREFILE )
{
 TCHAR szName[255];
 WORD wSize = 255;
 BOOL bRet;
 bRet = capFileGetCaptureFile( (HWND) hb_parnl(1), szName, &wSize );
 hb_storc( szName, 2 );
 hb_storni( wSize, 3 );
 hb_retl(bRet);
}
*/

_winmmcap.c291
HB_FUNCCAPFILESAVEAS(void)
/* WM_CAP_FILE_SAVEAS */
/* SendMessage( hwnd, WM_CAP_FILE_SAVEAS, 0, 0 ) */
HB_FUNC( CAPFILESAVEAS )
{
 hb_retl( capFileSaveAs( (HWND) hb_parnl(1), hb_parc(2) ) );
}

_winmmcap.c319
HB_FUNCCAPFILESAVEDIB(void)
/* WM_CAP_FILE_SAVEDIB */
/* SendMessage( hwnd, WM_CAP_FILE_SAVEDIB, 0, 0 ) */
HB_FUNC( CAPFILESAVEDIB )
{
 hb_retl( capFileSaveDIB( (HWND) hb_parnl(1), hb_parc(2) ) );
}

_winmmcap.c329
HB_FUNCCAPFILESETCAPTUREFILE(void)
/* WM_CAP_FILE_SET_CAPTURE_FILE */
/* SendMessage( hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, 0 ) */
HB_FUNC( CAPFILESETCAPTUREFILE )
{
 hb_retl( capFileSetCaptureFile( (HWND) hb_parnl(1), hb_parc(2) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capFileSetInfoChunk( hwnd, lpInfoChunk ); */
/* WM_CAP_FILE_SET_INFOCHUNK */
/* SendMessage( hwnd, WM_CAP_FILE_SET_INFOCHUNK, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* DWORD capGetAudioFormat( hwnd, psAudioFormat, wSize ); */
/* WM_CAP_GET_AUDIOFORMAT */
/* SendMessage( hwnd, WM_CAP_GET_AUDIOFORMAT, 0, 0 ) */
/* To Do */

_winmmcap.c339
HB_FUNCCAPGETAUDIOFORMATSIZE(void)
/* WM_CAP_GET_AUDIOFORMAT */
/* SendMessage( hwnd, WM_CAP_GET_AUDIOFORMAT, 0, 0 ) */
HB_FUNC( CAPGETAUDIOFORMATSIZE )
{
 hb_retnl( capGetAudioFormatSize( (HWND) hb_parnl(1) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capGetMCIDeviceName( hwnd, szName, wSize ); */
/* WM_CAP_GET_MCI_DEVICE */
/* SendMessage( hwnd, WM_CAP_GET_MCI_DEVICE, 0, 0 ) */
/*
HB_FUNC( CAPGETMCIDEVICENAME )
{
 TCHAR szName[255];
 WORD wSize = 255;
 BOOL bRet;
 bRet = capGetMCIDeviceName( (HWND) hb_parnl(1), szName, &wSize );
 hb_storc( szName, 2 );
 hb_storni( wSize, 3 );
 hb_retl(bRet);
}
*/

/* ------------------------------------------------------------------------ */

/* BOOL capGetStatus( hwnd, s, wSize ); */
/* WM_CAP_GET_STATUS */
/* SendMessage( hwnd, WM_CAP_GET_STATUS, 0, 0 ) */
/* To Do */

_winmmcap.c363
HB_FUNCCAPGETUSERDATA(void)
/* WM_CAP_GET_USER_DATA */
/* SendMessage( hwnd, WM_CAP_GET_USER_DATA, 0, 0 ) */
/* To check: the return must be a LONG */
HB_FUNC( CAPGETUSERDATA )
{
 hb_retl( capGetUserData( (HWND) hb_parnl(1) ) );
}

/* ------------------------------------------------------------------------ */

/* DWORD capGetVideoFormat( hwnd, psVideoFormat, wSize ); */
/* WM_CAP_GET_VIDEOFORMAT */
/* SendMessage( hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0 ) */
/* To Do */

_winmmcap.c398
HB_FUNCCAPGETVIDEOFORMATSIZE(void)
/* WM_CAP_GET_VIDEOFORMAT */
/* SendMessage( hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0 ) */
HB_FUNC( CAPGETVIDEOFORMATSIZE )
{
 hb_retnl( capGetVideoFormatSize( (HWND) hb_parnl(1) ) );
}

_winmmcap.c416
HB_FUNCCAPGRABFRAME(void)
/* WM_CAP_GRAB_FRAME */
/* SendMessage( hwnd, WM_CAP_GRAB_FRAME, 0, 0 ) */
HB_FUNC( CAPGRABFRAME )
{
 hb_retl( capGrabFrame( (HWND) hb_parnl(1) ) );
}

_winmmcap.c426
HB_FUNCCAPGRABFRAMENOSTOP(void)
/* WM_CAP_GRAB_FRAME_NOSTOP */
/* SendMessage( hwnd, WM_CAP_GRAB_FRAME_NOSTOP, 0, 0 ) */
HB_FUNC( CAPGRABFRAMENOSTOP )
{
 hb_retl( capGrabFrameNoStop( (HWND) hb_parnl(1) ) );
}

_winmmcap.c436
HB_FUNCCAPOVERLAY(void)
/* WM_CAP_SET_OVERLAY */
/* SendMessage( hwnd, WM_CAP_SET_OVERLAY, 0, 0 ) */
HB_FUNC( CAPOVERLAY )
{
 hb_retl( capOverlay( (HWND) hb_parnl(1), hb_parl(2) ) );
}

_winmmcap.c446
HB_FUNCCAPPALETTEAUTO(void)
/* WM_CAP_PAL_AUTOCREATE */
/* SendMessage( hwnd, WM_CAP_PAL_AUTOCREATE, 0, 0 ) */
HB_FUNC( CAPPALETTEAUTO )
{
 hb_retl( capPaletteAuto( (HWND) hb_parnl(1), hb_parni(2), hb_parni(3) ) );
}

_winmmcap.c456
HB_FUNCCAPPALETTEMANUAL(void)
/* WM_CAP_PAL_MANUALCREATE */
/* SendMessage( hwnd, WM_CAP_PAL_MANUALCREATE, 0, 0 ) */
HB_FUNC( CAPPALETTEMANUAL )
{
 hb_retl( capPaletteManual( (HWND) hb_parnl(1), hb_parl(2), hb_parni(3) ) );
}

_winmmcap.c466
HB_FUNCCAPPALETTEOPEN(void)
/* WM_CAP_PAL_OPEN */
/* SendMessage( hwnd, WM_CAP_PAL_OPEN, 0, 0 ) */
HB_FUNC( CAPPALETTEOPEN )
{
 hb_retl( capPaletteOpen( (HWND) hb_parnl(1), hb_parc(2) ) );
}

_winmmcap.c476
HB_FUNCCAPPALETTEPASTE(void)
/* WM_CAP_PAL_PASTE */
/* SendMessage( hwnd, WM_CAP_PAL_PASTE, 0, 0 ) */
HB_FUNC( CAPPALETTEPASTE )
{
 hb_retl( capPalettePaste( (HWND) hb_parnl(1) ) );
}

_winmmcap.c486
HB_FUNCCAPPALETTESAVE(void)
/* WM_CAP_PAL_SAVE */
/* SendMessage( hwnd, WM_CAP_PAL_SAVE, 0, 0 ) */
HB_FUNC( CAPPALETTESAVE )
{
 hb_retl( capPaletteSave( (HWND) hb_parnl(1), hb_parc(2) ) );
}

_winmmcap.c496
HB_FUNCCAPPREVIEW(void)
/* WM_CAP_SET_PREVIEW */
/* SendMessage( hwnd, WM_CAP_SET_PREVIEW, 0, 0 ) */
HB_FUNC( CAPPREVIEW )
{
 hb_retl( capPreview( (HWND) hb_parnl(1), hb_parl(2) ) );
}

_winmmcap.c506
HB_FUNCCAPPREVIEWRATE(void)
/* WM_CAP_SET_PREVIEWRATE */
/* SendMessage( hwnd, WM_CAP_SET_PREVIEWRATE, 0, 0 ) */
HB_FUNC( CAPPREVIEWRATE )
{
 hb_retl( capPreviewRate( (HWND) hb_parnl(1), (WORD) hb_parnl(2) ) );
}

_winmmcap.c516
HB_FUNCCAPPREVIEWSCALE(void)
/* WM_CAP_SET_SCALE */
/* SendMessage( hwnd, WM_CAP_SET_SCALE, 0, 0 ) */
HB_FUNC( CAPPREVIEWSCALE )
{
 hb_retl( capPreviewScale( (HWND) hb_parnl(1), hb_parl(2) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capSetAudioFormat( hwnd, psAudioFormat, wSize ); */
/* WM_CAP_SET_AUDIOFORMAT */
/* SendMessage( hwnd, WM_CAP_SET_AUDIOFORMAT, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnCapControl( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_CAPCONTROL */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_CAPCONTROL, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnError( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_ERROR */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_ERROR, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnFrame( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_FRAME */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_FRAME, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnStatus( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_STATUS */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_STATUS, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnVideoStream( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_VIDEOSTREAM */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnWaveStream( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_WAVESTREAM */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_WAVESTREAM, 0, 0 ) */
/* To Do */

/* ------------------------------------------------------------------------ */

/* BOOL capSetCallbackOnYield( hwnd, fpProc ); */
/* WM_CAP_SET_CALLBACK_YIELD */
/* SendMessage( hwnd, WM_CAP_SET_CALLBACK_YIELD, 0, 0 ) */
/* To Do */

_winmmcap.c526
HB_FUNCCAPSETMCIDEVICENAME(void)
/* WM_CAP_SET_MCI_DEVICE */
/* SendMessage( hwnd, WM_CAP_SET_MCI_DEVICE, 0, 0 ) */
HB_FUNC( CAPSETMCIDEVICENAME )
{
 hb_retl( capSetMCIDeviceName( (HWND) hb_parnl(1), hb_parc(2) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capSetScrollPos( hwnd, lpP ); */
/* WM_CAP_SET_SCROLL */
/* SendMessage( hwnd, WM_CAP_SET_SCROLL, 0, 0 ) */
/* To Do */

_winmmcap.c592
HB_FUNCCAPSETUSERDATA(void)
/* WM_CAP_SET_USER_DATA */
/* SendMessage( hwnd, WM_CAP_SET_USER_DATA, 0, 0 ) */
HB_FUNC( CAPSETUSERDATA )
{
 hb_retl( capSetUserData( (HWND) hb_parnl(1), hb_parnl(2) ) );
}

/* ------------------------------------------------------------------------ */

/* BOOL capSetVideoFormat( hwnd, psVideoFormat, wSize ); */
/* WM_CAP_SET_VIDEOFORMAT */
/* SendMessage( hwnd, WM_CAP_SET_VIDEOFORMAT, 0, 0 ) */
/* To Do */

_winmmcap.c609
_winmous.c
TypeFunctionSourceLine
HB_FUNCLOADCURSOR(void)
HB_FUNC( LOADCURSOR )
{
   hb_retnl( (LONG) LoadCursor( ISNIL(1) ? NULL : (HINSTANCE) hb_parnl(1) ,
                    hb_parinfo(2)== HB_IT_STRING ? hb_parcx(2): MAKEINTRESOURCE( hb_parnl( 2 ) ) ) );
}
_winmous.c37
HB_FUNCGETCAPTURE(void)
HB_FUNC( GETCAPTURE )
{
   hb_retnl( (LONG) GetCapture(  ) ) ;
}
_winmous.c47
HB_FUNCSETCAPTURE(void)
HB_FUNC( SETCAPTURE )
{
   hb_retnl( (LONG) SetCapture( (HWND) hb_parnl( 1 ) ) ) ;
}
_winmous.c56
HB_FUNCRELEASECAPTURE(void)
HB_FUNC( RELEASECAPTURE )
{
   hb_retl( ReleaseCapture(  ) ) ;
}
_winmous.c65
HB_FUNCGETDOUBLECLICKTIME(void)
HB_FUNC( GETDOUBLECLICKTIME )
{
   hb_retni( GetDoubleClickTime(  ) ) ;
}
_winmous.c75
HB_FUNCSETDOUBLECLICKTIME(void)
HB_FUNC( SETDOUBLECLICKTIME )
{
   hb_retl( SetDoubleClickTime( (UINT) hb_parni( 1 ) ) ) ;
}
_winmous.c84
HB_FUNCSHOWCURSOR(void)
HB_FUNC( SHOWCURSOR )
{
   hb_retni( ShowCursor( hb_parl( 1 ) ) ) ;
}
_winmous.c94
HB_FUNCSETCURSORPOS(void)
HB_FUNC( SETCURSORPOS )
{
   hb_retl( SetCursorPos( hb_parni( 1 ), hb_parni( 2 ) ) ) ;
}
_winmous.c103
HB_FUNCWINSETCURSOR(void)
HB_FUNC( WINSETCURSOR )
{
   hb_retnl( (LONG) SetCursor( (HCURSOR) hb_parnl( 1 ) ) ) ;
}
_winmous.c117
HB_FUNCTRACKMOUSEEVENT(void)
HB_FUNC( TRACKMOUSEEVENT )
{

 TRACKMOUSEEVENT *tme =  (TRACKMOUSEEVENT * ) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value;

  hb_retl( TrackMouseEvent( tme ) );

}
_winmous.c124
HB_FUNCGETCURSORPOS(void)
HB_FUNC( GETCURSORPOS )
{
   POINT Point ;
   PHB_ITEM gcPos ;

   if ( GetCursorPos( &Point ) )
   {
      gcPos = Point2Array( &Point);
      _itemReturn( gcPos );
      _itemRelease( gcPos );
   }

}
_winmous.c137
HB_FUNCCLIPCURSOR(void)
HB_FUNC( CLIPCURSOR )
{
   RECT rc ;
   BOOL bRectOk ;

   bRectOk = ( ISARRAY( 2 )  &&   Array2Rect( hb_param(1,HB_IT_ARRAY), &rc ) );

   hb_retl(  ClipCursor( bRectOk ? &rc : NULL ) );

}
_winmous.c155
HB_FUNCGETCLIPCURSOR(void)
HB_FUNC( GETCLIPCURSOR )
{
   RECT rc;

   if ( GetClipCursor( &rc ) )
      hb_itemReturnRelease( Rect2Array( &rc ) );
}
_winmous.c170
HB_FUNCGETCURSOR(void)
HB_FUNC( GETCURSOR )
{
   hb_retnl( (LONG) GetCursor(  ) ) ;
}
_winmous.c184
HB_FUNCSWAPMOUSEBUTTON(void)
HB_FUNC( SWAPMOUSEBUTTON )
{
   hb_retl( SwapMouseButton( hb_parl( 1 ) ) ) ;
}
_winmous.c194
HB_FUNCLOADCURSORFROMFILE(void)
HB_FUNC( LOADCURSORFROMFILE )
{
   hb_retnl( (LONG) LoadCursorFromFile( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_winmous.c204
HB_FUNCCREATECURSOR(void)
HB_FUNC( CREATECURSOR )
{
   hb_retnl( (LONG) CreateCursor( (HINSTANCE) hb_parnl( 1 ),
                                  hb_parni( 2 )            ,
                                  hb_parni( 3 )            ,
                                  hb_parni( 4 )            ,
                                  hb_parni( 5 )            ,
                                  hb_parcx( 6 )             ,
                                  hb_parcx( 7 )
                                 ) ) ;
}
_winmous.c213
HB_FUNCDESTROYCURSOR(void)
HB_FUNC( DESTROYCURSOR )
{
   hb_retl( DestroyCursor( (HCURSOR) hb_parnl( 1 ) ) ) ;
}
_winmous.c230
HB_FUNCCOPYCURSOR(void)
HB_FUNC( COPYCURSOR )
{
   hb_retnl( (LONG) CopyCursor( (HCURSOR) hb_parnl( 1 ) ) ) ;
}
_winmous.c239
HB_FUNCSETSYSTEMCURSOR(void)
HB_FUNC( SETSYSTEMCURSOR )
{
   hb_retl( SetSystemCursor( (HCURSOR) hb_parnl( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_winmous.c248
HB_FUNCGETCURSORINFO(void)
HB_FUNC( GETCURSORINFO )
{
   CURSORINFO pci ;

   if ( GetCursorInfo( &pci ) )

      hb_retclen( (char *) &pci, sizeof( CURSORINFO ) ) ;

}
_winmous.c257
_winmsg.c
TypeFunctionSourceLine
HB_FUNC_ISDIALOGMESSAGE(void)
HB_FUNC( _ISDIALOGMESSAGE )
{
  hb_retl(IsDialogMessage( (HWND) hb_parnl(1), (MSG*) hb_parcx(2) )) ;
}
_winmsg.c25
HB_FUNCTRANSLATEMDISYSACCEL(void)
HB_FUNC( TRANSLATEMDISYSACCEL )
{
   hb_retl( TranslateMDISysAccel( (HWND) hb_parnl( 1 ), (MSG*) hb_parcx( 2 ) ) ) ;
}
_winmsg.c34
HB_FUNCTRANSLATEMESSAGE(void)
HB_FUNC( TRANSLATEMESSAGE )
{
  hb_retl(TranslateMessage( (MSG*) hb_parcx(1))) ;
}
_winmsg.c42
HB_FUNCDISPATCHMESSAGE(void)
HB_FUNC( DISPATCHMESSAGE )
{
  hb_retnl(DispatchMessage( (MSG*) hb_parcx(1))) ;
}
_winmsg.c49
HB_FUNCPOSTQUITMESSAGE(void)
HB_FUNC( POSTQUITMESSAGE )
{
  PostQuitMessage(hb_parni(1));
}
_winmsg.c56
HB_FUNCPOSTMESSAGE(void)
HB_FUNC( POSTMESSAGE )
{

   char *cText = NULL;

   if (ISBYREF(4))
   {
      cText = (char*) hb_xgrab( hb_parcsiz(4) );
      hb_xmemcpy( cText, hb_parcx(4), hb_parcsiz(4) );
   }


   hb_retnl( (LONG) PostMessage( (HWND) hb_parnl( 1 ), (UINT) hb_parni( 2 ),
                                (ISNIL(3) ? 0 : (WPARAM) hb_parnl( 3 ))   ,
                                (ISNIL(4) ? 0 : ( ISBYREF(4)? (LPARAM) (LPSTR) cText : ( ISCHAR(4) ? (LPARAM)(LPSTR) hb_parcx(4) : (LPARAM) hb_parnl( 4 ))))
                               )
            );


   if( ISBYREF( 4 ) )
   {
      hb_storclen( cText, hb_parcsiz(4), 4 ) ;
      hb_xfree( cText );
   }
}
_winmsg.c64
HB_FUNCSENDMESSAGE(void)
HB_FUNC( SENDMESSAGE )
{

   char *cText = NULL;


   if( ISBYREF(4) )
   {
      cText = (char*) hb_xgrab( hb_parcsiz(4) );
      hb_xmemcpy( cText, hb_parcx(4), hb_parcsiz(4) );
   }

   hb_retnl( (ULONG) SendMessage( (HWND) hb_parnl( 1 ), (UINT) hb_parni( 2 ),
                                  (ISNIL(3) ? 0 : (WPARAM) hb_parnl( 3 ))   ,
                                  (ISNIL(4) ? 0 : ( ISBYREF(4)? (LPARAM) (LPSTR) cText : ( ISCHAR(4) ? (LPARAM)(LPSTR) hb_parcx(4) : (LPARAM) hb_parnl( 4 ))))
                                )
           );


   if (ISBYREF( 4 ))
   {
      hb_storclen( cText, hb_parcsiz(4), 4 ) ;
      hb_xfree( cText );
   }
}
_winmsg.c92
HB_FUNCSENDDLGITEMMESSAGE(void)
HB_FUNC( SENDDLGITEMMESSAGE )
{
   char *cText;
   PHB_ITEM pText = hb_param( 5, HB_IT_STRING );

   if( pText )
   {
      cText = (char*) hb_xgrab( hb_itemGetCLen( pText )+1 ); //pText->item.asString.length + 1 );
      //hb_xmemcpy( cText, pText->item.asString.value, pText->item.asString.length + 1 );
      hb_xmemcpy( cText, hb_itemGetC( pText ), hb_itemGetCLen( pText ) + 1 );
   }
   else
   {
      cText = NULL;
   }

   hb_retnl( (LONG) SendDlgItemMessage( (HWND) hb_parnl( 1 ) ,
                                        (int)  hb_parni( 2 ) ,
                                        (UINT) hb_parni( 3 ) ,
                                        (ISNIL(4) ? 0 : (WPARAM) hb_parnl( 4 ))   ,
                                        (cText ? (LPARAM) cText : (LPARAM) hb_parnl( 5 ))
                                      )
            );

  // Will be ignored if not BYREF.
  if( pText )
  {
     //hb_storclen( cText, pText->item.asString.length, 5 ) ;
     hb_storclen( cText, hb_itemGetCLen( pText ), 5 ) ;
  }

  if( cText )
  {
     hb_xfree( cText );
  }

/*
   hb_retnl( SendDlgItemMessage( (HWND) hb_parnl(1) ,     // handle of dialog box
                                (int)   hb_parni(2) ,     // identifier of control
                                (UINT)  hb_parni(3) ,     // message to send
                                (ISNIL(4) ? 0 : (WPARAM) hb_parni(4) ) ,  // first message parameter
                                (ISNIL(5) ? 0 : (hb_parinfo(5)==HB_IT_STRING ? (LPARAM) (LPSTR) hb_parcx(5) : (LPARAM) hb_parnl( 5 )) )   // second message parameter
                              ));

*/

}
_winmsg.c121
HB_FUNCGETMESSAGE(void)
HB_FUNC( GETMESSAGE )
{
  MSG Msg ;

  if (GetMessage( &Msg,
                  ISNIL(2) ? NULL : (HWND) hb_parnl(2),
                  ISNIL(3) ? 0 : hb_parnl(3),
                  ISNIL(4) ? 0 : hb_parnl(4) ) )
    {
      hb_storclen( (LPSTR) &Msg, sizeof(MSG), 1 ) ;
      hb_retl( 1 ) ;
    }
  else
    hb_retl ( 0 ) ;
}
_winmsg.c175
HB_FUNCPEEKMESSAGE(void)
HB_FUNC( PEEKMESSAGE )
{
  MSG Msg ;

   if (PeekMessage( (MSG*) &Msg,
                    ISNIL(2) ? NULL :(HWND) hb_parnl(2),
                    ISNIL(3) ? 0 : hb_parnl(3),
                    ISNIL(4) ? 0 : hb_parnl(4),
                    ISNIL(5) ? PM_NOREMOVE : hb_parnl(5)))
     {
       hb_storclen( (LPSTR) &Msg, sizeof(MSG),1) ;
       hb_retl( 1 ) ;
     }
  else
     hb_retl ( 0 ) ;

}
_winmsg.c193
HB_FUNCREGISTERWINDOWMESSAGE(void)
HB_FUNC( REGISTERWINDOWMESSAGE )
{
   hb_retni( RegisterWindowMessageA( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
_winmsg.c216
HB_FUNCSETMESSAGEQUEUE(void)
HB_FUNC( SETMESSAGEQUEUE )
{
   hb_retl( SetMessageQueue( hb_parni( 1 ) ) ) ;
}
_winmsg.c226
HB_FUNCGETMESSAGEPOS(void)
HB_FUNC( GETMESSAGEPOS )
{
   hb_retnl( (LONG) GetMessagePos(  ) ) ;
}
_winmsg.c235
HB_FUNCGETMESSAGETIME(void)
HB_FUNC( GETMESSAGETIME )
{
   hb_retnl( (LONG) GetMessageTime(  ) ) ;
}
_winmsg.c244
HB_FUNCGETMESSAGEEXTRAINFO(void)
HB_FUNC( GETMESSAGEEXTRAINFO )
{
   hb_retnl( (LONG) GetMessageExtraInfo(  ) ) ;
}
_winmsg.c253
HB_FUNCSETMESSAGEEXTRAINFO(void)
HB_FUNC( SETMESSAGEEXTRAINFO )
{
   hb_retnl( (LONG) SetMessageExtraInfo( (LPARAM) hb_parnl( 1 ) ) ) ;
}


//-----------------------------------------------------------------------------
// WINUSERAPI LRESULT WINAPI SendMessageTimeoutA( IN HWND hWnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam, IN UINT fuFlags, IN UINT uTimeout, OUT PDWORD_PTR lpdwResult);

_winmsg.c262
HB_FUNCSENDNOTIFYMESSAGE(void)
HB_FUNC( SENDNOTIFYMESSAGE )
{
   hb_retl( SendNotifyMessage( (HWND) hb_parnl( 1 )  ,
                               (UINT) hb_parni( 2 )  ,
                               (WPARAM) hb_parnl( 3 ),
                               (LPARAM) hb_parnl( 4 )
                             ) ) ;
}
_winmsg.c295
HB_FUNCPOSTTHREADMESSAGE(void)
HB_FUNC( POSTTHREADMESSAGE )
{
   hb_retl( PostThreadMessage( (DWORD) hb_parnl( 1 ) ,
                               (UINT) hb_parni( 2 )  ,
                               (WPARAM) hb_parnl( 3 ),
                               (LPARAM) hb_parnl( 4 )
                             ) ) ;
}
_winmsg.c308
HB_FUNCREPLYMESSAGE(void)
HB_FUNC( REPLYMESSAGE )
{
   hb_retl( ReplyMessage( (LRESULT) hb_parnl( 1 ) ) ) ;
}
_winmsg.c320
HB_FUNCWAITMESSAGE(void)
HB_FUNC( WAITMESSAGE )
{
   hb_retl( WaitMessage(  ) ) ;
}
_winmsg.c329
HB_FUNCWAITFORINPUTIDLE(void)
HB_FUNC( WAITFORINPUTIDLE )
{
   hb_retnl( (LONG) WaitForInputIdle( (HANDLE) hb_parnl( 1 ),
                                      (DWORD) hb_parnl( 2 )
                                    ) ) ;
}
_winmsg.c337
HB_FUNCINSENDMESSAGE(void)
HB_FUNC( INSENDMESSAGE )
{
   hb_retl( InSendMessage(  ) ) ;
}
_winmsg.c347
HB_FUNCINSENDMESSAGEEX(void)
HB_FUNC( INSENDMESSAGEEX )
{

   hb_retnl( (LONG) InSendMessageEx( NULL ) ) ; // param reserved must be NULL
}
_winmsg.c358
HB_FUNCMSGWAITFORMULTIPLEOBJECTS(void)
HB_FUNC( MSGWAITFORMULTIPLEOBJECTS )
{
   hb_retnl( (LONG) MsgWaitForMultipleObjects( (DWORD) hb_parnl( 1 ) ,
                                               (HANDLE *) hb_parnl( 2 ),
                                               hb_parl( 3 ) ,
                                               (DWORD) hb_parnl( 4 ) ,
                                               (DWORD) hb_parnl( 5 )
                                             ) ) ;
}
_winmsg.c371
HB_FUNCMSGWAITFORMULTIPLEOBJECTSEX(void)
HB_FUNC( MSGWAITFORMULTIPLEOBJECTSEX )
{
   hb_retnl( (LONG) MsgWaitForMultipleObjectsEx( (DWORD) hb_parnl( 1 ) ,
                                                 (HANDLE *) hb_parnl( 2 ),
                                                 (DWORD) hb_parnl( 3 ) ,
                                                 (DWORD) hb_parnl( 4 ) ,
                                                 (DWORD) hb_parnl( 5 )
                                               ) ) ;
}


//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI SendMessageCallbackA( IN HWND hWnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam, IN SENDASYNCPROC lpResultCallBack, IN ULONG_PTR dwData);

/*

HB_FUNC( SENDMESSAGECALLBACK )
{
   SENDASYNCPROC lpResultCallBack ;
   ULONG_PTR     dwData           ;

   // Your code goes here

   hb_retl( SendMessageCallback( (HWND) hb_parnl( 1 )  ,
                                 (UINT) hb_parni( 2 )  ,
                                 (WPARAM) hb_parnl( 3 ),
                                 (LPARAM) hb_parnl( 4 ),
                                 lpResultCallBack      ,
                                 dwData
                               ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI long WINAPI BroadcastSystemMessageA( IN DWORD, IN LPDWORD, IN UINT, IN WPARAM, IN LPARAM);

/*

HB_FUNC( BROADCASTSYSTEMMESSAGE )
{
   LPDWORD lpdWord ;

   // Your code goes here

   hb_retnl( (LONG) BroadcastSystemMessage( (DWORD) hb_parnl( 1 ) ,
                                            lpdWord               ,
                                            (UINT) hb_parni( 3 )  ,
                                            (WPARAM) hb_parnl( 4 ),
                                            (LPARAM) hb_parnl( 5 )
                                          ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI long WINAPI BroadcastSystemMessage( IN DWORD, IN LPDWORD, IN UINT, IN WPARAM, IN LPARAM);

/*

HB_FUNC( BROADCASTSYSTEMMESSAGE )
{
   LPDWORD lpdWord ;

   // Your code goes here

   hb_retnl( (LONG) BroadcastSystemMessage( (DWORD) hb_parnl( 1 ) ,
                                            lpdWord               ,
                                            (UINT) hb_parni( 3 )  ,
                                            (WPARAM) hb_parnl( 4 ),
                                            (LPARAM) hb_parnl( 5 )
                                          ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationA( IN HANDLE hRecipient, IN LPVOID NotificationFilter, IN DWORD Flags );

_winmsg.c385
HB_FUNCUNREGISTERDEVICENOTIFICATION(void)
HB_FUNC( UNREGISTERDEVICENOTIFICATION )
{
   hb_retl( UnregisterDeviceNotification( (HDEVNOTIFY) hb_parnl( 1 ) ) ) ;
}
_winmsg.c485
HB_FUNCATTACHTHREADINPUT(void)
HB_FUNC( ATTACHTHREADINPUT )
{

   hb_retl( AttachThreadInput( (DWORD) hb_parnl( 1 ) ,
                               (DWORD) hb_parnl( 2 ) ,
                               hb_parl( 3 )
                             ) ) ;
}
_winmsg.c496
HB_FUNCCALLMSGFILTER(void)
HB_FUNC( CALLMSGFILTER )
{
   MSG *Msg = (MSG * ) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value;

   hb_retl( CallMsgFilter( Msg, hb_parni( 2 ) ) ) ;
}
_winmsg.c509
_winpen.c
TypeFunctionSourceLine
HB_FUNCCREATEPEN(void)
HB_FUNC( CREATEPEN )
{
   hb_retnl( (LONG) CreatePen(
               hb_parni( 1 ),   // pen style 
               hb_parni( 2 ),   // pen width  
               (COLORREF) hb_parnl( 3 ) // pen color 
             ) );
}

//-----------------------------------------------------------------------------
// WINGDIAPI HPEN WINAPI CreatePenIndirect( IN CONST LOGPEN *);

/*

HB_FUNC( CREATEPENINDIRECT )
{
   CONST LOGPEN ;

   // Your code goes here

   hb_retnl( (LONG) CreatePenIndirect( &LOGPEN ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI COLORREF WINAPI GetDCPenColor( IN HDC);

// NT ?

/*

HB_FUNC( GETDCPENCOLOR )
{
   hb_retnl( (ULONG) GetDCPenColor( (HDC) hb_parnl( 1 ) ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI COLORREF WINAPI SetDCPenColor(IN HDC, IN COLORREF);

// NT ?

/*

HB_FUNC( SETDCPENCOLOR )
{

   hb_retnl( (ULONG) SetDCPenColor( (HDC) hb_parnl( 1 ), (COLORREF) hb_parnl( 2 ) ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI HPEN WINAPI ExtCreatePen(IN DWORD, IN DWORD, IN CONST LOGBRUSH *, IN DWORD, IN CONST DWORD *);

_winpen.c24
_winprn.c
TypeFunctionSourceLine
HB_FUNCSTARTDOC(void)
HB_FUNC( STARTDOC )
{
   DOCINFO di;
   di.cbSize       = sizeof(DOCINFO);
   di.lpszDocName  = hb_parcx( 2 );
   di.lpszOutput   = (LPTSTR) ( ISNIL( 3 ) ? NULL : hb_parcx( 3 ) ) ;
   di.lpszDatatype = (LPTSTR) ( ISNIL( 4 ) ? NULL : hb_parcx( 4 ) ) ;
   di.fwType       = (DWORD)  ( ISNIL( 5 ) ? 0 : hb_parnl( 5 ) );

   hb_retnl( (LONG) StartDoc( (HDC) hb_parnl( 1 ), &di ) );
}
_winprn.c26
HB_FUNCENDDOC(void)
HB_FUNC( ENDDOC )
{
   hb_retni(EndDoc( (HDC) hb_parnl( 1 ) ) );
}
_winprn.c40
HB_FUNCABORTDOC(void)
HB_FUNC( ABORTDOC )
{
   hb_retni( AbortDoc( (HDC) hb_parnl( 1 ) ) ) ;
}
_winprn.c50
HB_FUNCSTARTPAGE(void)
HB_FUNC( STARTPAGE )
{
   hb_retnl( (LONG) StartPage( (HDC) hb_parnl( 1 ) ) );
}
_winprn.c58
HB_FUNCENDPAGE(void)
HB_FUNC( ENDPAGE )
{
   hb_retnl( (LONG) EndPage( (HDC) hb_parnl( 1 ) ) );
}


//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI Escape( IN HDC, IN int, IN int, IN LPCSTR, OUT LPVOID);

/*

HB_FUNC( ESCAPE )
{
   LPVOID lpVoid ;

   // Your code goes here

   hb_retni( Escape( (HDC) hb_parnl( 1 )  ,
                     hb_parni( 2 )        ,
                     hb_parni( 3 )        ,
                     (LPCSTR) hb_parcx( 4 ),
                     lpVoid
                     ) ) ;
}

*/
//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI ExtEscape( IN HDC, IN int, IN int, IN LPCSTR, IN int, OUT LPSTR);

_winprn.c65
_winrect.c
TypeFunctionSourceLine
HB_FUNCDRAWFOCUSRECT(void)
HB_FUNC( DRAWFOCUSRECT )
{
   RECT lprc ;

   if (ISARRAY(2) && Array2Rect( hb_param( 2 ,HB_IT_ARRAY ) , &lprc ) )   
      hb_retl( DrawFocusRect( (HDC) hb_parnl( 1 ), &lprc ) ) ;   
   else
      hb_retl(FALSE);
}
_winrect.c40
HB_FUNCINTERSECTCLIPRECT(void)
HB_FUNC( INTERSECTCLIPRECT )
{
   hb_retni( IntersectClipRect( (HDC) hb_parnl( 1 ),
                                hb_parni( 2 )      ,
                                hb_parni( 3 )      ,
                                hb_parni( 4 )      ,
                                hb_parni( 5 )      
                                ) ) ;
}

//-----------------------------------------------------------------------------
//WINUSERAPI int WINAPI FillRect( IN HDC hDC, IN CONST RECT *lprc, IN HBRUSH hbr);
//SYNTAX FILLRect(nHdc,aRect,hBrush) -> nil

// ok
/*
HB_FUNC( FILLRECT )
{
   RECT rc;

   if (Array2Rect( hb_param( 2 , HB_IT_ARRAY) , &rc) )
      hb_retni( FillRect(
       (HDC) hb_parnl( 1 ),   // handle to device context 
       &rc, // pointer to structure with rectangle  
       (HBRUSH) hb_parnl( 3 )    // handle to brush 
   ) );
}
*/



//-----------------------------------------------------------------------------
// WINUSERAPI int WINAPI FillRect( IN HDC hDC, IN CONST RECT *lprc, IN HBRUSH hbr);

/* Call as
   Local aSrc := { 11 , 25 , 32 , 18 }
   FILLRECT(nDC,aSrc,hbr)
*/

// rewritten in _WinDraw.c

/*

HB_FUNC( FILLRECT )
{
   RECT   lprc ;
   PHB_ITEM pSrc1;

    if (Array2Rect( hb_param( 2 , HB_IT_ARRAY) , &rc) )
      hb_retni( FillRect( (HDC) hb_parnl( 1 ), &lprc, (HBRUSH) hb_parnl( 3 ) ) ) ;
   }
   else
    hb_retni(0);
}

*/


//-----------------------------------------------------------------------------
// WINUSERAPI int WINAPI FrameRect( IN HDC hDC, IN CONST RECT *lprc, IN HBRUSH hbr);

/* Call as
   Local aSrc := { 11 , 25 , 32 , 18 }
   FRAMERECT(nDC,aSrc,hbr)
*/

// re written in _WinDraw.c

/*
HB_FUNC( FRAMERECT )
{
   RECT   lprc ;

   PHB_ITEM pSrc1;

 if (Array2Rect( hb_param( 2 , HB_IT_ARRAY) , &lprc) )
      hb_retni( FrameRect( (HDC) hb_parnl( 1 ), &lprc, (HBRUSH) hb_parnl( 3 ) ) ) ;
   }
   else
      hb_retni( 0 );
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI InvertRect( IN HDC hDC, IN CONST RECT *lprc);

/* Call as
   Local aSrc := { 11 , 25 , 32 , 18 }
   INVERTRECT(nDC,aSrc,hbr)
*/

// rewritten in _WinDraw.c

/*
HB_FUNC( INVERTRECT )
{
   RECT lprc ;
   PHB_ITEM pSrc1;

 if (Array2Rect( hb_param( 2 , HB_IT_ARRAY) , &lprc) )
    hb_retl( InvertRect( (HDC) hb_parnl( 1 ), &lprc ) ) ;
   }
   else
      hb_retl(FALSE);
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI SetRect( OUT LPRECT lprc, IN int xLeft, IN int yTop, IN int xRight, IN int yBottom);

_winrect.c54
HB_FUNCSETRECT(void)
HB_FUNC( SETRECT )
{
   RECT lprc    ;
 
   if ( SetRect( &lprc         ,
                     hb_parni( 1 ),
                     hb_parni( 2 ),
                     hb_parni( 3 ),
                     hb_parni( 4 )
                   ) ) {
      hb_itemRelease(hb_itemReturn(Rect2Array( &lprc)));
   }
   else
      hb_ret( ) ;      
   
}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI SetRectEmpty( OUT LPRECT lprc);

_winrect.c172
HB_FUNCSETRECTEMPTY(void)
HB_FUNC( SETRECTEMPTY )
{
   RECT lprc ;
   if( SetRectEmpty( &lprc ) ) {
       hb_itemRelease(hb_itemReturn(Rect2Array( &lprc)));
   }
   else
      hb_ret();

}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI CopyRect( OUT LPRECT lprcDst, IN CONST RECT *lprcSrc);

_winrect.c200
HB_FUNCCOPYRECT(void)
HB_FUNC( COPYRECT )
{
   RECT   lprcDst ;
   RECT   lprcSrc ;
   if ( Array2Rect(hb_param( 1, HB_IT_ARRAY ) , &lprcSrc ))
      { 
      if ( CopyRect( &lprcDst, &lprcSrc ) ){
          hb_itemRelease(hb_itemReturn(Rect2Array( &lprcDst)));

      }
      else
         hb_ret();
      }
   else
     hb_ret();

}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI InflateRect( IN OUT LPRECT lprc, IN int dx, IN int dy);
_winrect.c223
HB_FUNCINFLATERECT(void)
HB_FUNC( INFLATERECT )
{
   RECT lprc ;
   PHB_ITEM pArray=hb_param( 1, HB_IT_ARRAY );

   if ( Array2Rect( pArray , &lprc ))
      {
      if ( InflateRect( &lprc, hb_parni( 2 ), hb_parni( 3 ) ) )
{
         Rect2ArrayEx( &lprc,pArray );
         hb_retl( TRUE ) ;
      }
      else
         hb_retl(FALSE);
   }
   else
      hb_retl(FALSE);

}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI IntersectRect( OUT LPRECT lprcDst, IN CONST RECT *lprcSrc1, IN CONST RECT *lprcSrc2);

_winrect.c251
HB_FUNCINTERSECTRECT(void)
HB_FUNC( INTERSECTRECT )
{
   RECT   lprcDst  ;
   RECT   lprcSrc1 ;
   RECT   lprcSrc2 ;

   if ( Array2Rect(hb_param( 1, HB_IT_ARRAY ) , &lprcSrc1 )  && Array2Rect(hb_param( 2, HB_IT_ARRAY ) , &lprcSrc2 ))
   {
      if (IntersectRect( &lprcDst, &lprcSrc1, &lprcSrc2 ) )
        hb_itemRelease(hb_itemReturn(Rect2Array( &lprcDst)));
     else
        hb_ret();

   }
   else
      hb_ret();

}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI UnionRect( OUT LPRECT lprcDst, IN CONST RECT *lprcSrc1, IN CONST RECT *lprcSrc2);

_winrect.c283
HB_FUNCUNIONRECT(void)
HB_FUNC( UNIONRECT )
{
   RECT lprcDst  ;
   RECT   lprcSrc1 ;
   RECT   lprcSrc2 ;


  if ( Array2Rect(hb_param( 1, HB_IT_ARRAY ) , &lprcSrc1 )  && Array2Rect(hb_param( 2, HB_IT_ARRAY ) , &lprcSrc2 ))
   {
      if (UnionRect( &lprcDst, &lprcSrc1, &lprcSrc2 ) )
         {
         hb_itemRelease(hb_itemReturn(Rect2Array( &lprcDst)));
      }
      else
         hb_ret();
   }
   else
      hb_ret();
}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI SubtractRect( OUT LPRECT lprcDst, IN CONST RECT *lprcSrc1, IN CONST RECT *lprcSrc2);

_winrect.c315
HB_FUNCSUBTRACTRECT(void)
HB_FUNC( SUBTRACTRECT )
{
   RECT lprcDst  ;
   RECT   lprcSrc1 ;
   RECT   lprcSrc2 ;

  if ( Array2Rect(hb_param( 1, HB_IT_ARRAY ) , &lprcSrc1 )  && Array2Rect(hb_param( 2, HB_IT_ARRAY ) , &lprcSrc2 ))
   {
      if (SubtractRect( &lprcDst, &lprcSrc1, &lprcSrc2 ))
      {
         hb_itemRelease(hb_itemReturn(Rect2Array(&lprcDst)));

      }
      else
         hb_ret();
   }
   else
      hb_ret();
}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI OffsetRect( IN OUT LPRECT lprc, IN int dx, IN int dy);

_winrect.c348
HB_FUNCOFFSETRECT(void)
HB_FUNC( OFFSETRECT )
{
   RECT lprc ;
   PHB_ITEM pSrc1=hb_param( 1, HB_IT_ARRAY );

   if (ISARRAY(1) && Array2Rect( pSrc1, &lprc))
   {
       if(OffsetRect( &lprc, hb_parni( 2 ), hb_parni( 3 ) ))
         {
           Rect2ArrayEx(&lprc,pSrc1);
           hb_retl(TRUE);
         }
       else
           hb_retl(FALSE);
      }
   else
      hb_retl(FALSE);
}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI IsRectEmpty( IN CONST RECT *lprc);


_winrect.c379
HB_FUNCISRECTEMPTY(void)
HB_FUNC( ISRECTEMPTY )
{
   RECT lprc ;
   PHB_ITEM pSrc1=hb_param( 1, HB_IT_ARRAY );

   if (ISARRAY(1) && Array2Rect( pSrc1, &lprc))
   {
      hb_retl( IsRectEmpty( &lprc ) ) ;
   }
   else
      hb_retl(FALSE);

}
_winrect.c409
HB_FUNCEQUALRECT(void)
HB_FUNC( EQUALRECT )
{
   RECT lprc1 ;
   RECT lprc2 ;
   PHB_ITEM pSrc1=hb_param( 1 ,HB_IT_ARRAY ),pSrc2=hb_param( 2 ,HB_IT_ARRAY );

   if (Array2Rect( pSrc1, &lprc1) && Array2Rect( pSrc2, &lprc2))
   {
      hb_retl( EqualRect( &lprc1, &lprc2 ) ) ;
   }
   else
      hb_retl(FALSE);
}



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI PtInRect( IN CONST RECT *lprc, IN POINT pt);

_winrect.c428
HB_FUNCPTINRECT(void)
HB_FUNC( PTINRECT )
{
   RECT  lprc ;
   POINT pt   ;
   PHB_ITEM pSrc1=hb_param( 1, HB_IT_ARRAY ),pSrc2=hb_param( 2, HB_IT_ARRAY );

   if (Array2Rect( pSrc1, &lprc) && Array2Point( pSrc2, &pt))
   {
      hb_retl( (BOOL) PtInRect( &lprc, pt ) ) ;
   
   }
   else      
      hb_retl( FALSE) ;

}
_winrect.c459
HB_FUNCEXCLUDECLIPRECT(void)
HB_FUNC( EXCLUDECLIPRECT )
{
   hb_retni( ExcludeClipRect( (HDC) hb_parnl( 1 ),
                              hb_parni( 2 )      ,
                              hb_parni( 3 )      ,
                              hb_parni( 4 )      ,
                              hb_parni( 5 )      
                              ) ) ;
}
_winrect.c481
HB_FUNCRECTVISIBLE(void)
HB_FUNC( RECTVISIBLE )
{
   RECT rc;
 
   if ( ISARRAY(2) && Array2Rect( hb_param(2,HB_IT_ARRAY), &rc ))
      hb_retl( RectVisible( (HDC) hb_parnl( 1 ), &rc ) ) ;
   else
      hb_retl(0);

}


//-----------------------------------------------------------------------------
// WINGDIAPI UINT WINAPI GetBoundsRect( IN HDC, OUT LPRECT, IN UINT);

_winrect.c497
HB_FUNCVALIDATERECT(void)
HB_FUNC( VALIDATERECT )
{
   RECT rc ;

   if (ISARRAY( 2 ) && Array2Rect( hb_param( 2, HB_IT_ARRAY ), &rc ) )
      hb_retl( ValidateRect( (HWND) hb_parnl( 1 ), &rc) ) ;
   else
      hb_retl(ValidateRect( (HWND) hb_parnl( 1 ),NULL));
}
_winrect.c528
_winreg.c
TypeFunctionSourceLine
HB_FUNCREGCLOSEKEY(void)
HB_FUNC( REGCLOSEKEY )
{

   HKEY hwHandle = ( HKEY ) hb_parnl( 1 );

   if ( RegCloseKey( hwHandle ) == ERROR_SUCCESS )
      {
         hb_retnl( ERROR_SUCCESS );
      }

   else
      {
         hb_retnl( -1 );
      }

}
_winreg.c69
HB_FUNCREGOPENKEYEX(void)
HB_FUNC( REGOPENKEYEX )
{

   HKEY hwKey = ( ( HKEY ) hb_parnl( 1 ) );
   LPCTSTR lpValue=hb_parcx( 2 );
   LONG lError;
   HKEY phwHandle;

   lError = RegOpenKeyExA( ( HKEY ) hwKey , lpValue , 0 , KEY_ALL_ACCESS , &phwHandle );

   if ( lError > 0 )
      {
         hb_retnl( -1 );
      }

   else
      {
         hb_stornl( PtrToLong( phwHandle ) , 5 );
         hb_retnl( 0 );
      }
}
_winreg.c86
HB_FUNCREGQUERYVALUEEX(void)
HB_FUNC( REGQUERYVALUEEX )
{
   LONG lError;
   DWORD lpType=hb_parnl( 4 );

   DWORD lpcbData=0;
   lError=RegQueryValueExA( ( HKEY ) hb_parnl( 1 ) , ( LPTSTR ) hb_parcx( 2 ) , NULL , &lpType , NULL , &lpcbData );

   if ( lError == ERROR_SUCCESS )
   {
      BYTE *lpData;
      lpData=(BYTE*)malloc( ( int ) lpcbData+1 );
      lError= RegQueryValueExA( ( HKEY ) hb_parnl( 1 ) , ( LPTSTR ) hb_parcx( 2 ) , NULL , &lpType , ( BYTE* ) lpData , &lpcbData );

      if ( lError > 0 )
      {
         hb_retnl( -1 );
      }
      else
      {
         hb_storc( ( char *)lpData , 5 );
         hb_retnl( 0 );
      }

      free( ( BYTE* ) lpData );
   }

}
_winreg.c108
HB_FUNCREGENUMKEYEX(void)
HB_FUNC( REGENUMKEYEX )
{

   FILETIME ft;
   long bErr;
   TCHAR Buffer[255];
   DWORD dwBuffSize = 255;
   TCHAR Class[255];
   DWORD dwClass = 255;

    bErr = RegEnumKeyEx( ( HKEY ) hb_parnl( 1 ) , hb_parnl( 2 ) , Buffer , &dwBuffSize , NULL , Class , &dwClass , &ft );

    if ( bErr != ERROR_SUCCESS )
      {
         hb_retnl( bErr );
      }
    else
      {
         hb_storc( Buffer , 3 );
         hb_stornl( ( long ) dwBuffSize , 4 );
         hb_storc( Class , 6 );
         hb_stornl( ( long ) dwClass , 7 );

         hb_retnl( ERROR_SUCCESS );
      }
}
_winreg.c138
HB_FUNCREGSETVALUEEX(void)
HB_FUNC( REGSETVALUEEX )
{

   hb_retnl( RegSetValueExA( ( HKEY ) hb_parnl( 1 ), hb_parcx( 2 ), 0, hb_parnl( 4 ), ( BYTE * const ) hb_parcx( 5 ), ( strlen( hb_parcx( 5 ) ) + 1 ) ) ) ;

}
_winreg.c166
HB_FUNCREGCREATEKEY(void)
HB_FUNC( REGCREATEKEY )
{
   HKEY hKey;
   LONG nErr;

   nErr = RegCreateKey( ( HKEY ) hb_parnl( 1 ) , hb_parcx( 2 ) , &hKey );
   if ( nErr == ERROR_SUCCESS )
   {
      hb_stornl( PtrToLong( hKey ) , 3 );
   }
   hb_retnl( nErr );

}

//-------------------------------------------------------
_winreg.c173
HB_FUNCREGCREATEKEYEX(void)
HB_FUNC( REGCREATEKEYEX )
{

  HKEY hkResult ;
  DWORD dwDisposition ;
  LONG nErr ;
  SECURITY_ATTRIBUTES *sa = NULL;

  if (ISCHAR(7))
       sa = (SECURITY_ATTRIBUTES *) hb_parc( 7 ); //hb_param(7, HB_IT_STRING)->item.asString.value;

  nErr = RegCreateKeyEx( (HKEY)    hb_parnl( 1 ) ,
                         (LPCSTR)  hb_parcx( 2 )  ,
                         (DWORD)   0             ,
                         (LPSTR)   hb_parcx( 4 )  ,
                         (DWORD)   hb_parnl( 5 ) ,
                         (DWORD)   hb_parnl( 6 ) ,
                         sa                      ,
                         &hkResult               ,
                         &dwDisposition )        ;

  if ( nErr == ERROR_SUCCESS )
  {
    hb_stornl( (LONG) hkResult, 8 ) ;
    hb_stornl( (LONG) dwDisposition, 9 ) ;
  }
  hb_retnl( nErr ) ;

}
_winreg.c204
HB_FUNCREGDELETEKEY(void)
HB_FUNC( REGDELETEKEY )
{

   if ( RegDeleteKeyA( ( HKEY ) hb_parnl( 1 ), ( LPCTSTR ) hb_parcx( 2 ) ) == ERROR_SUCCESS )
     {
        hb_retnl( 0 );
     }
     else
     {
        hb_retnl( -1 );
     }
}
_winreg.c235
HB_FUNCREGDELETEVALUE(void)
HB_FUNC( REGDELETEVALUE )
{
   if ( RegDeleteValue( ( HKEY ) hb_parnl( 1 ), hb_parcx( 2 ) ) == ERROR_SUCCESS )
     {
        hb_retnl( 0 );
     }
     else
     {
        hb_retnl( -1 );
     }
}
_winreg.c251
_winrgn.c
TypeFunctionSourceLine
HB_FUNCCREATEELLIPTICRGN(void)
HB_FUNC( CREATEELLIPTICRGN )
{
   hb_retnl( (LONG) CreateEllipticRgn( hb_parni( 1 ),
                                       hb_parni( 2 ),
                                       hb_parni( 3 ),
                                       hb_parni( 4 )
                                       ) ) ;
}
_winrgn.c27
HB_FUNCCREATEELLIPTICRGNINDIRECT(void)
HB_FUNC( CREATEELLIPTICRGNINDIRECT )
{
   RECT rc;

   if (ISARRAY( 1 ) && Array2Rect( hb_param( 1, HB_IT_ARRAY ), &rc ) )
      hb_retnl( (LONG) CreateEllipticRgnIndirect( &rc ) ) ;
   else
      hb_retnl( 0 ) ;
}
_winrgn.c42
HB_FUNCFILLRGN(void)
HB_FUNC( FILLRGN )
{
   hb_retl( FillRgn( (HDC) hb_parnl( 1 )   ,
                     (HRGN) hb_parnl( 2 )  ,
                     (HBRUSH) hb_parnl( 3 )
                     ) ) ;
}
_winrgn.c56
HB_FUNCCREATEPOLYGONRGN(void)
HB_FUNC( CREATEPOLYGONRGN )
{
   POINT * Point ;
   POINT pt ;
   int iCount ;
   int i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 1 ) )
   {
       iCount = (int) hb_parinfa( 1, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(1,HB_IT_ARRAY);
       
       for ( i = 0 ; i
_winrgn.c70
HB_FUNCCREATEPOLYPOLYGONRGN(void)
HB_FUNC( CREATEPOLYPOLYGONRGN )
{
   POINT * Point ;
   INT * PolyPoints ;
   int iPolyCount ;
   int iCount ;
   POINT pt ;
   int i ;
   PHB_ITEM aParam ;
   PHB_ITEM aSub ;

   if (ISARRAY( 1 ) && ISARRAY( 2 ) )
   {
       iPolyCount = hb_parinfa(2,0) ;
       PolyPoints = ( INT *) hb_xgrab( iPolyCount * sizeof( INT ) ) ;

       for ( i=0 ; i < iPolyCount ; i++ )
       {
          *(PolyPoints+i) = hb_parni( 2,i+1) ;
       }

       iCount = hb_parinfa( 1, 0 ) ;
       Point = (POINT *) hb_xgrab( iCount * sizeof (POINT) ) ;
       aParam = hb_param(1,HB_IT_ARRAY);
       
       for ( i = 0 ; i
_winrgn.c113
HB_FUNCCREATERECTRGN(void)
HB_FUNC( CREATERECTRGN )
{
   hb_retnl( (LONG) CreateRectRgn( hb_parni( 1 ),
                                   hb_parni( 2 ),
                                   hb_parni( 3 ),
                                   hb_parni( 4 )
                                   ) ) ;
}
_winrgn.c170
HB_FUNCCREATERECTRGNINDIRECT(void)
HB_FUNC( CREATERECTRGNINDIRECT )
{

   RECT rc;

   if (ISARRAY( 1 ) && Array2Rect( hb_param( 1, HB_IT_ARRAY ), &rc ) )
      hb_retnl( (LONG) CreateRectRgnIndirect( &rc ) ) ;
   else
      hb_retnl( 0 ) ;
}
_winrgn.c185
HB_FUNCCREATEROUNDRECTRGN(void)
HB_FUNC( CREATEROUNDRECTRGN )
{
   hb_retnl( (LONG) CreateRoundRectRgn( hb_parni( 1 ),
                                        hb_parni( 2 ),
                                        hb_parni( 3 ),
                                        hb_parni( 4 ),
                                        hb_parni( 5 ),
                                        hb_parni( 6 )
                                        ) ) ;
}
_winrgn.c202
HB_FUNCCOMBINERGN(void)
HB_FUNC( COMBINERGN )
{
    hb_retni( CombineRgn( (HRGN) hb_parnl(1), (HRGN) hb_parnl(2),
                          (HRGN) hb_parnl(3), hb_parni(4) ) ) ;

}
_winrgn.c221
HB_FUNCGETREGIONDATA(void)
HB_FUNC( GETREGIONDATA )
{
   RGNDATA *RgnData ;
   DWORD nBytes = GetRegionData( (HRGN) hb_parnl( 1 ) , 0, NULL ) ;
   DWORD nRet ;

   if ( nBytes )
   {
     RgnData = (RGNDATA *) hb_xgrab( nBytes ) ;
     nRet = GetRegionData( (HRGN) hb_parnl( 1 ) ,
                             nBytes             ,
                             RgnData
                         ) ;
     if ( nRet == 1 )
         hb_retclen( ( char *) RgnData,nBytes ) ;

     hb_xfree( RgnData) ;
   }

}
_winrgn.c236
HB_FUNCEXTSELECTCLIPRGN(void)
HB_FUNC( EXTSELECTCLIPRGN )
{
   hb_retni( ExtSelectClipRgn( (HDC) hb_parnl( 1 ) ,
                               (HRGN) hb_parnl( 2 ),
                               hb_parni( 3 )       
                               ) ) ;
}
_winrgn.c262
HB_FUNCRECTINREGION(void)
HB_FUNC( RECTINREGION )
{
    RECT rc;

   if (ISARRAY( 2 ) && Array2Rect( hb_param( 2, HB_IT_ARRAY ), &rc ) )
      hb_retl( RectInRegion( (HRGN) hb_parnl( 1 ), &rc ) ) ;
}
_winrgn.c276
HB_FUNCGETRANDOMRGN(void)
HB_FUNC( GETRANDOMRGN )
{
   hb_retni( GetRandomRgn( (HDC) hb_parnl( 1 ) ,
                           (HRGN) hb_parnl( 2 ),
                           hb_parni( 3 )       
                           ) ) ;
}
_winrgn.c289
HB_FUNCGETCLIPRGN(void)
HB_FUNC( GETCLIPRGN )
{
   hb_retni( GetClipRgn( (HDC) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winrgn.c302
HB_FUNCFRAMERGN(void)
HB_FUNC( FRAMERGN )
{
   hb_retl( FrameRgn( (HDC) hb_parnl( 1 )   ,
                      (HRGN) hb_parnl( 2 )  ,
                      (HBRUSH) hb_parnl( 3 ),
                      hb_parni( 4 )         ,
                      hb_parni( 5 )         
                      ) ) ;
}
_winrgn.c312
HB_FUNCEQUALRGN(void)
HB_FUNC( EQUALRGN )
{
   hb_retl( EqualRgn( (HRGN) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}

_winrgn.c326
HB_FUNCINVALIDATERGN(void)
HB_FUNC( INVALIDATERGN )
{
   hb_retl( InvalidateRgn( (HWND) hb_parnl( 1 ),
                           (HRGN) hb_parnl( 2 ),
                           hb_parl( 3 )        
                         ) ) ;
}
_winrgn.c355
HB_FUNCVALIDATERGN(void)
HB_FUNC( VALIDATERGN )
{
   hb_retl( ValidateRgn( (HWND) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winrgn.c367
HB_FUNCINVERTRGN(void)
HB_FUNC( INVERTRGN )
{
   hb_retl( InvertRgn( (HDC) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winrgn.c376
HB_FUNCOFFSETCLIPRGN(void)
HB_FUNC( OFFSETCLIPRGN )
{
   hb_retni( OffsetClipRgn( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_winrgn.c385
HB_FUNCOFFSETRGN(void)
HB_FUNC( OFFSETRGN )
{
   hb_retni( OffsetRgn( (HRGN) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_winrgn.c394
HB_FUNCPAINTRGN(void)
HB_FUNC( PAINTRGN )
{
   hb_retl( PaintRgn( (HDC) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winrgn.c403
HB_FUNCPATHTOREGION(void)
HB_FUNC( PATHTOREGION )
{
   hb_retnl( (LONG) PathToRegion( (HDC) hb_parnl( 1 ) ) ) ;
}
_winrgn.c412
HB_FUNCPTINREGION(void)
HB_FUNC( PTINREGION )
{
   hb_retl( PtInRegion( (HRGN) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_winrgn.c421
HB_FUNCSELECTCLIPRGN(void)
HB_FUNC( SELECTCLIPRGN )
{
   hb_retni( SelectClipRgn( (HDC) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winrgn.c432
HB_FUNCSETRECTRGN(void)
HB_FUNC( SETRECTRGN )
{
   hb_retl( SetRectRgn( (HRGN) hb_parnl( 1 ),
                        hb_parni( 2 )       ,
                        hb_parni( 3 )       ,
                        hb_parni( 4 )       ,
                        hb_parni( 5 )       
                        ) ) ;
}
_winrgn.c441
HB_FUNCGETUPDATERGN(void)
HB_FUNC( GETUPDATERGN )
{
   hb_retni( GetUpdateRgn( (HWND) hb_parnl( 1 ),
                           (HRGN) hb_parnl( 2 ),
                           hb_parl( 3 )        
                         ) ) ;
}
_winrgn.c456
HB_FUNCEXCLUDEUPDATERGN(void)
HB_FUNC( EXCLUDEUPDATERGN )
{
   hb_retni( ExcludeUpdateRgn( (HDC) hb_parnl( 1 ), (HWND) hb_parnl( 2 ) ) ) ;
}



//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI GetRgnBox( IN HRGN, OUT LPRECT);


// Syntax
// GetRgnBox(hRgn,@aRect) -> nType, or NIL


/*
       
HB_FUNC( GETRGNBOX )
{
   RECT *rc ;


   hb_retni( GetRgnBox( (HRGN) hb_parnl( 1 ), lpRect ) ) ;

}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI HRGN WINAPI ExtCreateRegion( IN CONST XFORM *, IN DWORD, IN CONST RGNDATA *);

_winrgn.c468
_winscrlb.c
TypeFunctionSourceLine
HB_FUNCSETSCROLLPOS(void)
HB_FUNC( SETSCROLLPOS )
{
   hb_retni( SetScrollPos( (HWND) hb_parnl( 1 ),
                           hb_parni( 2 )       ,
                           hb_parni( 3 )       ,
                           hb_parl( 4 )
                         ) ) ;
}
_winscrlb.c18
HB_FUNCGETSCROLLPOS(void)
HB_FUNC( GETSCROLLPOS )
{
   hb_retni( GetScrollPos( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winscrlb.c31
HB_FUNCSETSCROLLRANGE(void)
HB_FUNC( SETSCROLLRANGE )
{
   hb_retl( SetScrollRange( (HWND) hb_parnl( 1 ),
                            hb_parni( 2 )       ,
                            hb_parni( 3 )       ,
                            hb_parni( 4 )       ,
                            hb_parl( 5 )
                          ) ) ;
}
_winscrlb.c40
HB_FUNCGETSCROLLRANGE(void)
HB_FUNC( GETSCROLLRANGE )
{
   LPINT lpMinPos = 0 ;
   LPINT lpMaxPos = 0 ;

   if ( GetScrollRange( (HWND) hb_parnl( 1 ), hb_parni( 2 ), lpMinPos, lpMaxPos ) )
   {
      if ( ISBYREF(3) && ISBYREF(4) )
      {
         hb_storni(3,*lpMinPos) ;
         hb_storni(4,*lpMaxPos) ;
         hb_retl(1) ;
      }
      else
        hb_retl(0);
   }
   else
     hb_retl(0) ;

}
_winscrlb.c57
HB_FUNCSHOWSCROLLBAR(void)
HB_FUNC( SHOWSCROLLBAR )
{
   hb_retl( ShowScrollBar( (HWND) hb_parnl( 1 ), hb_parni( 2 ), hb_parl( 3 ) ) ) ;
}
_winscrlb.c83
HB_FUNCENABLESCROLLBAR(void)
HB_FUNC( ENABLESCROLLBAR )
{
   hb_retl( EnableScrollBar( (HWND) hb_parnl( 1 ),
                             (UINT) hb_parni( 2 ),
                             (UINT) hb_parni( 3 )
                           ) ) ;
}
_winscrlb.c92
HB_FUNCSETSCROLLINFO(void)
HB_FUNC( SETSCROLLINFO )
{
   SCROLLINFO * scrollInfo =  (SCROLLINFO * ) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING )->item.asString.value;

   hb_retni( SetScrollInfo( (HWND) hb_parnl( 1 ),
                            hb_parni( 2 )       ,
                            scrollInfo          ,
                            hb_parl( 4 )
                          ) ) ;
}
_winscrlb.c107
HB_FUNCGETSCROLLINFO(void)
HB_FUNC( GETSCROLLINFO )
{
   SCROLLINFO si ;
   si.cbSize = sizeof(SCROLLINFO) ;
   si.fMask  = SIF_ALL ;

   if ( GetScrollInfo( (HWND) hb_parnl( 1 ), hb_parni( 2 ), &si ) )
      hb_retclen( (char *) &si, sizeof( SCROLLINFO ) );

      // problem
      //hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) &si, sizeof( SCROLLINFO ) );

}
_winscrlb.c125
HB_FUNCGETSCROLLBARINFO(void)
HB_FUNC( GETSCROLLBARINFO )
{
   SCROLLBARINFO sbi     ;

   if ( GetScrollBarInfo( (HWND) hb_parnl( 1 ), hb_parnl( 2 ), &sbi ) )
       hb_retclen( (char *) &sbi, sizeof( SCROLLBARINFO ) );

     // problem
     // hb_itemPutCRaw( hb_param( -1, HB_IT_ANY ), (char *) &sbi, sizeof( SCROLLBARINFO ) );
}
_winscrlb.c148
_winserial.c
TypeFunctionSourceLine
HB_FUNCBUILDCOMMDCB(void)
BuildComm( cComParam, @dcbInfo )
dcb:buffer( dcbInfo )
*/
HB_FUNC( BUILDCOMMDCB )
{
   DCB dcb ;

   hb_retl( BuildCommDCB( ( LPCTSTR ) hb_parcx( 1 ), &dcb ) );

   hb_storclen( ( char * ) &dcb, sizeof( DCB ), 2 ) ;
}

//-------------------------------------------------------------------//
/*
BOOL BuildCommDCBAndTimeouts(
  LPCTSTR         lpDef,          // device-control string           IN
  LPDCB           lpDCB,          // device-control block           OUT
  LPCOMMTIMEOUTS  lpCommTimeouts  // device time-out values          IN
);
local dcb IS DCB
local CommTimeOuts IS COMMTIMEOUTS
local dcbInfo := dcb:value
local cComParam := 'COM1: baud=9600 parity=N data=8 stop=1 to=ON'
_winserial.c38
HB_FUNCBUILDCOMMDCBANDTIMEOUTS(void)
BuildComDCBAndTimeouts( cCommParam, @dcbInfo, CommTimeOuts:value )
dcb:buffer( dcbInfo )
*/
//
HB_FUNC( BUILDCOMMDCBANDTIMEOUTS )
{
   DCB dcb ;
   LPCOMMTIMEOUTS lptimeouts = ( LPCOMMTIMEOUTS ) hb_parcx( 3 );
   hb_retl( BuildCommDCBAndTimeouts( ( LPCTSTR ) hb_parcx( 1 ), &dcb, lptimeouts ) ) ;

   hb_storclen( ( char * ) &dcb, sizeof( DCB ), 2 ) ;
}
_winserial.c62
HB_FUNCCLEARCOMMBREAK(void)
HB_FUNC( CLEARCOMMBREAK )
{
   hb_retl( ClearCommBreak( ( HANDLE ) hb_parnl( 1 ) ) );
}
_winserial.c75
HB_FUNCCLEARCOMMERROR(void)
HB_FUNC( CLEARCOMMERROR )
{
   DWORD   err = 0 ;
   COMSTAT Stat ;

   hb_retl( ClearCommError( ( HANDLE ) hb_parnl( 1 ), &err, &Stat ) );

   hb_stornl( err, 2 );
   hb_storclen( ( char * ) &Stat, sizeof( COMSTAT ), 3 ) ;
}

//-------------------------------------------------------------------//
/*
BOOL CommConfigDialog(
  LPCTSTR lpszName,   // device name string                          IN
  HWND hWnd,          // handle to window                            IN
  LPCOMMCONFIG lpCC   // configuration information               IN/OUT
);
local cDeviceName := 'Standard Modem over IR link #4'
local hWnd        := nil
local CommConfig IS COMMCONFIG
local cCommConfig := CommConfig:value
_winserial.c91
HB_FUNCCOMMCONFIGDIALOG(void)
if CommConfigDialog( cDeviceName, hWnd, @cCommConfig )
   ? 'Hurray'
   CommConfig:buffer( cCommConfig )
endif
*/
HB_FUNC( COMMCONFIGDIALOG )
{
   LPCTSTR      lpszName = ( LPCTSTR ) hb_parcx( 1 );
   HWND         hwnd     = ISNIL( 2 ) ? NULL : ( HWND ) hb_parnl( 2 );
   LPCOMMCONFIG lpCC     = ( LPCOMMCONFIG ) hb_parcx( 3 ) ;

   hb_retl( CommConfigDialog( lpszName, hwnd, lpCC ) );

   hb_storclen( ( char * ) lpCC, sizeof( COMMCONFIG ), 3 ) ;
}

//-------------------------------------------------------------------//
/*
BOOL EscapeCommFunction(
  HANDLE hFile,   // handle to communications device                 IN
  DWORD  dwFunc   // extended function to perform                    IN
);
local nFunc := CLRDTR  // CLRRTS, SETDTR, SETRTS, SETXOFF, SETXON, SETBREAK, CLRBREAK - one of these values
_winserial.c125
HB_FUNCESCAPECOMMFUNCTION(void)
if EscapeCommFunction( hFile, nFunc )
   // ok
endif
*/
HB_FUNC( ESCAPECOMMFUNCTION )
{
   hb_retl( EscapeCommFunction( ( HANDLE ) hb_parnl( 1 ), hb_parnl( 2 ) ) );
}
_winserial.c149
HB_FUNCGETCOMMCONFIG(void)
HB_FUNC( GETCOMMCONFIG )
{
   COMMCONFIG lpCC ; // = ( LPCOMMCONFIG ) hb_parcx( 2 );
   DWORD        size = sizeof( COMMCONFIG );

   hb_retl( GetCommConfig( ( HANDLE ) hb_parnl( 1 ), &lpCC, &size ) ) ;

   hb_storclen( ( char * ) &lpCC, size, 2 ) ;
}
_winserial.c158
HB_FUNCGETCOMMMASK(void)
HB_FUNC( GETCOMMMASK )
{
   DWORD mask;
   hb_retl( GetCommMask( ( HANDLE ) hb_parnl( 1 ), &mask ) ) ;
   hb_stornl( ( ULONG ) mask, 2 ) ;
}
_winserial.c179
HB_FUNCGETCOMMMODEMSTATUS(void)
HB_FUNC( GETCOMMMODEMSTATUS )
{
   DWORD modemStat ;
   hb_retl( GetCommModemStatus( ( HANDLE ) hb_parnl( 1 ), &modemStat ) ) ;
   hb_stornl( ( ULONG ) modemStat, 2 ) ;
}
_winserial.c197
HB_FUNCGETCOMMPROPERTIES(void)
HB_FUNC( GETCOMMPROPERTIES )
{
   COMMPROP CommProp ;
   CommProp.wPacketLength = sizeof( COMMPROP );

   hb_retl( GetCommProperties( ( HANDLE ) hb_parnl( 1 ), &CommProp ) );

   hb_storclen( ( char * ) &CommProp, sizeof( COMMPROP ), 2 ) ;
}
_winserial.c215
HB_FUNCGETCOMMSTATE(void)
HB_FUNC( GETCOMMSTATE )
{
   DCB dcb ;
   dcb.DCBlength = sizeof( DCB ) ;

   hb_retl( GetCommState( ( HANDLE ) hb_parnl( 1 ), &dcb ) );

   hb_storclen( ( char * ) &dcb, sizeof( DCB ), 2 ) ;
}
_winserial.c236
HB_FUNCGETCOMMTIMEOUTS(void)
HB_FUNC( GETCOMMTIMEOUTS )
{
   COMMTIMEOUTS Timeouts ;

   hb_retl( GetCommTimeouts( ( HANDLE ) hb_parnl( 1 ), &Timeouts ) );

   hb_storclen( ( char * ) &Timeouts, sizeof( COMMTIMEOUTS ), 2 ) ;
}
_winserial.c255
HB_FUNCGETDEFAULTCOMMCONFIG(void)
HB_FUNC( GETDEFAULTCOMMCONFIG )
{
   char * Buffer = (char *) hb_xgrab( sizeof( COMMCONFIG ) );
   DWORD size = sizeof( COMMCONFIG );

   if ( GetDefaultCommConfig( ( LPCTSTR ) hb_parcx( 1 ), ( COMMCONFIG * ) Buffer, &size ) == 0 )
   {
      hb_xfree( Buffer ) ;
      Buffer = (char *) hb_xgrab( size ) ;
      if ( GetDefaultCommConfig( ( LPCTSTR ) hb_parcx( 1 ), ( COMMCONFIG * ) Buffer, &size ) == 0 )
      {
         hb_xfree( Buffer ) ;
         hb_retl( FALSE ) ;
         return ;
      }
   }
   hb_retl( TRUE );
   hb_storclen( ( char * ) Buffer, size, 2 ) ;
   hb_xfree( Buffer );
}
_winserial.c273
HB_FUNCPURGECOMM(void)
HB_FUNC( PURGECOMM )
{
   hb_retl( PurgeComm( ( HANDLE ) hb_parnl( 1 ), hb_parnl( 2 ) ) ) ;
}
_winserial.c303
HB_FUNCSETCOMMBREAK(void)
HB_FUNC( SETCOMMBREAK )
{
   hb_retl( SetCommBreak( ( HANDLE ) hb_parnl( 1 ) ) );
}
_winserial.c318
HB_FUNCSETCOMMCONFIG(void)
HB_FUNC( SETCOMMCONFIG )
{
   LPCOMMCONFIG lpCC = ( LPCOMMCONFIG ) hb_parcx( 2 );
   DWORD        size = ISNIL( 3 ) ? sizeof( COMMCONFIG ) : hb_parnl( 3 );

   hb_retl( SetCommConfig( ( HANDLE ) hb_parnl( 1 ), lpCC, size ) );
}
_winserial.c329
HB_FUNCSETCOMMMASK(void)
HB_FUNC( SETCOMMMASK )
{
   hb_retl( SetCommMask( ( HANDLE ) hb_parnl( 1 ), hb_parnl( 2 ) ) );
}
_winserial.c346
HB_FUNCSETCOMMSTATE(void)
HB_FUNC( SETCOMMSTATE )
{
   LPDCB lpDCB = ( LPDCB ) hb_parcx( 2 );

   hb_retl( SetCommState( ( HANDLE ) hb_parnl( 1 ), lpDCB ) ) ;
}
_winserial.c360
HB_FUNCSETCOMMTIMEOUTS(void)
HB_FUNC( SETCOMMTIMEOUTS )
{
   LPCOMMTIMEOUTS lptimeouts = ( LPCOMMTIMEOUTS ) hb_parcx( 2 ) ;

   hb_retl( SetCommTimeouts( ( HANDLE ) hb_parnl( 1 ), lptimeouts ) );
}
_winserial.c374
HB_FUNCSETDEFAULTCOMMCONFIG(void)
HB_FUNC( SETDEFAULTCOMMCONFIG )
{
   LPCOMMCONFIG lpCC = ( LPCOMMCONFIG ) hb_parcx( 2 );
   DWORD        size = sizeof( COMMCONFIG ) ;

   hb_retl( SetDefaultCommConfig( ( LPCTSTR ) hb_parcx( 1 ), lpCC, size ) );
}
_winserial.c388
HB_FUNCSETUPCOMM(void)
HB_FUNC( SETUPCOMM )
{
   hb_retl( SetupComm( ( HANDLE ) hb_parnl( 1 ), hb_parnl( 2 ), hb_parnl( 3 ) ) );
}
_winserial.c404
HB_FUNCTRANSMITCOMMCHAR(void)
HB_FUNC( TRANSMITCOMMCHAR )
{
   hb_retl( TransmitCommChar( ( HANDLE ) hb_parnl( 1 ), ( char ) hb_parni( 2 ) ) );
}
_winserial.c417
HB_FUNCWAITCOMMEVENT(void)
HB_FUNC( WAITCOMMEVENT )
{
   DWORD evMask ;

   hb_retl( WaitCommEvent( ( HANDLE ) hb_parnl( 1 ), &evMask, NULL ) );
   hb_stornl( ( ULONG ) evMask, 2 ) ;
}
_winserial.c429
_winshell.c
TypeFunctionSourceLine
HB_FUNCDRAGQUERYFILE(void)
HB_FUNC( DRAGQUERYFILE )
{

  char *cFile ;
  UINT iRet   ;

  if ( hb_parni( 4 ) > 0  )
    cFile = (char*) hb_xgrab( hb_parni(4) + 1 );
  else
    cFile = (char*) hb_xgrab( strlen( hb_parcx(3) ) + 1 );


  iRet = DragQueryFile( (HDROP) hb_parnl( 1 ),
                        (UINT) hb_parni( 2 ) ,
                        hb_parni(4) > 0 ? cFile : NULL ,
                        (UINT) hb_parni( 4 )
                      ) ;

   if (hb_parni( 4 ) > 0)
   {
      hb_storclen( cFile, iRet, 3 ) ;
      hb_xfree( cFile );
   }
   hb_retni( iRet ) ;
 }
_winshell.c24
HB_FUNCDRAGQUERYPOINT(void)
HB_FUNC( DRAGQUERYPOINT )
{
   POINT lpPoInt ;
   BOOL lRet ;
   lRet = DragQueryPoint( (HDROP) hb_parnl( 1 ),(LPPOINT) &lpPoInt )  ;
   if (ISBYREF( 2 ) ){
      hb_stornl(2,lpPoInt.x,1);
      hb_stornl(2,lpPoInt.y,2);
   }
   hb_retl( lRet ) ;

}
_winshell.c55
HB_FUNCDRAGFINISH(void)
HB_FUNC( DRAGFINISH )
{
   DragFinish( (HDROP) hb_parnl( 1 ) ) ;
}
_winshell.c73
HB_FUNCDRAGACCEPTFILES(void)
HB_FUNC( DRAGACCEPTFILES )
{
   DragAcceptFiles( (HWND) hb_parnl( 1 ), hb_parl( 2 ) ) ;
}
_winshell.c82
HB_FUNCSHELLEXECUTE(void)
HB_FUNC( SHELLEXECUTE )
{
   hb_retnl( (LONG) ShellExecute( (HWND) hb_parnl( 1 )     ,
                                  (LPCSTR) hb_parcx( 2 )    ,
                                  (LPCSTR) hb_parcx( 3 )    ,
                                  ISNIL(4) ? NULL : (LPCSTR) hb_parcx( 4 )    ,
                                  (LPCSTR) hb_parcx( 5 )    ,
                                   hb_parni( 6 )
                                 ) ) ;
}
_winshell.c91
HB_FUNCFINDEXECUTABLE(void)
HB_FUNC( FINDEXECUTABLE )
{

  char cBuffer[MAX_PATH];
  HINSTANCE hInst ;


   hInst = FindExecutable( (LPCSTR) hb_parcx( 1 )    ,
                           (LPCSTR) hb_parcx( 2 )    ,
                           (LPSTR)  cBuffer
                         ) ;

   hb_retnl( (LONG) hInst) ;

   if ( (LONG) hInst > 32 )
      hb_storc( cBuffer, 3 ) ;
}


//-----------------------------------------------------------------------------
// SHSTDAPI_(LPWSTR *) CommandLineToArgvW(LPCWSTR lpCmdLine, int*pNumArgs);

// no info

_winshell.c105
HB_FUNCSHELLABOUT(void)
HB_FUNC( SHELLABOUT )
{
   hb_retni( ShellAbout( (HWND) hb_parnl(1),
                         (LPCSTR) hb_parcx(2),
                         (LPCSTR) hb_parcx(3),
                         (ISNIL(4) ? NULL : (HICON) hb_parnl(4) )
                       ) );
}


//-----------------------------------------------------------------------------
// SHSTDAPI_(UINT) SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);

_winshell.c147
HB_FUNCDOENVIRONMENTSUBST(void)
HB_FUNC( DOENVIRONMENTSUBST )
{
   hb_retnl((LONG) DoEnvironmentSubst( (LPSTR) hb_parcx( 1 ) ,
                                       (UINT) hb_parni( 2 )
                                     ) ) ;
}
#endif
//-----------------------------------------------------------------------------
// SHSTDAPI_(UINT) ExtractIconExA(LPCSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);

_winshell.c177
HB_FUNCSHFILEOPERATION(void)
HB_FUNC( SHFILEOPERATION )
{
   SHFILEOPSTRUCT *sfo = (SHFILEOPSTRUCT *) hb_parc( 1 ); //hb_param(1, HB_IT_STRING)->item.asString.value;
   hb_retni( SHFileOperation( sfo ) ) ;
}
_winshell.c211
HB_FUNCSHFREENAMEMAPPINGS(void)
HB_FUNC( SHFREENAMEMAPPINGS )
{
   SHFreeNameMappings( (HANDLE) hb_parnl( 1 ) ) ;
}
_winshell.c220
HB_FUNCSHELLEXECUTEEX(void)
HB_FUNC( SHELLEXECUTEEX )
{
   SHELLEXECUTEINFO *ExecInfo = (SHELLEXECUTEINFO *) hb_parc( 1 ); //hb_param(1, HB_IT_STRING)->item.asString.value;
   hb_retl( ShellExecuteEx( ExecInfo ) ) ;
}



//-----------------------------------------------------------------------------
// SHSTDAPI_(void) WinExecErrorA(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
/*


// NT only ?
// ????

HB_FUNC( WINEXECERROR )
{
   WinExecError( (HWND) hb_parnl( 1 ) ,
                 hb_parni( 2 )        ,
                 (LPCSTR) hb_parcx( 3 ),
                 (LPCSTR) hb_parcx( 4 )
                  ) ;
}

*/

//-----------------------------------------------------------------------------
// SHSTDAPI_(BOOL) SHCreateProcessAsUserW(PSHCREATEPROCESSINFOW pscpi);

/*
HB_FUNC( SHCREATEPROCESSASUSERW )
{
   PSHCREATEPROCESSINFOW pscpi ;

   // Your code goes here

   hb_retl( SHCreateProcessAsUserW( pscpi ) ) ;
}

*/

//-----------------------------------------------------------------------------
// SHSTDAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo);

_winshell.c230
HB_FUNCSHEMPTYRECYCLEBIN(void)
HB_FUNC( SHEMPTYRECYCLEBIN )
{
   hb_retnl(  SHEmptyRecycleBin( (HWND) hb_parnl( 1 ) ,
                                 (LPCSTR) hb_parcx( 2 ),
                                 (DWORD) hb_parnl( 3 )
                                ) ) ;
}
_winshell.c298
HB_FUNCSHELL_NOTIFYICON(void)
HB_FUNC( SHELL_NOTIFYICON )
{
   NOTIFYICONDATA * Data =  (NOTIFYICONDATA * ) hb_parc( 2 ); //hb_param(2, HB_IT_STRING)->item.asString.value;
   hb_retl( Shell_NotifyIcon( (DWORD) hb_parnl( 1 ), Data ) ) ;
}



//-----------------------------------------------------------------------------
// SHSTDAPI_(DWORD_PTR) SHGetFileInfoA(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT cbFileInfo, UINT uFlags);

/*

HB_FUNC( SHGETFILEINFO )
{
   SHFILEINFOA psfi             ;

   // Your code goes here

// hb_retnl( SHGetFileInfo( (LPCSTR) hb_parcx( 1 )    ,
                            (DWORD) hb_parnl( 2 )    ,
                            &psfi                    ,
                            (UINT) hb_parni( 4 )     ,
                            (UINT) hb_parni( 5 )
                          ) ) ;
}

*/

//-----------------------------------------------------------------------------
// SHSTDAPI_(BOOL) SHGetDiskFreeSpaceExA(LPCSTR pszDirectoryName, ULARGE_INTEGER* pulFreeBytesAvailableToCaller, ULARGE_INTEGER* pulTotalNumberOfBytes, ULARGE_INTEGER* pulTotalNumberOfFreeBytes);

/*

HB_FUNC( SHGETDISKFREESPACEEX )
{
   ULARGE_INTEGER pulFreeBytesAvailableToCaller ;
   ULARGE_INTEGER pulTotalNumberOfBytes         ;
   ULARGE_INTEGER pulTotalNumberOfFreeBytes     ;

   // Your code goes here

// () SHGetDiskFreeSpaceEx( (LPCSTR) hb_parcx( 1 )         ,
                            &pulFreeBytesAvailableToCaller,
                            &pulTotalNumberOfBytes        ,
                            &pulTotalNumberOfFreeBytes
                          ) ) ;
}

*/

//-----------------------------------------------------------------------------
// SHSTDAPI_(BOOL) SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags);

_winshell.c313
HB_FUNCSHINVOKEPRINTERCOMMAND(void)
HB_FUNC( SHINVOKEPRINTERCOMMAND )
{
   hb_retl( SHInvokePrinterCommand( (HWND) hb_parnl( 1 ) ,
                                    (UINT) hb_parni( 2 ) ,
                                    (LPCSTR) hb_parcx( 3 ),
                                    (LPCSTR) hb_parcx( 4 ),
                                     hb_parl( 5 )
                                   ) ) ;
}

#endif

//-----------------------------------------------------------------------------
// SHSTDAPI SHLoadNonloadedIconOverlayIdentifiers(void);

// verify the prototype

_winshell.c385
_winsock.c
TypeFunctionSourceLine
HB_FUNCACCEPT(void)
HB_FUNC( ACCEPT )
{
   char *addr  ;
   int addrlen ;

   if ( ISNIL(2) )
      hb_retnl( (LONG) accept( (SOCKET) hb_parnl(1), NULL, NULL ) ) ;
   else
   {
      addr = hb_parcx(2);
      addrlen = ISNIL(3) ? hb_parni(3) : hb_parclen(2) ;
      hb_retnl( (LONG) accept( (SOCKET) hb_parnl(1), ( struct sockaddr *) addr, &addrlen ) ) ;
      hb_storclen( addr, addrlen, 2 );
      hb_storni( addrlen, 3);
   }
}
_winsock.c31
HB_FUNCBIND(void)
HB_FUNC( BIND )
{
   char *name = (char *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;

   hb_retni(( int ) bind( (SOCKET) hb_parnl(1), ( struct sockaddr *) name, hb_parni( 3 ) ) ) ;
}
_winsock.c54
HB_FUNCCLOSESOCKET(void)
HB_FUNC( CLOSESOCKET )
{
   hb_retni( closesocket( (SOCKET) hb_parnl(1) ) ) ;
}
_winsock.c65
HB_FUNCCONNECT(void)
HB_FUNC( CONNECT )
{
   char *name = (char *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;

   hb_retni( (int ) connect((SOCKET) hb_parnl( 1 ), ( struct sockaddr *) name, hb_parni( 3 ) ) ) ;
}
_winsock.c76
HB_FUNCIOCTLSOCKET(void)
HB_FUNC( IOCTLSOCKET )
{
   ULONG arg = hb_parnl( 3 );

   hb_retni( (int ) ioctlsocket((SOCKET) hb_parnl( 1 ), hb_parnl( 2 ), &arg ) ) ;
   hb_stornl( arg, 3 );
}
_winsock.c89
HB_FUNCGETPEERNAME(void)
HB_FUNC( GETPEERNAME )
{
   char *name  = (char *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;
   int addrlen = ISNIL(3) ? hb_parni(3) : hb_parclen(2) ;

   hb_retni( (int ) getpeername((SOCKET) hb_parnl( 1 ), ( struct sockaddr *) name, &addrlen ) ) ;
   hb_storclen( name, addrlen, 2 );
   hb_storni( addrlen, 3);
}
_winsock.c103
HB_FUNCGETSOCKNAME(void)
HB_FUNC( GETSOCKNAME )
{
   char *name  = (char *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;
   int addrlen = ISNIL(3) ? hb_parni(3) : hb_parclen(2) ;

   hb_retni( (int ) getsockname((SOCKET) hb_parnl( 1 ), ( struct sockaddr *) name, &addrlen ) ) ;
   hb_storclen( name, addrlen, 2 );
   hb_storni( addrlen, 3);
}
_winsock.c119
HB_FUNCGETSOCKOPT(void)
HB_FUNC( GETSOCKOPT )
{
   char *optval = (char *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;
   int  optlen  = hb_parni( 5 );

   hb_retni( (int ) getsockopt( hb_parnl( 1 ) ,
                                hb_parni( 2 ),
                                hb_parni( 3 ),
                                optval      ,
                                &optlen
                              ) ) ;

   hb_storclen( optval, optlen, 4 );
   hb_storni( optlen, 5 );
}
_winsock.c135
HB_FUNCHTONL(void)
HB_FUNC( HTONL )
{
   hb_retnl( (ULONG) htonl( hb_parnl( 1 ) ) ) ;
}
_winsock.c155
HB_FUNCHTONS(void)
HB_FUNC( HTONS )
{
   hb_retni( (USHORT) htons( (USHORT) hb_parni( 1 ) ) ) ;
}
_winsock.c164
HB_FUNCINET_ADDR(void)
HB_FUNC( INET_ADDR )
{
   hb_retnl( (ULONG) inet_addr( hb_parcx( 1 ) ) ) ;
}
_winsock.c173
HB_FUNCINET_NTOA(void)
HB_FUNC( INET_NTOA )
{
   struct in_addr *in = (struct in_addr *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value ;

   hb_retc( inet_ntoa( *in ) ) ;
}
_winsock.c182
HB_FUNCLISTEN(void)
HB_FUNC( LISTEN )
{
 hb_retni( (int) listen((SOCKET) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winsock.c193
HB_FUNCNTOHL(void)
HB_FUNC( NTOHL )
{
   hb_retnl( (ULONG) ntohl( hb_parnl(1 ) ) ) ;
}
_winsock.c202
HB_FUNCNTOHS(void)
HB_FUNC( NTOHS )
{
   hb_retni( ( USHORT ) ntohs( (USHORT) hb_parni(1) ) ) ;
}
_winsock.c211
HB_FUNCRECV(void)
HB_FUNC( RECV )
{
   int  iBuffLen = (ISNIL(3) ? (ISNIL(2) ? 0 : hb_parclen(2) ) : hb_parni(3));
   char   *buf  = ( char *) hb_xgrab(iBuffLen) ;
   int iRet;

   iRet = recv((SOCKET) hb_parnl( 1 ), buf, iBuffLen, hb_parni( 4 ) ) ;
   if ( iRet && ISBYREF( 2 ) )
      hb_storclen( buf, iRet, 2 );

   hb_retni( iRet );
   hb_xfree( buf ) ;
}
_winsock.c222
HB_FUNCRECVFROM(void)
HB_FUNC( RECVFROM )
{
   int  iBuffLen = (ISNIL(3) ? (ISNIL(2) ? 0 : hb_parclen(2) ) : hb_parni(3));
   char *buf     = ( char *) hb_xgrab(iBuffLen) ;
   char *from    = (ISNIL(5) ? NULL : (char *) hb_parc( 5 )); //hb_param( 5, HB_IT_STRING )->item.asString.value );
   int  iAddrLen = (ISNIL(6) ? (ISNIL(5) ? 0 : hb_parclen(5) ) : hb_parni(6));
   int  iRet;

   iRet = ( int ) recvfrom( (SOCKET) hb_parnl( 1 )  ,
                              buf         ,
                              iBuffLen,
                              hb_parni( 4 ),
                              ( struct sockaddr *)from  ,
                              &iAddrLen
                              ) ;

   if ( iRet && ISBYREF( 2 ) )
      hb_storclen( buf, iRet, 2 );

   if ( iAddrLen && ISBYREF(5) )
      hb_storclen(from, iAddrLen, 5 );

   hb_retni( iRet );
   hb_xfree( buf ) ;

}
_winsock.c242
HB_FUNCSOCKSELECT(void)
HB_FUNC( SOCKSELECT )
{
   fd_set   *readfds   = NULL;
   fd_set   *writefds  = NULL;
   fd_set   *exceptfds = NULL;
   struct timeval  *timeout = NULL;

   if ( ISCHAR( 2 ) )
      readfds = (fd_set *) hb_parc( 2 ); //hb_param( 2, HB_IT_STRING )->item.asString.value ;

   if ( ISCHAR( 3 ) )
      writefds = (fd_set *) hb_parc( 3 ); //hb_param( 3, HB_IT_STRING )->item.asString.value ;

   if ( ISCHAR( 4 ) )
      exceptfds = (fd_set *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;

   if ( ISCHAR( 5 ) )
      timeout = (struct timeval *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;

   hb_retni(( int ) select( hb_parni( 1 ),
                            readfds      ,
                            writefds     ,
                            exceptfds    ,
                            timeout
                           ) ) ;

    if ( ISCHAR( 2 ) && ISBYREF( 2 ) )
       hb_storclen( ( char *) readfds, sizeof(fd_set), 2 );
    if ( ISCHAR( 3 ) && ISBYREF( 3 ) )
       hb_storclen( ( char *) writefds, sizeof(fd_set), 3 );
    if ( ISCHAR( 4 ) && ISBYREF( 4 ) )
       hb_storclen( ( char *) exceptfds, sizeof(fd_set), 4 );

 }
_winsock.c275
HB_FUNCSEND(void)
HB_FUNC( SEND )
{
   int  iBuffLen = (ISNIL(3) ? (ISNIL(2) ? 0 : hb_parclen(2) ) : hb_parni(3));
   hb_retni( ( int ) send((SOCKET) hb_parnl( 1 ), hb_parcx(2), iBuffLen, hb_parni( 4 ) ) ) ;
}
_winsock.c314
HB_FUNCSENDTO(void)
HB_FUNC( SENDTO )
{

   int  iBuffLen = (ISNIL(3) ? ( ISNIL(2) ? 0 : hb_parclen(2) ) : hb_parni(3));
   struct sockaddr *to = NULL;
   int iToLen = 0 ;

   if ( ISCHAR( 5 ) )
   {
     to = (struct sockaddr *) hb_parc( 5 ); //hb_param( 5, HB_IT_STRING )->item.asString.value ;
     iToLen = (ISNIL(6) ? (ISNIL(5) ? 0 : hb_parclen(5) ) : hb_parni(6));
   }

   hb_retni( (int ) sendto( (SOCKET) hb_parnl( 1 )       ,
                                            hb_parcx( 2 ) ,
                                            iBuffLen     ,
                                            hb_parni( 4 ),
                                            to           ,
                                            iToLen
                                          ) ) ;
}
_winsock.c326
HB_FUNCSETSOCKOPT(void)
HB_FUNC( SETSOCKOPT )
{
//   SOCKET s       ;
   INT    optval  = hb_parni(5) ;

   hb_retni( (int ) setsockopt( (SOCKET) hb_parnl( 1 ) ,
                                 hb_parni( 2 ),
                                 hb_parni( 3 ),
                                 (const char *) &optval      ,
                                 sizeof( optval) //hb_parni( 5 )
                               ) ) ;
}
_winsock.c352
HB_FUNCSHUTDOWN(void)
HB_FUNC( SHUTDOWN )
{
   hb_retni( (int ) shutdown((SOCKET) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winsock.c369
HB_FUNCSOCKET(void)
HB_FUNC( SOCKET )
{
   hb_retnl( ( ULONG ) socket( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_winsock.c378
HB_FUNCGETHOSTBYADDR(void)
HB_FUNC( GETHOSTBYADDR )
{
   HOSTENT *he ;
   he = gethostbyaddr( hb_parcx( 1 ) ,
                       hb_parni( 2 ),
                       hb_parni( 3 )
                     ) ;

   hb_retclen( ( char *)he, sizeof(HOSTENT) ) ;
}
_winsock.c387
HB_FUNCGETHOSTBYNAME(void)
HB_FUNC( GETHOSTBYNAME )
{
   HOSTENT *he ;

   he = gethostbyname( hb_parcx( 1 ) ) ;

   hb_retclen( ( char *)he, sizeof(HOSTENT) ) ;

}
_winsock.c402
HB_FUNCGETHOSTNAME(void)
HB_FUNC( GETHOSTNAME )
{
   char *name  = ( char*) hb_parcx( 1 )  ;
   int iLen    =  hb_parclen( 1 ) ;

   hb_retni( (int ) gethostname( name, iLen ) )  ;
   hb_storc( name, 1 );
}
_winsock.c418
HB_FUNCGETSERVBYPORT(void)
HB_FUNC( GETSERVBYPORT )
{
   hb_retclen( ( char * ) getservbyport( hb_parni( 1 ),hb_parcx( 2 ) ), sizeof(SERVENT) ) ;
}
_winsock.c431
HB_FUNCGETSERVBYNAME(void)
HB_FUNC( GETSERVBYNAME )
{
   hb_retclen( ( char *) getservbyname( hb_parcx( 1 ), hb_parcx( 2 ) ), sizeof(SERVENT) ) ;
}
_winsock.c440
HB_FUNCGETPROTOBYNUMBER(void)
HB_FUNC( GETPROTOBYNUMBER )
{
   hb_retclen( ( char * ) getprotobynumber( hb_parni( 1 ) ), sizeof(PROTOENT) ) ;
}
_winsock.c449
HB_FUNCGETPROTOBYNAME(void)
HB_FUNC( GETPROTOBYNAME )
{
   hb_retclen( ( char * ) getprotobyname( hb_parcx( 1 ) ), sizeof(PROTOENT) ) ;
}
_winsock.c458
HB_FUNCWSASTARTUP(void)
HB_FUNC( WSASTARTUP )
{
   WSADATA WSAData  ;

   hb_retni( (int ) WSAStartup( hb_parni( 1 ), &WSAData ) ) ;

   if ( ISBYREF( 2 ) )
     hb_storclen( ( char * ) &WSAData, sizeof( WSADATA ), 2 );
}
_winsock.c467
HB_FUNCWSACLEANUP(void)
HB_FUNC( WSACLEANUP )
{
   hb_retni( (int ) WSACleanup( ) ) ;
}
_winsock.c482
HB_FUNCWSASETLASTERROR(void)
HB_FUNC( WSASETLASTERROR )
{
   WSASetLastError( hb_parni( 1 ) ) ;
}
_winsock.c491
HB_FUNCWSAGETLASTERROR(void)
HB_FUNC( WSAGETLASTERROR )
{
   hb_retni( (int ) WSAGetLastError( ) ) ;
}
_winsock.c500
HB_FUNCWSAISBLOCKING(void)
HB_FUNC( WSAISBLOCKING )
{
   hb_retl( WSAIsBlocking( ) ) ;
}
_winsock.c509
HB_FUNCWSAUNHOOKBLOCKINGHOOK(void)
HB_FUNC( WSAUNHOOKBLOCKINGHOOK )
{
   hb_retni( (int ) WSAUnhookBlockingHook() ) ;
}


//-----------------------------------------------------------------------------
//  FARPROC  WSASetBlockingHook( IN FARPROC lpBlockFunc );

// OBSOLETE !!!

_winsock.c518
HB_FUNCWSACANCELBLOCKINGCALL(void)
HB_FUNC( WSACANCELBLOCKINGCALL )
{
   hb_retni( (int ) WSACancelBlockingCall() ) ;
}
_winsock.c546
HB_FUNCWSAASYNCGETSERVBYNAME(void)
HB_FUNC( WSAASYNCGETSERVBYNAME )
{
   char * buf = ( char *) hb_xgrab( MAXGETHOSTSTRUCT ) ;
   HANDLE hRet ;

   if( ( hRet = WSAAsyncGetServByName( (HWND)         hb_parnl( 1 ),
                                     (unsigned int) hb_parni( 2 ),
                                     ( char *)      hb_parcx( 3 ) ,
                                     ISNIL( 4 ) ? NULL : ( char *) hb_parcx( 4 ) ,
                                     ( char *)      buf          ,
                                     ( int)         MAXGETHOSTSTRUCT ) ) != 0 )

      hb_storclen( buf, sizeof(SERVENT), 5 ) ;

   hb_retnl( (ULONG ) hRet );
   hb_xfree( buf ) ;
}
_winsock.c563
HB_FUNCWSAASYNCGETSERVBYPORT(void)
HB_FUNC( WSAASYNCGETSERVBYPORT )
{
   char * buf = (char *) hb_xgrab( MAXGETHOSTSTRUCT ) ;
   HANDLE hRet ;

   if( ( hRet = WSAAsyncGetServByPort( (HWND) hb_parnl( 1 )        ,
                                      (unsigned int) hb_parni( 2 ),
                                       hb_parni( 3 )              ,
                                       ISNIL( 4 ) ? NULL : ( char *) hb_parcx( 4 ) ,
                                       ( char *)      buf         ,
                                       ( int)         MAXGETHOSTSTRUCT  ) ) != 0 )

        hb_storclen( buf, sizeof(SERVENT), 5 ) ;

   hb_retnl( (ULONG ) hRet );
   hb_xfree( buf ) ;
}
_winsock.c591
HB_FUNCWSAASYNCGETPROTOBYNAME(void)
HB_FUNC( WSAASYNCGETPROTOBYNAME )
{
   char * buf = ( char * ) hb_xgrab( MAXGETHOSTSTRUCT ) ;
   HANDLE hRet ;

   if( ( hRet = WSAAsyncGetProtoByName( (HWND)         hb_parnl( 1 ),
                                       (unsigned int) hb_parni( 2 ),
                                       ( char *)      hb_parcx( 3 ) ,
                                       ( char *)      buf          ,
                                       ( int)         MAXGETHOSTSTRUCT  ) ) != 0 )

        hb_storclen( buf, sizeof(PROTOENT), 4) ;

   hb_retnl( (ULONG ) hRet );
   hb_xfree( buf ) ;
}
_winsock.c620
HB_FUNCWSAASYNCGETPROTOBYNUMBER(void)
HB_FUNC( WSAASYNCGETPROTOBYNUMBER )
{
   char * buf = ( char *) hb_xgrab( MAXGETHOSTSTRUCT ) ;
   HANDLE hRet ;

   if( ( hRet = WSAAsyncGetProtoByNumber( (HWND)         hb_parnl( 1 ),
                                         (unsigned int) hb_parni( 2 ),
                                         (int)          hb_parni( 3 ),
                                         ( char *)      buf          ,
                                         ( int)         MAXGETHOSTSTRUCT  ) ) != 0 )

        hb_storclen( buf, sizeof(PROTOENT), 4) ;

   hb_retnl( (ULONG ) hRet );
   hb_xfree( buf ) ;
}
_winsock.c648
HB_FUNCWSAASYNCGETHOSTBYNAME(void)
HB_FUNC( WSAASYNCGETHOSTBYNAME )
{
   char * buf = ( char *) hb_xgrab( MAXGETHOSTSTRUCT ) ;
   HANDLE hRet ;

   if( ( hRet = WSAAsyncGetHostByName( (HWND) hb_parnl( 1 ),
                                       (unsigned int) hb_parni( 2 ),
                                       ( char *)      hb_parcx( 3 ) ,
                                       ( char *)      buf          ,
                                       ( int)         MAXGETHOSTSTRUCT ) ) != 0 )

      hb_storclen( buf, sizeof(HOSTENT), 4) ;

   hb_retnl( (ULONG ) hRet );
   hb_xfree( buf ) ;
}
_winsock.c674
HB_FUNCWSAASYNCGETHOSTBYADDR(void)
HB_FUNC( WSAASYNCGETHOSTBYADDR )
{

   char * buf = ( char *) hb_xgrab( MAXGETHOSTSTRUCT ) ;
   HANDLE hRet ;

   if( ( hRet = WSAAsyncGetHostByAddr( (HWND)         hb_parnl( 1 ) ,
                                      (unsigned int) hb_parni( 2 ) ,
                                      ( char *)      hb_parcx( 3 )  ,
                                      ( int )        hb_parclen( 3),
                                      ( int )        hb_parni( 4 ) ,
                                      ( char *)      buf           ,
                                      ( int)         MAXGETHOSTSTRUCT  ) ) != 0 )

      hb_storclen( buf, sizeof(HOSTENT), 5) ;

   hb_retnl( (ULONG ) hRet );
   hb_xfree( buf ) ;


}
_winsock.c702
HB_FUNCWSACANCELASYNCREQUEST(void)
HB_FUNC( WSACANCELASYNCREQUEST )
{
   hb_retni( (int) WSACancelAsyncRequest( (HANDLE) hb_parnl( 1 ) ) ) ;
}
_winsock.c728
HB_FUNCWSAASYNCSELECT(void)
HB_FUNC( WSAASYNCSELECT )
{
   hb_retni( (int ) WSAAsyncSelect( (SOCKET) hb_parnl( 1 ) ,
                                    (HWND) hb_parnl( 2 )   ,
                                    (UINT) hb_parni( 3 )   ,
                                     hb_parnl( 4 )
                                  ) ) ;
}
_winsock.c737
INT _STDCALL_WSACondFunc( LPWSABUF lpCallerId, LPWSABUF lpCallerData, LPQOS lpSQOS, LPQOS lpGQOS, LPWSABUF lpCalleeId, LPWSABUF lpCalleeData, GROUP * g, DWORD_PTR dwCallbackData )
int _stdcall _WSACondFunc( LPWSABUF lpCallerId,  LPWSABUF lpCallerData, LPQOS lpSQOS,
                 LPQOS lpGQOS, LPWSABUF lpCalleeId, LPWSABUF lpCalleeData,
                 GROUP * g, DWORD_PTR dwCallbackData )
{

   int res = CF_ACCEPT ;

   if ( dwCallbackData != 0 )
   {
      hb_vmPushSymbol( (HB_SYMB *) dwCallbackData ); // Harbour function pointer
      hb_vmPushNil();

      hb_vmPushLong( (LONG ) lpCallerId );
      hb_vmPushLong( (LONG ) lpCallerData );
      hb_vmPushLong( (LONG ) lpSQOS );
      hb_vmPushLong( (LONG ) lpGQOS );
      hb_vmPushLong( (LONG ) lpCalleeId );
      hb_vmPushLong( (LONG ) lpCalleeData );
      hb_vmPushLong( (LONG ) g );

      hb_vmDo(7) ;
      res = hb_itemGetNI( (PHB_ITEM) hb_param( -1, HB_IT_ANY ) );

   }
   return res;
}
_winsock.c756
HB_FUNCWSAACCEPT(void)
HB_FUNC( WSAACCEPT )
{
//   SOCKET          s              ;
   struct sockaddr addr           ;
   INT           addrlen  = ISBYREF( 2 ) ? 0 : sizeof(addr)  ;
   SOCKET sRet ;

   sRet = WSAAccept( (SOCKET) hb_parnl( 1 )   ,
                     &addr                    ,
                     &addrlen                 ,
                     _WSACondFunc              ,
                     ISNIL( 3 ) ? 0 : (DWORD_PTR) hb_parnl( 3 ) ) ;

   if( ( sRet != INVALID_SOCKET ) && ISBYREF( 2 ) )
        hb_storclen( ( char * ) &addr, addrlen, 2 ) ;

    hb_retnl( ( ULONG ) sRet ) ;

}
_winsock.c800
HB_FUNCWSACLOSEEVENT(void)
HB_FUNC( WSACLOSEEVENT )
{
   hb_retl( ( BOOL ) WSACloseEvent( (WSAEVENT) hb_parnl( 1 ) ) ) ;
}


//-----------------------------------------------------------------------------
//  int  WSAConnect( IN SOCKET s, IN const struct sockaddr * name, IN int namelen,
//                   IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, IN LPQOS lpGQOS );

// syntax: WSAConnect( s, cSockAddr, [cCallerData], [@cCalleeData]

_winsock.c825
HB_FUNCWSACREATEEVENT(void)
HB_FUNC( WSACREATEEVENT )
{
   hb_retnl( ( ULONG)  WSACreateEvent( ) ) ;
}


//-----------------------------------------------------------------------------
//  int  WSADuplicateSocketA( IN SOCKET s, IN DWORD dwProcessId,
//                            OUT LPWSAPROTOCOL_INFOA lpProtocolInfo );

/*

HB_FUNC( WSADUPLICATESOCKET )
{
   SOCKET              s              ;
   LPWSAPROTOCOL_INFOA lpProtocolInfo ;

   // Your code goes here

// hb_retni( (int ) WSADuplicateSocket( (SOCKET) hb_parnl( 1 )               ,
                                                        (DWORD) hb_parnl( 2 ),
                                                        lpProtocolInfo
                                                      ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSAEnumNetworkEvents( IN SOCKET s, IN WSAEVENT hEventObject, OUT LPWSANETWORKEVENTS lpNetworkEvents );

/*

HB_FUNC( WSAENUMNETWORKEVENTS )
{
   SOCKET             s               ;
   WSAEVENT           hEventObject    ;
   LPWSANETWORKEVENTS lpNetworkEvents ;

   // Your code goes here

// hb_retni( (int ) WSAEnumNetworkEvents( (SOCKET) hb_parnl( 1 )s              ,
                                                          hEventObject   ,
                                                          lpNetworkEvents
                                                        ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSAEnumProtocolsA( IN LPINT lpiProtocols, OUT LPWSAPROTOCOL_INFOA lpProtocolBuffer, IN OUT LPDWORD lpdwBufferLength );

_winsock.c888
HB_FUNCWSAEVENTSELECT(void)
HB_FUNC( WSAEVENTSELECT )
{
   hb_retni( (int ) WSAEventSelect( (SOCKET)   hb_parnl( 1 ) ,
                                    (WSAEVENT) hb_parnl( 2 ) ,
                                    (long)     hb_parnl( 3 )
                                   ) ) ;
}


//-----------------------------------------------------------------------------
//  BOOL  WSAGetOverlappedResult( IN SOCKET s, IN LPWSAOVERLAPPED lpOverlapped, OUT LPDWORD lpcbTransfer, IN BOOL fWait, OUT LPDWORD lpdwFlags );

/*

HB_FUNC( WSAGETOVERLAPPEDRESULT )
{
   SOCKET          s            ;
   LPWSAOVERLAPPED lpOverlapped ;
   LPDWORD         lpcbTransfer ;
   LPDWORD         lpdwFlags    ;

   // Your code goes here

// hb_retl( WSAGetOverlappedResult( (SOCKET) hb_parnl( 1 )           ,
                                    lpOverlapped,
                                    lpcbTransfer,
                                    hb_parl( 4 ),
                                    lpdwFlags
                                   ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  BOOL  WSAGetQOSByName( IN SOCKET s, IN LPWSABUF lpQOSName, OUT LPQOS lpQOS );

/*

HB_FUNC( WSAGETQOSBYNAME )
{
   SOCKET   s         ;
   LPWSABUF lpQOSName ;
   LPQOS    lpQOS     ;

   // Your code goes here

// hb_retl( WSAGetQOSByName((SOCKET) hb_parnl( 1 ), lpQOSName, lpQOS ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSAHtonl( IN SOCKET s, IN u_long hostlong, OUT u_long * lpnetlong );

/*

HB_FUNC( WSAHTONL )
{
   SOCKET s         ;
   u_long hostlong  ;
   u_long lpnetlong ;

   // Your code goes here

// hb_retni( (int ) WSAHtonl((SOCKET) hb_parnl( 1 ), hostlong, &lpnetlong ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSAHtons( IN SOCKET s, IN u_short hostshort, OUT u_short * lpnetshort );

/*

HB_FUNC( WSAHTONS )
{
   SOCKET  s          ;
   u_short hostshort  ;
   u_short lpnetshort ;

   // Your code goes here

// hb_retni( (int ) WSAHtons((SOCKET) hb_parnl( 1 ), hostshort, &lpnetshort ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSAIoctl( IN SOCKET s, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );

/*

HB_FUNC( WSAIOCTL )
{
   SOCKET                             s                   ;
   LPVOID                             lpvInBuffer         ;
   LPVOID                             lpvOutBuffer        ;
   LPDWORD                            lpcbBytesReturned   ;
   LPWSAOVERLAPPED                    lpOverlapped        ;
   LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine ;

   // Your code goes here

// hb_retni( (int ) WSAIoctl( (SOCKET) hb_parnl( 1 )s                    ,
                                              (DWORD) hb_parnl( 2 ),
                                              lpvInBuffer          ,
                                              (DWORD) hb_parnl( 4 ),
                                              lpvOutBuffer         ,
                                              (DWORD) hb_parnl( 6 ),
                                              lpcbBytesReturned    ,
                                              lpOverlapped         ,
                                              lpCompletionRoutine
                                            ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  SOCKET  WSAJoinLeaf( IN SOCKET s, IN const struct sockaddr * name, IN int namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, IN LPQOS lpGQOS, IN DWORD dwFlags );

/*

HB_FUNC( WSAJOINLEAF )
{
   SOCKET          s            ;
   sockaddr struct name         ;
   LPWSABUF        lpCallerData ;
   LPWSABUF        lpCalleeData ;
   LPQOS           lpSQOS       ;
   LPQOS           lpGQOS       ;

   // Your code goes here

// hb_retnl( WSAJoinLeaf( (SOCKET) hb_parnl( 1 )s                    ,
                                                    &name                ,
                                                    hb_parni( 3 )        ,
                                                    lpCallerData         ,
                                                    lpCalleeData         ,
                                                    lpSQOS               ,
                                                    lpGQOS               ,
                                                    (DWORD) hb_parnl( 8 )
                                                  ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSANtohl( IN SOCKET s, IN u_long netlong, OUT u_long * lphostlong );

/*

HB_FUNC( WSANTOHL )
{
   SOCKET s          ;
   u_long netlong    ;
   u_long lphostlong ;

   // Your code goes here

   hb_retni( (int ) WSANtohl((SOCKET) hb_parnl( 1 ), netlong, &lphostlong ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSANtohs( IN SOCKET s, IN u_short netshort, OUT u_short * lphostshort );

/*

HB_FUNC( WSANTOHS )
{
   SOCKET  s           ;
   u_short netshort    ;
   u_short lphostshort ;

   // Your code goes here

   hb_retni( (int ) WSANtohs((SOCKET) hb_parnl( 1 ), netshort, &lphostshort ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSARecv( IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );

/*

HB_FUNC( WSARECV )
{
   SOCKET                             s                    ;
   LPWSABUF                           lpBuffers            ;
   LPDWORD                            lpNumberOfBytesRecvd ;
   LPDWORD                            lpFlags              ;
   LPWSAOVERLAPPED                    lpOverlapped         ;
   LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine  ;

   // Your code goes here

   hb_retni( (int ) WSARecv( (SOCKET) hb_parnl( 1 )               ,
                                             lpBuffers            ,
                                             (DWORD) hb_parnl( 3 ),
                                             lpNumberOfBytesRecvd ,
                                             lpFlags              ,
                                             lpOverlapped         ,
                                             lpCompletionRoutine
                                           ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSARecvDisconnect( IN SOCKET s, OUT LPWSABUF lpInboundDisconnectData );

/*

HB_FUNC( WSARECVDISCONNECT )
{
    LPWSABUF lpInboundDisconnectData ;


// hb_retni( (int ) WSARecvDisconnect( (SOCKET) hb_parnl( 1 )                  ,
                                                       lpInboundDisconnectData
                                                     ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSARecvFrom( IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, OUT struct sockaddr * lpFrom, IN OUT LPINT lpFromlen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );

_winsock.c963
HB_FUNCWSARESETEVENT(void)
HB_FUNC( WSARESETEVENT )
{
   hb_retl( WSAResetEvent( (WSAEVENT) hb_parnl( 1 ) ) ) ;
}


//-----------------------------------------------------------------------------
//  int  WSASend( IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );

/*

HB_FUNC( WSASEND )
{
   SOCKET                             s                   ;
   LPWSABUF                           lpBuffers           ;
   LPDWORD                            lpNumberOfBytesSent ;
   LPWSAOVERLAPPED                    lpOverlapped        ;
   LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine ;


   hb_retni( (int ) WSASend( (SOCKET) hb_parnl( 1 )               ,
                                             lpBuffers            ,
                                             (DWORD) hb_parnl( 3 ),
                                             lpNumberOfBytesSent  ,
                                             (DWORD) hb_parnl( 5 ),
                                             lpOverlapped         ,
                                             lpCompletionRoutine
                                           ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSASendDisconnect( IN SOCKET s, IN LPWSABUF lpOutboundDisconnectData );

/*

HB_FUNC( WSASENDDISCONNECT )
{
   SOCKET   s                        ;
   LPWSABUF lpOutboundDisconnectData ;

   // Your code goes here

// hb_retni( (int ) WSASendDisconnect( (SOCKET) hb_parnl( 1 )s                       ,
                                                       lpOutboundDisconnectData
                                                     ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  int  WSASendTo( IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN const struct sockaddr * lpTo, IN int iTolen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );

_winsock.c1234
HB_FUNCWSASETEVENT(void)
HB_FUNC( WSASETEVENT )
{
   hb_retl( WSASetEvent( (WSAEVENT) hb_parnl( 1 ) ) ) ;
}


//-----------------------------------------------------------------------------
//  SOCKET  WSASocketA( IN int af, IN int type, IN int protocol, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, IN GROUP g, IN DWORD dwFlags );

/*

HB_FUNC( WSASOCKET )
{
   LPWSAPROTOCOL_INFOA lpProtocolInfo ;
   GROUP               g              ;

   // Your code goes here

   hb_retnl( ( ULONG ) WSASocket( hb_parni( 1 )        ,
                         hb_parni( 2 )        ,
                                                  hb_parni( 3 )        ,
                                                  lpProtocolInfo       ,
                                                  g                    ,
                                                  (DWORD) hb_parnl( 6 )
                                                ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  DWORD  WSAWaitForMultipleEvents( IN DWORD cEvents, IN const WSAEVENT * lphEvents, IN BOOL fWaitAll, IN DWORD dwTimeout, IN BOOL fAlertable );

/*

HB_FUNC( WSAWAITFORMULTIPLEEVENTS )
{
   WSAEVENT lphEvents  ;

   // Your code goes here

   hb_retnl( ( DWORD ) WSAWaitForMultipleEvents( (DWORD) hb_parnl( 1 ),
                                                                &lphEvents           ,
                                                                hb_parl( 3 )         ,
                                                                (DWORD) hb_parnl( 4 ),
                                                                hb_parl( 5 )
                                                              ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  INT  WSAAddressToStringA( IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, IN OUT LPSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength );

/*

HB_FUNC( WSAADDRESSTOSTRING )
{
   LPSOCKADDR          lpsaAddress             ;
   LPWSAPROTOCOL_INFOA lpProtocolInfo          ;
   LPDWORD             lpdwAddressStringLength ;

   // Your code goes here

// hb_retni( (int ) WSAAddressToString( lpsaAddress            ,
                                                        (DWORD) hb_parnl( 2 )  ,
                                                        lpProtocolInfo         ,
                                                        (LPSTR) hb_parcx( 4 )   ,
                                                        lpdwAddressStringLength
                                                      ) ) ;
}

*/



//-----------------------------------------------------------------------------
//  INT  WSAStringToAddressA( IN LPSTR AddressString, IN INT AddressFamily, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength );

/*

HB_FUNC( WSASTRINGTOADDRESS )
{
   LPWSAPROTOCOL_INFOA lpProtocolInfo  ;
   LPSOCKADDR          lpAddress       ;
   LPINT               lpAddressLength ;

   // Your code goes here

// hb_retni( (int ) WSAStringToAddress( (LPSTR) hb_parcx( 1 ),
                                                        hb_parni( 2 )       ,
                                                        lpProtocolInfo      ,
                                                        lpAddress           ,
                                                        lpAddressLength
                                                      ) ) ;
}

*/



//-----------------------------------------------------------------------------
//  INT  WSALookupServiceBeginA( IN LPWSAQUERYSETA lpqsRestrictions, IN DWORD dwControlFlags, OUT LPHANDLE lphLookup );

/*

HB_FUNC( WSALOOKUPSERVICEBEGIN )
{
   LPWSAQUERYSETA lpqsRestrictions ;
   LPHANDLE       lphLookup        ;

   // Your code goes here

// hb_retni( (int ) WSALookupServiceBegin( lpqsRestrictions     ,
                                                           (DWORD) hb_parnl( 2 ),
                                                           lphLookup
                                                         ) ) ;
}

*/



//-----------------------------------------------------------------------------
//  INT  WSALookupServiceNextA( IN HANDLE hLookup, IN DWORD dwControlFlags, IN OUT LPDWORD lpdwBufferLength, OUT LPWSAQUERYSETA lpqsResults );

_winsock.c1321
HB_FUNCWSALOOKUPSERVICEEND(void)
HB_FUNC( WSALOOKUPSERVICEEND )
{
   hb_retni( (int ) WSALookupServiceEnd( (HANDLE) hb_parnl( 1 ) ) ) ;
}


//-----------------------------------------------------------------------------
//  INT  WSAInstallServiceClassA( IN LPWSASERVICECLASSINFOA lpServiceClassInfo );

/*

HB_FUNC( WSAINSTALLSERVICECLASS )
{
   LPWSASERVICECLASSINFOA lpServiceClassInfo ;

   // Your code goes here

// hb_retni( (int ) WSAInstallServiceClass( lpServiceClassInfo ) ) ;
}

*/



//-----------------------------------------------------------------------------
//  INT  WSARemoveServiceClass( IN LPGUID lpServiceClassId );

/*

HB_FUNC( WSAREMOVESERVICECLASS )
{
   LPGUID lpServiceClassId ;

   // Your code goes here

// hb_retni( (int ) WSARemoveServiceClass( lpServiceClassId ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  INT  WSAGetServiceClassInfoA( IN LPGUID lpProviderId, IN LPGUID lpServiceClassId, IN OUT LPDWORD lpdwBufSize, OUT LPWSASERVICECLASSINFOA lpServiceClassInfo );

/*

HB_FUNC( WSAGETSERVICECLASSINFO )
{
   LPGUID                 lpProviderId       ;
   LPGUID                 lpServiceClassId   ;
   LPDWORD                lpdwBufSize        ;
   LPWSASERVICECLASSINFOA lpServiceClassInfo ;

   // Your code goes here

// hb_retni( (int ) WSAGetServiceClassInfo( lpProviderId      ,
                                                            lpServiceClassId  ,
                                                            lpdwBufSize       ,
                                                            lpServiceClassInfo
                                                          ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  INT  WSAEnumNameSpaceProvidersA( IN OUT LPDWORD lpdwBufferLength, OUT LPWSANAMESPACE_INFOA lpnspBuffer );

/*

HB_FUNC( WSAENUMNAMESPACEPROVIDERS )
{
   LPDWORD              lpdwBufferLength ;
   LPWSANAMESPACE_INFOA lpnspBuffer      ;

   // Your code goes here

// hb_retni( (int ) WSAEnumNameSpaceProviders( lpdwBufferLength,
                                                               lpnspBuffer
                                                             ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  INT  WSAGetServiceClassNameByClassIdA( IN LPGUID lpServiceClassId, OUT LPSTR lpszServiceClassName, IN OUT LPDWORD lpdwBufferLength );

/*

HB_FUNC( WSAGETSERVICECLASSNAMEBYCLASSID )
{
   LPGUID  lpServiceClassId     ;
   LPDWORD lpdwBufferLength     ;

   // Your code goes here

// hb_retni( (int ) WSAGetServiceClassNameByClassId( lpServiceClassId    ,
                                                                     (LPSTR) hb_parcx( 2 ),
                                                                     lpdwBufferLength
                                                                   ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  INT  WSASetServiceA( IN LPWSAQUERYSETA lpqsRegInfo, IN WSAESETSERVICEOP essoperation, IN DWORD dwControlFlags );

/*

HB_FUNC( WSASETSERVICE )
{
   LPWSAQUERYSETA   lpqsRegInfo    ;
   WSAESETSERVICEOP essoperation   ;

   // Your code goes here

// hb_retni( (int ) WSASetService( lpqsRegInfo          ,
                                                   essoperation         ,
                                                   (DWORD) hb_parnl( 3 )
                                                 ) ) ;
}

*/


//-----------------------------------------------------------------------------
//  INT  WSAProviderConfigChange( IN OUT LPHANDLE lpNotificationHandle, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );

_winsock.c1471
_winsys.c
TypeFunctionSourceLine
HB_FUNCGETFREESPACE(void)
HB_FUNC( GETFREESPACE )
{
   hb_retnl( (LONG) GetFreeSpace( (UINT) hb_parni( 1 ) ) ) ;
}
_winsys.c55
HB_FUNCOUTPUTDEBUGSTRING(void)
HB_FUNC( OUTPUTDEBUGSTRING )
{
   OutputDebugString( (LPCSTR) hb_parcx( 1 ) ) ;
}
_winsys.c66
HB_FUNCGETTIMEZONEINFORMATION(void)
HB_FUNC( GETTIMEZONEINFORMATION )
{
 TIME_ZONE_INFORMATION tzi;

 hb_retnl( GetTimeZoneInformation( &tzi ) ) ;

 if ( ISBYREF(1) )
    hb_storclen( (char*) &tzi, sizeof(tzi), 1);
}
_winsys.c71
HB_FUNCSETTIMEZONEINFORMATION(void)
HB_FUNC( SETTIMEZONEINFORMATION )
{
 TIME_ZONE_INFORMATION *tzi = ( TIME_ZONE_INFORMATION *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value ;

 hb_retl( SetTimeZoneInformation( tzi ) ) ;

}
_winsys.c90
HB_FUNCDEBUGBREAK(void)
//-------------------------------------------------------------------//
//
// WINBASEAPI VOID WINAPI DebugBreak( VOID );
//
HB_FUNC( DEBUGBREAK )
{
   DebugBreak(  ) ;
}

//-------------------------------------------------------------------//
//
// WINADVAPI BOOL WINAPI EncryptFileA( IN LPCSTR lpFileName );
//
// NT ?
/*
HB_FUNC( ENCRYPTFILE )
{
   hb_retl( EncryptFileA( (LPCSTR) hb_parcx( 1 ) ) ) ;
}
*/

//-------------------------------------------------------------------//
//
// WINADVAPI BOOL WINAPI DecryptFileA( IN LPCSTR lpFileName, IN DWORD dwReserved );
//
// NT ?
/*
HB_FUNC( DECRYPTFILE )
{
   hb_retl( DecryptFileA( (LPCSTR) hb_parcx( 1 ), 0 ) ) ; //(DWORD) hb_parnl( 2 ) ) ) ;
}
*/

//-------------------------------------------------------------------//
//
// WINADVAPI BOOL WINAPI FileEncryptionStatusA( LPCSTR lpFileName, LPDWORD lpStatus );
/*
// need function info !

HB_FUNC( FILEENCRYPTIONSTATUSA )
{
   LPDWORD lpStatus   ;
_winsys.c104
HB_FUNCISPROCESSORFEATUREPRESENT(void)
   hb_retl( FileEncryptionStatusA( (LPCSTR) hb_parcx( 1 ), lpStatus ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI BOOL WINAPI IsProcessorFeaturePresent( IN DWORD ProcessorFeature );
//
HB_FUNC( ISPROCESSORFEATUREPRESENT )
{
   hb_retl( IsProcessorFeaturePresent( (DWORD) hb_parnl( 1 ) ) ) ;
}
_winsys.c158
HB_FUNCMULDIV(void)
HB_FUNC( MULDIV )
{
   hb_retni( MulDiv( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) ) ;
}
_winsys.c174
HB_FUNCSYSTEMPARAMETERSINFO(void)
HB_FUNC( SYSTEMPARAMETERSINFO )
{
   PHB_ITEM pBuffer = hb_param( 3, HB_IT_STRING );

   if( pBuffer )
   {
      char * cText = (char*) hb_xgrab( hb_itemGetCLen( pBuffer )+1 );
      hb_xmemcpy( cText, hb_itemGetC( pBuffer ), hb_itemGetCLen( pBuffer )+1 );

      if( SystemParametersInfo( (UINT) hb_parni( 1 ),
                                (UINT) hb_parni( 2 ),
                                cText,
                                (UINT) hb_parni( 4 ) ) )
      {
         if( ISBYREF( 3 ) )
         {
            if( ! hb_storclen_buffer( cText, hb_itemGetCLen( pBuffer ), 3 ) )
               hb_xfree( cText );
      
            hb_retl( TRUE );
            return;
         }
      }

      hb_xfree( cText );
   }

   hb_retl( FALSE );
}
_winsys.c179
HB_FUNCFREERESOURCE(void)
HB_FUNC( FREERESOURCE )
{
   hb_retl( FreeResource( (HGLOBAL) hb_parnl( 6 )) ) ;
}
_winsys.c215
HB_FUNCSETDEBUGERRORLEVEL(void)
HB_FUNC( SETDEBUGERRORLEVEL )
{
   SetDebugErrorLevel( (DWORD) hb_parnl( 1 ) ) ;
}
_winsys.c224
HB_FUNCSETLASTERROREX(void)
HB_FUNC( SETLASTERROREX )
{
   SetLastErrorEx( (DWORD) hb_parnl( 1 ), (DWORD) hb_parnl( 2 ) ) ;
}

//-------------------------------------------------------------------//
_winsys.c233
HB_FUNCGETSTDHANDLE(void)
HB_FUNC( GETSTDHANDLE )
{
   hb_retnl( (LONG) GetStdHandle( (DWORD) hb_parnl(1) ) ) ;
}

//-------------------------------------------------------------------//
_winsys.c247
HB_FUNCSETSTDHANDLE(void)
HB_FUNC( SETSTDHANDLE )
{
   hb_retl( SetStdHandle( (DWORD) hb_parnl(1), (HANDLE) hb_parnl(2) ) ) ;
}

//-------------------------------------------------------------------//
_winsys.c260
HB_FUNCSETCONSOLETITLE(void)
HB_FUNC( SETCONSOLETITLE )
{
   hb_retnl( ( LONG ) SetConsoleTitle( ( LPCSTR ) hb_parcx( 1 ) ) ) ;
}
_winsys.c270
HB_FUNCGETCONSOLEWINDOW(void)
HB_FUNC( GETCONSOLEWINDOW )
{
   char realtitle[ MAX_PATH ];

   GetConsoleTitle( realtitle,MAX_PATH );
   SetConsoleTitle( "Finding Handle" );
   hb_retnl( ( LONG ) FindWindow( NULL,"Finding Handle" ) );
   SetConsoleTitle( realtitle );
}
_winsys.c275
HB_FUNCGETSYSTEMMETRICS(void)
HB_FUNC( GETSYSTEMMETRICS )
{
   hb_retni( GetSystemMetrics( hb_parni( 1 ) ) ) ;
}
_winsys.c295
HB_FUNCSETTIMER(void)
HB_FUNC( SETTIMER )
{
   hb_retni( SetTimer( (HWND) hb_parnl( 1 ),
                       (UINT) hb_parni( 2 ),
                       (UINT) hb_parni( 3 ),
                       ISNIL(4) ? NULL : (TIMERPROC) hb_parnl(4)
                      ) ) ;
}
_winsys.c304
HB_FUNCKILLTIMER(void)
HB_FUNC( KILLTIMER )
{
   hb_retl( KillTimer( (HWND) hb_parnl( 1 ), (UINT) hb_parni(2) ) ) ;
}
_winsys.c317
HB_FUNCGETSYSCOLOR(void)
HB_FUNC( GETSYSCOLOR )
{
  hb_retnl( GetSysColor( hb_parni(1) ) ) ;
}
_winsys.c328
HB_FUNCEXITWINDOWSEX(void)
HB_FUNC( EXITWINDOWSEX )
{
   hb_retl( ExitWindowsEx( (UINT) hb_parni( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_winsys.c333
HB_FUNCGETSYSCOLORBRUSH(void)
HB_FUNC( GETSYSCOLORBRUSH )
{
   hb_retnl( (LONG) GetSysColorBrush( hb_parni( 1 ) ) ) ;
}

//-------------------------------------------------------------------//
//
// WINUSERAPI BOOL WINAPI SetSysColors( IN int cElements, IN CONST INT * lpaElements, IN CONST COLORREF * lpaRgbValues);
_winsys.c342
HB_FUNCAND(void)
HB_FUNC( AND )
{
  hb_retnl( hb_parnl(1) & hb_parnl(2) ) ;
}
_winsys.c366
HB_FUNCOR(void)
HB_FUNC( OR )
{
  hb_retnl( hb_parnl(1) | hb_parnl(2) ) ;
}
_winsys.c373
HB_FUNCNOT(void)
HB_FUNC( NOT )
{
   hb_retnl( ~( hb_parnl(1) ) ) ;
}
_winsys.c380
HB_FUNC_GETINSTANCE(void)
HB_FUNC( _GETINSTANCE )
{
   hb_retnl( (LONG) GetModuleHandle( NULL ) );
}
_winsys.c387
HB_FUNCLOWORD(void)
HB_FUNC( LOWORD )
{
   hb_retni( (int) ( hb_parnl( 1 ) & 0xFFFF ) );
}
_winsys.c394
HB_FUNCHIWORD(void)
HB_FUNC( HIWORD )
{
   hb_retni( (int) ( ( hb_parnl( 1 ) >> 16 ) & 0xFFFF ) );
}
_winsys.c401
HB_FUNCMAKELONG(void)
HB_FUNC( MAKELONG )
{
   hb_retnl( (LONG) (((WORD) (hb_parni(1))) | (((DWORD) ((WORD) (hb_parni(2)))) << 16)) ) ;
}

//-------------------------------------------------------------------//
/*
HB_FUNC( GETLASTERROR )
{
  hb_retnl( ( LONG ) GetLastError() ) ;
}
*/
//-------------------------------------------------------------------//
//
// T.B.D.
// returns error message text
_winsys.c408
HB_FUNCSETERRORMODE(void)
//-------------------------------------------------------------------//
//
// WINBASEAPI UINT WINAPI SetErrorMode( IN UINT uMode );
//
HB_FUNC( SETERRORMODE )
{
   hb_retni( SetErrorMode( (UINT) hb_parni( 1 ) ) ) ;
}
_winsys.c438
HB_FUNCOEMTOCHAR(void)
HB_FUNC( OEMTOCHAR )
{
   int iLen = hb_parclen( 1 );
   char * buffer = ( char* ) hb_xgrab( iLen + 1 );

   OemToCharBuff( hb_parcx( 1 ), buffer, iLen );
   hb_retclenAdopt( buffer, iLen );
}
_winsys.c459
HB_FUNCCHARTOOEM(void)
HB_FUNC( CHARTOOEM )
{
   int iLen = hb_parclen( 1 );
   char * buffer = ( char* ) hb_xgrab( iLen + 1 );

   CharToOemBuff( hb_parcx( 1 ), buffer, iLen );
   hb_retclenAdopt( buffer, iLen );
}
_winsys.c470
HB_FUNCOEMTOANSI(void)
HB_FUNC( OEMTOANSI )
{
HB_FUNCNAME( OEMTOCHAR )();
}
_winsys.c481
HB_FUNCANSITOOEM(void)
HB_FUNC( ANSITOOEM )
{
HB_FUNCNAME( CHARTOOEM )();
}
_winsys.c488
HB_FUNCGETVERSION(void)
HB_FUNC( GETVERSION )
{
   hb_retnl( (LONG) GetVersion(  ) ) ;
}
_winsys.c497
HB_FUNCFINDRESOURCE(void)
HB_FUNC( FINDRESOURCE )
{
   hb_retnl( (LONG) FindResourceA( (HMODULE) hb_parnl( 1 ),
                                   (LPCSTR) hb_parcx( 2 )  ,
                                   (LPCSTR) hb_parcx( 3 )
                                  ) ) ;
}
_winsys.c502
HB_FUNCFINDRESOURCEEX(void)
HB_FUNC( FINDRESOURCEEX )
{
   hb_retnl( (LONG) FindResourceExA( (HMODULE) hb_parnl( 1 ),
                                     (LPCSTR) hb_parcx( 2 )  ,
                                     (LPCSTR) hb_parcx( 3 )  ,
                                     (WORD) hb_parni( 4 )
                                     ) ) ;
}
_winsys.c514
HB_FUNCLOADRESOURCE(void)
HB_FUNC( LOADRESOURCE )
{
   hb_retnl( (LONG) LoadResource( (HMODULE) hb_parnl( 1 ),
                                  (HRSRC) hb_parnl( 2 )
                                 ) ) ;
}
_winsys.c527
HB_FUNCLOADSTRING(void)
HB_FUNC( LOADSTRING )
{
   ULONG iLen = ISNIL(3) ? MAX_PATH : (ULONG) hb_parclen( 3 );
   LPTSTR cText = (char*) hb_xgrab( iLen+1 );

   iLen = LoadString( ( ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl(1) ),
                      (UINT) hb_parni(2) ,
                      (LPTSTR) cText ,
                      iLen ) ;

   hb_retclen( cText, iLen );
   hb_xfree( cText );
}
_winsys.c538
HB_FUNCSIZEOFRESOURCE(void)
HB_FUNC( SIZEOFRESOURCE )
{
   hb_retnl( (LONG) SizeofResource( (HMODULE) hb_parnl( 1 ),
                                    (HRSRC) hb_parnl( 2 )
                                    ) ) ;
}
_winsys.c562
HB_FUNCLOCKRESOURCE(void)
HB_FUNC( LOCKRESOURCE )
{
   hb_retnl( (LONG) LockResource( (HGLOBAL) hb_parnl( 1 ) ) ) ;
}

//-------------------------------------------------------------------//
//
// WINBASEAPI DWORD WINAPI LoadModule( IN LPCSTR lpModuleName, IN LPVOID lpParameterBlock );
_winsys.c573
HB_FUNCTONE(void)
HB_FUNC( TONE )
{
   hb_retl( Beep( (DWORD) hb_parnl( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_winsys.c596
HB_FUNCGETMODULEFILENAME(void)
HB_FUNC( GETMODULEFILENAME )
{
   char szBuffer[ MAX_PATH + 1 ] = {0} ;
   GetModuleFileNameA( ISNIL(1) ? GetModuleHandle(NULL) : (HMODULE) hb_parnl( 1 ),
                       szBuffer  ,
                       MAX_PATH
                     ) ;
   hb_retc(szBuffer);
}
_winsys.c609
HB_FUNCGETMODULEHANDLE(void)
HB_FUNC( GETMODULEHANDLE )
{
   hb_retnl( (LONG) GetModuleHandleA( (ISNIL(1) ? NULL : (LPCSTR) hb_parcx( 1 ) ) ) ) ;
}
_winsys.c619
HB_FUNCGETCOMMANDLINE(void)
HB_FUNC( GETCOMMANDLINE )
{
   hb_retc( (LPSTR) GetCommandLine() );
}

//-------------------------------------------------------------------//
//
// WINBASEAPI VOID WINAPI GetSystemTime( OUT LPSYSTEMTIME lpSystemTime );
/*
HB_FUNC( GETSYSTEMTIME )
{
   LPSYSTEMTIME lpSystemTime ;

   // Your code goes here

   GetSystemTime( lpSystemTime ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI BOOL WINAPI SetSystemTime( IN CONST SYSTEMTIME *lpSystemTime );
//
/*
HB_FUNC( SETSYSTEMTIME )
{
   SYSTEMTIME CONST lpSystemTime ;

   // Your code goes here

   hb_retl( SetSystemTime( &lpSystemTime ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI VOID WINAPI GetLocalTime( OUT LPSYSTEMTIME lpSystemTime );
/*
HB_FUNC( GETLOCALTIME )
{
   LPSYSTEMTIME lpSystemTime ;

   // Your code goes here

   GetLocalTime( lpSystemTime ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI BOOL WINAPI SetLocalTime( IN CONST SYSTEMTIME *lpSystemTime );
/*
HB_FUNC( SETLOCALTIME )
{
   SYSTEMTIME CONST lpSystemTime ;

   // Your code goes here

   hb_retl( SetLocalTime( &lpSystemTime ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI VOID WINAPI GetSystemInfo( OUT LPSYSTEM_INFO lpSystemInfo );
/*
HB_FUNC( GETSYSTEMINFO )
{
   LPSYSTEM_INFO lpSystemInfo ;
_winsys.c628
HB_FUNCGETTICKCOUNT(void)
   GetSystemInfo( lpSystemInfo ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI DWORD WINAPI GetTickCount( VOID );
//
HB_FUNC( GETTICKCOUNT )
{
   hb_retnl( (LONG) GetTickCount(  ) ) ;
}
_winsys.c700
HB_FUNCGETLOGICALDRIVESTRINGS(void)
HB_FUNC( GETLOGICALDRIVESTRINGS )
{
   hb_retnl( (LONG) GetLogicalDriveStrings( (DWORD) hb_parnl( 1 ),
                                             (LPSTR) hb_parcx( 2 )
                                             ) ) ;
}
_winsys.c716
HB_FUNCGETCOMPUTERNAME(void)
HB_FUNC( GETCOMPUTERNAME )
{
   char cText[MAX_COMPUTERNAME_LENGTH+1]  ;
   DWORD nSize = MAX_COMPUTERNAME_LENGTH+1;

   hb_retl( GetComputerNameA( (LPSTR) &cText, &nSize ) ) ;

   hb_storc( cText, 1 ) ;
   hb_stornl( nSize, 2 ) ;
}
_winsys.c723
HB_FUNCSETCOMPUTERNAME(void)
HB_FUNC( SETCOMPUTERNAME )
{
   hb_retl( SetComputerNameA( (LPCSTR) hb_parcx( 1 ) ) ) ;
}

//-------------------------------------------------------------------//
//
// WINBASEAPI BOOL WINAPI GetComputerNameExA ( IN COMPUTER_NAME_FORMAT NameType, OUT LPSTR lpBuffer, IN OUT LPDWORD nSize );
/*
HB_FUNC( GETCOMPUTERNAMEEX )
{
   COMPUTER_NAME_FORMAT NameType ;
   LPDWORD              nSize    ;

   // Your code goes here

   hb_retl( GetComputerNameExA( NameType, (LPSTR) hb_parcx( 2 ), nSize ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINBASEAPI BOOL WINAPI SetComputerNameExA ( IN COMPUTER_NAME_FORMAT NameType, IN LPCSTR lpBuffer );
/*
HB_FUNC( SETCOMPUTERNAMEEX )
{
   COMPUTER_NAME_FORMAT NameType ;
_winsys.c739
HB_FUNCGETUSERNAME(void)
   hb_retl( SetComputerNameExA( NameType, (LPCSTR) hb_parcx( 2 ) ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINADVAPI BOOL WINAPI GetUserNameA ( OUT LPSTR lpBuffer, IN OUT LPDWORD nSize );
//
HB_FUNC( GETUSERNAME )
{
   DWORD nSize    ;
   char *szUser = hb_parcx( 1 );

   hb_retl( GetUserNameA( szUser, &nSize ) ) ;
   hb_storc( szUser , 1 ) ;
   hb_stornl( ( LONG ) nSize , 2 ) ;
}
_winsys.c772
HB_FUNCGETVERSIONEX(void)
HB_FUNC( GETVERSIONEX )
{
   BOOL bGetVer;
   OSVERSIONINFOEX osvi;
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

   bGetVer = GetVersionEx( (OSVERSIONINFO*) &osvi );

   hb_storclen( (char*) &osvi, sizeof(OSVERSIONINFOEX), 1 );
   hb_retl( bGetVer );
}

//-------------------------------------------------------------------//
//
// WINBASEAPI BOOL WINAPI VerifyVersionInfoA( IN LPOSVERSIONINFOEXA lpVersionInformation, IN DWORD dwTypeMask, IN DWORDLONG dwlConditionMask );
/*
HB_FUNC( VERIFYVERSIONINFO )
{
   LPOSVERSIONINFOEXA lpVersionInformation ;
_winsys.c789
HB_FUNCARRANGEICONICWINDOWS(void)
   hb_retl( VerifyVersionInfoA( lpVersionInformation     ,
                                (DWORD) hb_parnl( 2 )    ,
                                (DWORDLONG) hb_parnl( 3 )
                                ) ) ;
}
*/
//-------------------------------------------------------------------//
//
//         The next 3 functions should go to _WinMDI.c
//
//-------------------------------------------------------------------//
//
// WINUSERAPI UINT WINAPI ArrangeIconicWindows( IN HWND hWnd);
//
HB_FUNC( ARRANGEICONICWINDOWS )
{
   hb_retni( ArrangeIconicWindows( (HWND) hb_parnl( 1 ) ) ) ;
}


//-------------------------------------------------------------------//
//
// WINUSERAPI WORD WINAPI TileWindows( IN HWND hwndParent, IN UINT wHow, IN CONST RECT * lpRect, IN UINT cKids, IN const HWND FAR * lpKids);
//
// move to MDI
/*
HB_FUNC( TILEWINDOWS )
{
   RECT lpRect     ;

   // Your code goes here

   hb_retni( TileWindows( (HWND) hb_parnl( 1 ),
                          (UINT) hb_parni( 2 ),
                          &lpRect             ,
                          (UINT) hb_parni( 4 ),
                          (HWND) hb_parnl( 5 )
                        ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINUSERAPI WORD WINAPI CascadeWindows( IN HWND hwndParent, IN UINT wHow, IN CONST RECT * lpRect, IN UINT cKids, IN const HWND FAR * lpKids);
//
// move to MDI
//
/*
HB_FUNC( CASCADEWINDOWS )
{
   RECT lpRect     ;
_winsys.c815
HB_FUNCWINHELP(void)
   hb_retni( CascadeWindows( (HWND) hb_parnl( 1 ),
                             (UINT) hb_parni( 2 ),
                             &lpRect             ,
                             (UINT) hb_parni( 4 ),
                             (HWND) hb_parnl( 5 )
                           ) ) ;
}
*/
//-------------------------------------------------------------------//
//
// WINUSERAPI BOOL WINAPI WinHelpA( IN HWND hWndMain, IN LPCSTR lpszHelp, IN UINT uCommand, IN ULONG_PTR dwData );
//
// need to verify 4th parameter !
//
HB_FUNC( WINHELP )
{
      hb_retl( WinHelp( (HWND) hb_parnl( 1 ) ,
                     (LPCSTR) hb_parcx( 2 ),
                     (UINT) hb_parni( 3 ) ,
                     (ULONG) hb_parnl( 4 )
                   ) ) ;
}

//-------------------------------------------------------------------//
//
// HWND HtmlHelp(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData);
//
//
//  HtmlHelp( hWndCaller,        ;  // Handle of caller window, can be GetDeskTopWindow()
//            cFullPathAndTopic  )  // C:\Creative.acp\Help\VVouch.htm::default.htm
//                                  // If topic is not given, default topic will appear
//
//  HtmlHelp( GetDeskTopWindow(), 'c:\help\vvouch.chm::de_windo.htm' )
//
//  To create a .chm file, you need to work with Microsoft's
//  free HtmlHelp Workshop doanloadable from MSDN
//
/*
HB_FUNC( HTMLHELP )
{
_winsys.c868
HB_FUNCCREATEFILE(void)
 hb_retnl( (LONG) HtmlHelp( (HWND)   hb_parnl( 1 )  ,
                            (LPCSTR) hb_parcx( 2 ) ,
                            (UINT)   ISNIL(3) ? HH_DISPLAY_TOPIC : hb_parni( 3 )  ,
                            (DWORD)  ISNIL(4) ? NULL : hb_parnl( 4 )
                          )
         ) ;
}
*/
//-------------------------------------------------------------------//
/*
 HANDLE CreateFile(
  LPCTSTR lpFileName,          // pointer to name of the file
  DWORD dwDesiredAccess,       // access (read-write) mode
  DWORD dwShareMode,           // share mode
  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
                               // pointer to security attributes
  DWORD dwCreationDisposition,  // how to create
  DWORD dwFlagsAndAttributes,  // file attributes
  HANDLE hTemplateFile         // handle to file with attributes to
                               // copy
);
*/
HB_FUNC( CREATEFILE )
{

   SECURITY_ATTRIBUTES *sa = NULL;

   if( ISCHAR( 4 ) )
      sa = ( SECURITY_ATTRIBUTES *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;

   hb_retnl( (LONG) CreateFile( (LPCTSTR) hb_parcx(1),
                                (DWORD)   hb_parnl(2),
                                (DWORD)   hb_parnl(3),
                                ISCHAR( 4 ) ? (SECURITY_ATTRIBUTES *) sa : NULL ,
                                (DWORD) hb_parnl(5),
                                (DWORD) hb_parnl(6),
                                ISNIL( 7 ) ? NULL : (HANDLE) hb_parnl(7) ) ) ;

}
_winsys.c909
HB_FUNCCLOSEHANDLE(void)
HB_FUNC( CLOSEHANDLE )
{
  hb_retl( CloseHandle( (HANDLE) hb_parnl(1) ) );
}
_winsys.c949
HB_FUNCREADFILE(void)
HB_FUNC( READFILE )
{
   char * Buffer = ( char * ) hb_xgrab( hb_parnl( 3 ) ) ;
   DWORD nRead   = 0      ;
   BOOL  bRet             ;
   OVERLAPPED *Overlapped = NULL;

   if( ISCHAR( 5 ) )
      Overlapped = ( OVERLAPPED *) hb_parc( 5 ); //hb_param( 5, HB_IT_STRING )->item.asString.value ;


   bRet = ReadFile( (HANDLE) hb_parnl( 1 ) ,
                    Buffer                 ,
                    (DWORD)  hb_parnl( 3 ) ,
                    &nRead        ,
                    ISCHAR( 5 ) ? Overlapped : NULL ) ;

   if ( bRet )
   {
      hb_storclen( ( char * ) Buffer, nRead, 2 ) ;
   }

   hb_stornl( nRead, 4 ) ;
   hb_retl( bRet ) ;
}
_winsys.c960
HB_FUNCWRITEFILE(void)
HB_FUNC( WRITEFILE )
{

   DWORD nWritten = 0;
   OVERLAPPED *Overlapped = NULL;

   if( ISCHAR( 4 ))
     Overlapped = ( OVERLAPPED *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;

   hb_retl ( WriteFile( (HANDLE)  hb_parnl( 1 )   ,
                     hb_parcx( 2 )       ,
                     hb_parclen( 2 )    ,
                     &nWritten          ,
                     ISCHAR( 4 ) ? Overlapped : NULL ) ) ;

   hb_stornl( nWritten, 3 ) ;
}
_winsys.c996
HB_FUNCGETCURRENTPROCESSID(void)
HB_FUNC( GETCURRENTPROCESSID )
{
   hb_retnl( (ULONG) GetCurrentProcessId() );
}
_winsys.c1024
HB_FUNCGETCURRENTPROCESS(void)
HB_FUNC( GETCURRENTPROCESS )
{
   hb_retnl( (LONG) GetCurrentProcess() );
}
_winsys.c1033
HB_FUNCGETCURRENTTHREADID(void)
HB_FUNC( GETCURRENTTHREADID )
{
   hb_retnl( (DWORD) GetCurrentThreadId() );
}
_winsys.c1042
HB_FUNCGETPROCESSWORKINGSETSIZE(void)
HB_FUNC( GETPROCESSWORKINGSETSIZE )
{
   PSIZE_T MinimumWorkingSetSize = NULL;
   PSIZE_T MaximumWorkingSetSize = NULL;

   hb_retl(GetProcessWorkingSetSize(ISNIL(1) ? GetCurrentProcess() : (HANDLE) hb_parnl( 1 ),
                            MinimumWorkingSetSize, MaximumWorkingSetSize ));

   hb_stornl( MinimumWorkingSetSize ? ( long ) *MinimumWorkingSetSize : 0, 2 );
   hb_stornl( MaximumWorkingSetSize ? ( long ) *MaximumWorkingSetSize : 0, 3 );
}
_winsys.c1051
HB_FUNCSETPROCESSWORKINGSETSIZE(void)
HB_FUNC( SETPROCESSWORKINGSETSIZE )
{
   hb_retl(SetProcessWorkingSetSize(ISNIL(1) ? GetCurrentProcess() : (HANDLE) hb_parnl( 1 ),
                   hb_parnl( 2 ), hb_parnl( 3 ) ));
}
_winsys.c1069
HB_FUNCVIRTUALQUERY(void)
HB_FUNC( VIRTUALQUERY )
{
   if( hb_parni(1) >= sizeof(MEMORY_BASIC_INFORMATION) )
   {
      hb_retl(VirtualQuery((void *) hb_parnl(1), (struct _MEMORY_BASIC_INFORMATION *) hb_parnl(2), sizeof(MEMORY_BASIC_INFORMATION)));
   }
   else
   {
      SetLastError(ERROR_INSUFFICIENT_BUFFER);
      hb_retl(FALSE);
   }
}
_winsys.c1082
HB_FUNCVIRTUALLOCK(void)
HB_FUNC( VIRTUALLOCK )
{
   hb_retl( VirtualLock( ( void * ) hb_parnl( 1 ), hb_parni( 2 ) ) );
}
_winsys.c1100
HB_FUNCFILETIMETOSYSTEMTIME(void)
HB_FUNC( FILETIMETOSYSTEMTIME )
{
   FILETIME   *FileTime  = ( FILETIME *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value ;
   SYSTEMTIME SystemTime ;

   if ( FileTimeToSystemTime( FileTime, &SystemTime ) )
   {
      hb_retl( TRUE ) ;

      if ( ISBYREF( 2 ) )
      {
         hb_storclen( ( char * ) &SystemTime , sizeof( SYSTEMTIME ), 2 ) ;
      }
   }
   else
   {
      hb_retl( FALSE ) ;
   }
}
_winsys.c1110
HB_FUNCSETCONSOLEOUTPUTCP(void)
HB_FUNC( SETCONSOLEOUTPUTCP )
{
   hb_retl( SetConsoleOutputCP( (UINT) hb_parnl( 1 ) ) ) ;
}
_winsys.c1150
_wintab.c
TypeFunctionSourceLine
HB_FUNCTABCTRL_CREATE(void)
HB_FUNC( TABCTRL_CREATE )
{
   HWND hwnd;
   HWND hbutton;
   LONG hFont;
   LONG style;
   style = ISNIL(6) ? 0 : (LONG) hb_parnl(6);
   hwnd = (HWND) hb_parnl (1);
   hFont = SendMessage( hwnd, WM_GETFONT, 0, 0);
   hbutton = CreateWindowEx(0, WC_TABCONTROL, NULL , style, hb_parni(2), hb_parni(3) , hb_parni(4), hb_parni(5) , hwnd,NULL, GetModuleHandle(NULL) , NULL ) ;
   SendMessage(hbutton,(UINT)WM_SETFONT, (WPARAM) hFont, 1 ) ;
   hb_retnl ( (LONG) hbutton );
}
_wintab.c22
HB_FUNCTABCTRL_ADDITEM(void)
HB_FUNC( TABCTRL_ADDITEM )
{
   int iCount = TabCtrl_GetItemCount( (HWND) hb_parnl(1) );
   TC_ITEM item;

   item.mask = TCIF_TEXT | TCIF_IMAGE;
   item.iImage = ISNIL(3) ? -1 : (LONG) hb_parnl(3);
   item.pszText = (LPSTR) hb_parcx(2);

   hb_retni( TabCtrl_InsertItem( (HWND) hb_parnl(1), iCount, &item) );
}
_wintab.c40
HB_FUNCTABCTRL_INSERTITEM(void)
HB_FUNC( TABCTRL_INSERTITEM )
{
   TC_ITEM item;
   item.mask = TCIF_TEXT | TCIF_IMAGE;
   item.iImage = ISNIL(4) ? -1 : (LONG) hb_parnl(4);
   item.pszText = (LPSTR) hb_parcx(2);
   hb_retni( TabCtrl_InsertItem( (HWND) hb_parnl(1), (INT) hb_parni(3), &item) );
}
_wintab.c54
HB_FUNCTABCTRL_SETCURSEL(void)
HB_FUNC( TABCTRL_SETCURSEL )
{
   hb_retni( TabCtrl_SetCurSel( (HWND) hb_parnl(1) , hb_parni (2) ) );
}
_wintab.c65
HB_FUNCTABCTRL_GETCURSEL(void)
HB_FUNC( TABCTRL_GETCURSEL )
{
   hb_retni ( TabCtrl_GetCurSel( (HWND) hb_parnl (1) ) ) ;
}
_wintab.c72
HB_FUNCTABCTRL_GETITEM(void)
HB_FUNC( TABCTRL_GETITEM )
{
   TC_ITEM item;
   hb_retl(TabCtrl_GetItem( (HWND) hb_parnl (1), (int) hb_parni(2) , &item ) );

   // assign  item to param 3
}
_wintab.c79
HB_FUNCTABCTRL_GETITEMCOUNT(void)
HB_FUNC( TABCTRL_GETITEMCOUNT )
{
   hb_retni( TabCtrl_GetItemCount( (HWND) hb_parnl(1) ) ) ;
}
_wintab.c89
HB_FUNCTABCTRL_GETITEMRECT(void)
HB_FUNC( TABCTRL_GETITEMRECT )
{
   RECT rc;
   PHB_ITEM aRect = _itemArrayNew( 4 );
   PHB_ITEM temp;

   TabCtrl_GetItemRect((HWND) hb_parnl (1), hb_parni(2), &rc);

   temp = _itemPutNL( NULL, rc.left );
   hb_arraySet( aRect, 1, temp );
   _itemRelease( temp );

   temp = _itemPutNL( NULL, rc.top );
   hb_arraySet( aRect, 2, temp );
   _itemRelease( temp );

   temp = _itemPutNL( NULL, rc.right );
   hb_arraySet( aRect, 3, temp );
   _itemRelease( temp );

   temp = _itemPutNL( NULL, rc.bottom );
   hb_arraySet( aRect, 4, temp );
   _itemRelease( temp );

   _itemReturn( aRect );
   _itemRelease( aRect );
}
_wintab.c96
HB_FUNCTABCTRL_GETROWCOUNT(void)
HB_FUNC( TABCTRL_GETROWCOUNT )
{
   hb_retni( TabCtrl_GetRowCount( (HWND) hb_parnl(1) ) ) ;
}
_wintab.c126
HB_FUNCTABCTRL_GETIMAGELIST(void)
HB_FUNC( TABCTRL_GETIMAGELIST )
{
   hb_retnl( (LONG) TabCtrl_GetImageList( (HWND) hb_parnl(1) ) ) ;
}
_wintab.c137
HB_FUNCTABCTRL_SETIMAGELIST(void)
HB_FUNC( TABCTRL_SETIMAGELIST )
{
   hb_retnl( (LONG) TabCtrl_SetImageList( (HWND) hb_parnl( 1 ),
                    (LPARAM)(HIMAGELIST) hb_parnl( 2 ) ) ) ;
}
_wintab.c147
HB_FUNCTABCTRL_SETITEM(void)
HB_FUNC( TABCTRL_SETITEM )
{
   TC_ITEM item;
   item.mask = TCIF_TEXT | TCIF_IMAGE;
   item.iImage = -1;
   item.pszText = (LPSTR) hb_parcx( 3 );
   hb_retl( TabCtrl_SetItem( (HWND) hb_parnl( 1 ), hb_parni( 2 ), &item) ) ;
}
_wintab.c158
HB_FUNCTABCTRL_DELETEALLITEMS(void)
HB_FUNC( TABCTRL_DELETEALLITEMS )
{
   hb_retl(TabCtrl_DeleteAllItems((HWND) hb_parnl(1)));
}
_wintab.c171
HB_FUNCTABCTRL_DELETEITEM(void)
HB_FUNC( TABCTRL_DELETEITEM )
{
   hb_retl(TabCtrl_DeleteItem((HWND) hb_parnl(1), (WPARAM) hb_parni(2)));
}
_wintab.c180
HB_FUNCTABCTRL_HITTEST(void)
HB_FUNC( TABCTRL_HITTEST )
{
   TCHITTESTINFO tcht ;

   hb_parni( TabCtrl_HitTest( (HWND) hb_parnl(1), &tcht ) ) ;

   // assign to structure in param 2


}
_wintab.c191
HB_FUNCTABCTRL_SETITEMEXTRA(void)
HB_FUNC( TABCTRL_SETITEMEXTRA )
{
   hb_retl( TabCtrl_SetItemExtra( (HWND) hb_parnl(1), (int) hb_parni(2) ) ) ;
}
_wintab.c206
HB_FUNCTABCTRL_ADJUSTRECT(void)
HB_FUNC( TABCTRL_ADJUSTRECT )
{
  RECT rc;

  if ( ISARRAY(3) )
  {
     rc.left   = hb_parnl(3,1);
     rc.top    = hb_parnl(3,2);
     rc.right  = hb_parnl(3,3);
     rc.bottom = hb_parnl(3,4);

     TabCtrl_AdjustRect( (HWND) hb_parnl(1), (BOOL) hb_parl(2), &rc );

     hb_stornl( rc.left  , 3 ,1 ) ;
     hb_stornl( rc.top   , 3, 2 ) ;
     hb_stornl( rc.right , 3 ,3 ) ;
     hb_stornl( rc.bottom, 3, 4 ) ;
  }

}
_wintab.c215
HB_FUNCTABCTRL_SETITEMSIZE(void)
HB_FUNC( TABCTRL_SETITEMSIZE )
{
   hb_retnl( TabCtrl_SetItemSize( (HWND) hb_parnl(1), (int) hb_parni(2), (int) hb_parni(3) ) );
}
_wintab.c240
HB_FUNCTABCTRL_REMOVEIMAGE(void)
HB_FUNC( TABCTRL_REMOVEIMAGE )
{
  TabCtrl_RemoveImage( (HWND) hb_parnl(1), (int) hb_parni(2) ) ;
}
_wintab.c249
HB_FUNCTABCTRL_SETPADDING(void)
HB_FUNC( TABCTRL_SETPADDING )
{
   TabCtrl_SetPadding( (HWND) hb_parnl(1), (int) hb_parni(2), (int) hb_parni(3) ) ;
}
_wintab.c258
HB_FUNCTABCTRL_GETTOOLTIPS(void)
HB_FUNC( TABCTRL_GETTOOLTIPS )
{
   hb_retnl( (LONG) TabCtrl_GetToolTips( (HWND) hb_parnl( 1 ) ) );
}
_wintab.c267
HB_FUNCTABCTRL_SETTOOLTIPS(void)
HB_FUNC( TABCTRL_SETTOOLTIPS )
{
   TabCtrl_SetToolTips( (HWND) hb_parnl(1), (HWND) hb_parnl(2) ) ;
}
_wintab.c276
HB_FUNCTABCTRL_GETCURFOCUS(void)
HB_FUNC( TABCTRL_GETCURFOCUS )
{
   hb_retni( TabCtrl_GetCurFocus( (HWND) hb_parnl(1) ) );
}
_wintab.c285
HB_FUNCTABCTRL_SETCURFOCUS(void)
HB_FUNC( TABCTRL_SETCURFOCUS )
{
  TabCtrl_SetCurFocus( (HWND) hb_parnl(1), (int) hb_parni(2) );   
  hb_ret();
}
_wintab.c294
HB_FUNCTABCTRL_SETMINTABWIDTH(void)
HB_FUNC( TABCTRL_SETMINTABWIDTH )
{
   hb_retni( TabCtrl_SetMinTabWidth( (HWND) hb_parnl(1), (int) hb_parni(2) ) );
}
_wintab.c304
HB_FUNCTABCTRL_DESELECTALL(void)
HB_FUNC( TABCTRL_DESELECTALL )
{
   TabCtrl_DeselectAll( (HWND) hb_parnl(1), (UINT) hb_parni( 2 ) ) ;
}
_wintab.c313
HB_FUNCTABCTRL_HIGHLIGHTITEM(void)
HB_FUNC( TABCTRL_HIGHLIGHTITEM )
{
   hb_retl( TabCtrl_HighlightItem( (HWND) hb_parnl(1), (int) hb_parni(2), (WORD) hb_parni(3) ) );
}
_wintab.c322
HB_FUNCTABCTRL_SETEXTENDEDSTYLE(void)
HB_FUNC( TABCTRL_SETEXTENDEDSTYLE )
{
   hb_retnl( TabCtrl_SetExtendedStyle( (HWND) hb_parnl(1), (DWORD) hb_parnl(2) ) ) ;
}
_wintab.c331
HB_FUNCTABCTRL_GETEXTENDEDSTYLE(void)
HB_FUNC( TABCTRL_GETEXTENDEDSTYLE )
{
   hb_retnl( TabCtrl_GetExtendedStyle( (HWND) hb_parnl(1) ) ) ;
}
_wintab.c340
HB_FUNCTABCTRL_SETUNICODEFORMAT(void)
HB_FUNC( TABCTRL_SETUNICODEFORMAT )
{
   hb_retl( TabCtrl_SetUnicodeFormat( (HWND) hb_parnl(1), hb_parl(2) ) );
}
_wintab.c349
HB_FUNCTABCTRL_GETUNICODEFORMAT(void)
HB_FUNC( TABCTRL_GETUNICODEFORMAT )
{
   hb_retl( TabCtrl_GetUnicodeFormat( (HWND) hb_parnl(1) ) ) ;
}
_wintab.c358
_wintbar.c
TypeFunctionSourceLine
HB_FUNCCREATEMAPPEDBITMAP(void)
HB_FUNC( CREATEMAPPEDBITMAP )
{
   COLORMAP *cm = (COLORMAP *) hb_parc( 4 ); //hb_param(4, HB_IT_STRING)->item.asString.value;

   hb_retnl( (LONG) CreateMappedBitmap( (HINSTANCE) hb_parnl(1),
                                       (int) hb_parni(2),
                                       (UINT) hb_parni(3),
                                       ISNIL(4) ? NULL : (COLORMAP *) cm ,
                                       (int) hb_parni(5) ) );
}
_wintbar.c36
HB_FUNCCREATETOOLBAREX(void)
HB_FUNC( CREATETOOLBAREX )
{

   hb_retnl( (LONG) CreateToolbarEx( (HWND) hb_parnl(1),    // parent
                                     (DWORD)hb_parnl(2),      // style
                                     (UINT) hb_parni(3),      // id,
                                     (int) hb_parni(4),       // number of btn images in bmp
                                     ISNIL(5) ? NULL : (HINSTANCE) hb_parnl(5), // hInst of bmp
                                     (UINT) hb_parnl(6),      // resource id, or hBmp handle
                                     (LPCTBBUTTON) hb_parcx(7),// array of button structures
                                     (int) hb_parni(8),         // number of buttons to add
                                     (int) hb_parni(9),         // width of button
                                     (int) hb_parni(10),        // height of button
                                     (int) hb_parni(11),        // width of bitmap
                                     (int) hb_parni(12),            // height of bitmap
                                     (UINT) hb_parni(13) ) );   // size of TBBUTTON

}
_wintbar.c52
HB_FUNCGETTOOLBARITEMRECT(void)
HB_FUNC( GETTOOLBARITEMRECT )
{
   RECT    rc = {0,0,0,0};
   PHB_ITEM aRect ;
   SendMessage((HWND) hb_parnl(1), TB_GETITEMRECT, hb_parni(2), (LPARAM)&rc);
//   MapWindowPoints((HWND) hb_parnl(1), HWND_DESKTOP, (POINT*)&rc, 2);
   aRect = Rect2Array( &rc  );
   _itemReturn( aRect );
   _itemRelease( aRect );
}
_wintbar.c75
_wintext.c
TypeFunctionSourceLine
HB_FUNCTEXTOUT(void)
HB_FUNC( TEXTOUT )
{

   hb_retl( TextOut((HDC) hb_parnl( 1 )   ,   // handle of device context
                    hb_parni( 2 )         ,       // x-coordinate of starting position
                    hb_parni( 3 )         ,     // y-coordinate of starting position
                    (LPCTSTR) hb_parcx( 4 ),     // address of string
                    hb_parclen( 4 )            // number of characters in string
                   )
          );
}
//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI PolyTextOutA( IN HDC, IN CONST POLYTEXTA *, IN int);

_wintext.c37
HB_FUNCEXTTEXTOUT(void)
HB_FUNC( EXTTEXTOUT )
{
   RECT  rc    ;
   INT * lpDx = NULL;
   BOOL rcOk   ;
   UINT iCount ;
   UINT i      ;
   char * cText = hb_parcx( 6 );

   rcOk = ( ISARRAY(5) && Array2Rect(hb_param(5, HB_IT_ARRAY), &rc) ) ;

   if ( ISARRAY(7) )
   {
       iCount = hb_parinfa(7,0) ;
       lpDx = (INT *) hb_xgrab( iCount * sizeof( INT ) ) ;
       for ( i=0 ; i < iCount ; i++ )
       {
          *(lpDx+i) = hb_parni( 7,i+1) ;
       }
   }

   hb_retl( ExtTextOut( (HDC) hb_parnl( 1 )     ,
                         hb_parni( 2 )          ,
                         hb_parni( 3 )          ,
                         (UINT) hb_parni( 4 )   ,
                         rcOk ? &rc : NULL      ,
                         (LPCSTR) cText         ,
                         (UINT) strlen( cText ) ,
                         ISARRAY(7) ? lpDx : NULL
                         ) ) ;

   if (ISARRAY(7))
       hb_xfree(lpDx) ;

}
_wintext.c72
HB_FUNCDRAWTEXT(void)
HB_FUNC( DRAWTEXT )
{
   char *cText = hb_parcx( 2 );
   RECT rc;

   if ( ISARRAY( 3 ) && Array2Rect( hb_param( 3, HB_IT_ARRAY ), &rc ) )
      hb_retni( DrawText(
               (HDC) hb_parnl( 1 ),   // handle of device context
               (LPCTSTR) cText,           // address of string
               strlen( cText ),         // number of characters in string
               &rc,
               ISNIL(4) ? DT_LEFT : hb_parni( 4 ) ) ) ;
   else
      hb_retni( 0 );
}
_wintext.c114
HB_FUNCDRAWTEXTEX(void)
HB_FUNC( DRAWTEXTEX )
{
   char *cText = (char *) hb_parcx( 2 );
   RECT rc;
   DRAWTEXTPARAMS *dtp = NULL;

   if ( ISCHAR( 5 ))
      dtp = (DRAWTEXTPARAMS *) hb_parc( 5 ); //hb_param( 5, HB_IT_STRING )->item.asString.value;

   if ( ISARRAY( 3 ) && Array2Rect( hb_param( 3, HB_IT_ARRAY ), &rc ) )
      hb_retni( DrawTextEx( (HDC) hb_parnl( 1 ),     // handle of device context
                            (LPTSTR) cText    ,     // address of string
                            strlen( cText )    ,     // number of characters in string
                            (LPRECT) &rc,
                            ISNIL(4) ? DT_LEFT : hb_parni( 4 )       ,
                            ISCHAR(5) ? (LPDRAWTEXTPARAMS) dtp : NULL
                           ) ) ;
   else
      hb_retni( 0 ) ;
}
_wintext.c136
HB_FUNCTABBEDTEXTOUT(void)
HB_FUNC( TABBEDTEXTOUT )
{
   char *cText = hb_parcx( 4 );
   int iCount  ;
   int *aiTabs ;
   int i       ;

   if ( ISARRAY( 5 ) )
   {
      iCount = hb_parinfa(5,0) ;
      aiTabs = (INT *) hb_xgrab( iCount * sizeof( INT ) ) ;
      for ( i=0 ; i < iCount ; i++ )
      {
        *(aiTabs+i) = hb_parni( 5, i+1 ) ;
      }

      hb_retnl( (LONG) TabbedTextOut( (HDC) hb_parnl( 1 )  ,
                                      hb_parni( 2 )        ,
                                      hb_parni( 3 )        ,
                                      (LPCSTR) cText       ,
                                      strlen(cText)        ,
                                      iCount               ,
                                      aiTabs               ,
                                      hb_parni( 6 )
                                    ) ) ;
      hb_xfree( aiTabs ) ;

   }
   else
      hb_retnl( 0 ) ;
}
_wintext.c164
HB_FUNCGETTEXTFACE(void)
HB_FUNC( GETTEXTFACE )
{
  char *cText = (char*) hb_xgrab(MAX_PATH);
  int iRet ;

  iRet = GetTextFace( (HDC) hb_parnl( 1 ), MAX_PATH , cText );
  if ( iRet )
     hb_retclen( cText, iRet ) ;

  hb_xfree( cText ) ;

}
_wintext.c202
HB_FUNCGETTABBEDTEXTEXTENT(void)
HB_FUNC( GETTABBEDTEXTEXTENT )
{
   char *cText ;
   int iCount  ;
   int *aiTabs ;
   int i       ;

   if ( ISARRAY( 3 ) )
   {
      iCount = hb_parinfa(3,0) ;
      aiTabs = (INT *) hb_xgrab( iCount * sizeof( INT ) ) ;
      for ( i=0 ; i < iCount ; i++ )
      {
        *(aiTabs+i) = hb_parni( 3, i+1 ) ;
      }
      cText = hb_parcx( 2 );
      hb_retnl( (LONG) GetTabbedTextExtent( (HDC) hb_parnl( 1 )  ,
                                            (LPCTSTR) cText      ,
                                            strlen(cText)        ,
                                            iCount               ,
                                            aiTabs
                                          ) ) ;


      hb_xfree( aiTabs ) ;

   }
   else
      hb_retnl( 0 ) ;
}
_wintext.c223
HB_FUNCGETTEXTMETRICS(void)
HB_FUNC( GETTEXTMETRICS )
{
   TEXTMETRIC tm ;

   if ( GetTextMetrics( (HDC) hb_parnl( 1 ), &tm ) )
      hb_retclen( (char *) &tm, sizeof( TEXTMETRIC ) ) ;
}

//-----------------------------------------------------------------------------
// WINGDIAPI UINT APIENTRY GetOutlineTextMetricsA( IN HDC, IN UINT, OUT LPOUTLINETEXTMETRICA);

_wintext.c260
HB_FUNCGETTEXTEXTENTPOINT32(void)
HB_FUNC( GETTEXTEXTENTPOINT32 )
{
   char * pstr = hb_parcx(2);
   SIZE sz;
   PHB_ITEM aMetr ;

   if ( GetTextExtentPoint32( (HDC) hb_parnl(1), pstr, strlen( pstr ), &sz ) )
   {
      aMetr = Size2Array( &sz ) ;
      _itemReturn( aMetr );
      _itemRelease( aMetr );
   }

}
_wintext.c291
HB_FUNCGETBKMODE(void)
HB_FUNC( GETBKMODE )
{
   hb_retni( GetBkMode( (HDC) hb_parnl( 1 ) ) ) ;
}
_wintext.c311
HB_FUNCSETBKMODE(void)
HB_FUNC( SETBKMODE )
{
   hb_retni( SetBkMode( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_wintext.c320
HB_FUNCGETTEXTALIGN(void)
HB_FUNC( GETTEXTALIGN )
{
   hb_retni( GetTextAlign( (HDC) hb_parnl( 1 ) ) ) ;
}
_wintext.c329
HB_FUNCSETTEXTALIGN(void)
HB_FUNC( SETTEXTALIGN )
{
   hb_retni( SetTextAlign( (HDC) hb_parnl( 1 ), (UINT) hb_parni( 2 ) ) ) ;
}
_wintext.c338
HB_FUNCSETTEXTJUSTIFICATION(void)
HB_FUNC( SETTEXTJUSTIFICATION )
{
   hb_retl( SetTextJustification( (HDC) hb_parnl( 1 ),
                                  hb_parni( 2 )      ,
                                  hb_parni( 3 )
                                  ) ) ;
}
_wintext.c347
HB_FUNCGETTEXTCHARACTEREXTRA(void)
HB_FUNC( GETTEXTCHARACTEREXTRA )
{
   hb_retni( GetTextCharacterExtra( (HDC) hb_parnl( 1 ) ) ) ;
}
_wintext.c360
HB_FUNCSETTEXTCHARACTEREXTRA(void)
HB_FUNC( SETTEXTCHARACTEREXTRA )
{
   hb_retni( SetTextCharacterExtra( (HDC) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_wintext.c369
HB_FUNCGETTEXTCHARSET(void)
HB_FUNC( GETTEXTCHARSET )
{
   hb_retni( GetTextCharset( (HDC) hb_parnl( 1 ) ) ) ;
}


//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI GrayStringA( IN HDC hDC, IN HBRUSH hBrush, IN GRAYSTRINGPROC lpOutputFunc, IN LPARAM lpData, IN int nCount, IN int X, IN int Y, IN int nWidth, IN int nHeight);

// tbd

/*

HB_FUNC( GRAYSTRING )
{
   GRAYSTRINGPROC lpOutputFunc ;

   // Your code goes here

   hb_retl( GrayString( (HDC) hb_parnl( 1 )   ,
                        (HBRUSH) hb_parnl( 2 ),
                        lpOutputFunc          ,
                        (LPARAM) hb_parnl( 4 ),
                        hb_parni( 5 )         ,
                        hb_parni( 6 )         ,
                        hb_parni( 7 )         ,
                        hb_parni( 8 )         ,
                        hb_parni( 9 )
                      ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL APIENTRY GetCharABCWidthsA( IN HDC, IN UINT, IN UINT, OUT LPABC);

/*

HB_FUNC( GETCHARABCWIDTHSA )
{
   LPABC lpabc ;

   // Your code goes here

   hb_retl( GetCharABCWidthsA( (HDC) hb_parnl( 1 ) ,
                               (UINT) hb_parni( 2 ),
                               (UINT) hb_parni( 3 ),
                               lpabc
                               ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL APIENTRY GetCharABCWidthsFloatA( IN HDC, IN UINT, IN UINT, OUT LPABCFLOAT);

/*

HB_FUNC( GETCHARABCWIDTHSFLOATA )
{
   LPABCFLOAT lpabcFloat ;

   // Your code goes here

   hb_retl( GetCharABCWidthsFloatA( (HDC) hb_parnl( 1 ) ,
                                    (UINT) hb_parni( 2 ),
                                    (UINT) hb_parni( 3 ),
                                    lpabcFloat
                                    ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetCharABCWidthsI( IN HDC, IN UINT, IN UINT, IN LPWORD, OUT LPABC);

/*

HB_FUNC( GETCHARABCWIDTHSI )
{
   LPWORD lpWord ;
   LPABC  lpabc  ;

   // Your code goes here

   hb_retl( GetCharABCWidthsI( (HDC) hb_parnl( 1 ) ,
                               (UINT) hb_parni( 2 ),
                               (UINT) hb_parni( 3 ),
                               lpWord              ,
                               lpabc
                               ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI DWORD WINAPI GetCharacterPlacementA( IN HDC, IN LPCSTR, IN int, IN int, IN OUT LPGCP_RESULTSA, IN DWORD);

/*

HB_FUNC( GETCHARACTERPLACEMENTA )
{
   LPGCP_RESULTSA lpgcp_resultsa ;

   // Your code goes here

   hb_retnl( (LONG) GetCharacterPlacementA( (HDC) hb_parnl( 1 )  ,
                                            (LPCSTR) hb_parcx( 2 ),
                                            hb_parni( 3 )        ,
                                            hb_parni( 4 )        ,
                                            lpgcp_resultsa       ,
                                            (DWORD) hb_parnl( 6 )
                                            ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetCharWidth32A( IN HDC, IN UINT, IN UINT, OUT LPINT);

/*

HB_FUNC( GETCHARWIDTH32A )
{
   LPINT lpInt ;

   // Your code goes here

   hb_retl( GetCharWidth32A( (HDC) hb_parnl( 1 ) ,
                             (UINT) hb_parni( 2 ),
                             (UINT) hb_parni( 3 ),
                             lpInt
                             ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetCharWidthA( IN HDC, IN UINT, IN UINT, OUT LPINT);

/*

HB_FUNC( GETCHARWIDTHA )
{
   LPINT lpInt ;

   // Your code goes here

   hb_retl( GetCharWidthA( (HDC) hb_parnl( 1 ) ,
                           (UINT) hb_parni( 2 ),
                           (UINT) hb_parni( 3 ),
                           lpInt
                           ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL APIENTRY GetCharWidthFloatA( IN HDC, IN UINT, IN UINT, OUT PFLOAT);

/*

HB_FUNC( GETCHARWIDTHFLOATA )
{
   PFLOAT pFloat ;

   // Your code goes here

   hb_retl( GetCharWidthFloatA( (HDC) hb_parnl( 1 ) ,
                                (UINT) hb_parni( 2 ),
                                (UINT) hb_parni( 3 ),
                                pFloat
                                ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetCharWidthI( IN HDC, IN UINT, IN UINT, IN LPWORD, OUT LPINT);

/*

HB_FUNC( GETCHARWIDTHI )
{
   LPWORD lpWord ;
   LPINT  lpInt  ;

   // Your code goes here

   hb_retl( GetCharWidthI( (HDC) hb_parnl( 1 ) ,
                           (UINT) hb_parni( 2 ),
                           (UINT) hb_parni( 3 ),
                           lpWord              ,
                           lpInt
                           ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI DWORD WINAPI GetKerningPairsA( IN HDC, IN DWORD, OUT LPKERNINGPAIR);

/*

HB_FUNC( GETKERNINGPAIRSA )
{
   LPKERNINGPAIR lpkerningpair ;

   // Your code goes here

   hb_retnl( (LONG) GetKerningPairsA( (HDC) hb_parnl( 1 )  ,
                                      (DWORD) hb_parnl( 2 ),
                                      lpkerningpair
                                      ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI int WINAPI GetTextCharsetInfo( IN HDC hdc, OUT LPFONTSIGNATURE lpSig, IN DWORD dwFlags);

/*

HB_FUNC( GETTEXTCHARSETINFO )
{
   LPFONTSIGNATURE lpSig   ;

   // Your code goes here

   hb_retni( GetTextCharsetInfo( (HDC) hb_parnl( 1 )  ,
                                 lpSig                ,
                                 (DWORD) hb_parnl( 3 )
                                 ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL APIENTRY GetTextExtentExPointA( IN HDC, IN LPCSTR, IN int, IN int, OUT LPINT, OUT LPINT, OUT LPSIZE );

/*

HB_FUNC( GETTEXTEXTENTEXPOINTA )
{
   LPINT  lpInt1 ;
   LPINT  lpInt2 ;
   LPSIZE lpSize ;

   // Your code goes here

   hb_retl( GetTextExtentExPointA( (HDC) hb_parnl( 1 )  ,
                                   (LPCSTR) hb_parcx( 2 ),
                                   hb_parni( 3 )        ,
                                   hb_parni( 4 )        ,
                                   lpInt1               ,
                                   lpInt2               ,
                                   lpSize
                                   ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetTextExtentExPointI( IN HDC, IN LPWORD, IN int, IN int, OUT LPINT, OUT LPINT, OUT LPSIZE);

/*

HB_FUNC( GETTEXTEXTENTEXPOINTI )
{
   LPWORD lpWord ;
   LPINT  lpInt1 ;
   LPINT  lpInt2 ;
   LPSIZE lpSize ;

   // Your code goes here

   hb_retl( GetTextExtentExPointI( (HDC) hb_parnl( 1 ),
                                   lpWord             ,
                                   hb_parni( 3 )      ,
                                   hb_parni( 4 )      ,
                                   lpInt1             ,
                                   lpInt2             ,
                                   lpSize
                                   ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINGDIAPI BOOL APIENTRY GetTextExtentPointA( IN HDC, IN LPCSTR, IN int, OUT LPSIZE );

/*

HB_FUNC( GETTEXTEXTENTPOINTA )
{
   LPSIZE lpSize ;

   // Your code goes here

   hb_retl( GetTextExtentPointA( (HDC) hb_parnl( 1 )  ,
                                 (LPCSTR) hb_parcx( 2 ),
                                 hb_parni( 3 )        ,
                                 lpSize
                                 ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI GetTextExtentPointI( IN HDC, IN LPWORD, IN int, OUT LPSIZE);

/*

HB_FUNC( GETTEXTEXTENTPOINTI )
{
   LPWORD lpWord ;
   LPSIZE lpSize ;

   // Your code goes here

   hb_retl( GetTextExtentPointI( (HDC) hb_parnl( 1 ),
                                 lpWord             ,
                                 hb_parni( 3 )      ,
                                 lpSize
                                 ) ) ;
}

*/



//-----------------------------------------------------------------------------
// WINGDIAPI BOOL WINAPI TranslateCharsetInfo( IN OUT DWORD FAR *lpSrc, OUT LPCHARSETINFO lpCs, IN DWORD dwFlags);

_wintext.c380
_wintree.c
TypeFunctionSourceLine
HB_FUNCTVINSERTITEM(void)
HB_FUNC( TVINSERTITEM )
{
   TV_INSERTSTRUCT is;

   is.hParent      = ( HTREEITEM ) hb_parnl( 3 );
   is.hInsertAfter = TVI_LAST;

   #if (_WIN32_IE >= 0x0400) && !defined(_MSC_VER)
      is.DUMMYUNIONNAME.item.pszText = hb_parcx( 2 );
      is.DUMMYUNIONNAME.item.mask    = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
      is.DUMMYUNIONNAME.item.iImage  = hb_parnl( 4 );
      is.DUMMYUNIONNAME.item.iSelectedImage = hb_parnl( 4 );
   #else
      is.item.pszText = hb_parcx( 2 );
      is.item.mask    = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
      is.item.iImage  = hb_parnl( 4 );
      is.item.iSelectedImage = hb_parnl( 4 );
   #endif

   hb_retnl( SendMessage( ( HWND ) hb_parnl( 1 ), TVM_INSERTITEM, 0,
           ( LPARAM )( LPTV_INSERTSTRUCT )( &is ) ) );
}
_wintree.c13
HB_FUNCTVDELETEITEM(void)
HB_FUNC( TVDELETEITEM )
{
   TreeView_DeleteItem( (HWND) hb_parnl( 1 ), ( HTREEITEM ) hb_parnl( 2 ) );
}
_wintree.c36
HB_FUNCTVSETIMAGELIST(void)
HB_FUNC( TVSETIMAGELIST ) // ( hWnd, hImageList, nType )
{
   hb_retnl( ( LONG ) TreeView_SetImageList( ( HWND ) hb_parnl( 1 ),
            ( HIMAGELIST ) hb_parnl( 2 ), hb_parnl( 3 ) ) );
}
_wintree.c44
HB_FUNCTVGETSELTEXT(void)
HB_FUNC( TVGETSELTEXT ) // ( hWnd ) --> cText
{
   HWND hWnd = ( HWND ) hb_parnl( 1 );
   HTREEITEM hItem = TreeView_GetSelection( hWnd );
   TV_ITEM tvi;
   BYTE buffer[ 100 ];
   if( hItem )
   {
      tvi.mask       = TVIF_TEXT;
      tvi.hItem      = hItem;
      tvi.pszText    = ( char *)buffer;
      tvi.cchTextMax = 100;
      TreeView_GetItem( hWnd, &tvi );
      hb_retc( tvi.pszText );
   }
   else
      hb_retc( NULL );
}
_wintree.c52
HB_FUNCTVGETSELECTED(void)
HB_FUNC( TVGETSELECTED ) // ( hWnd ) --> hItem
{
   hb_retnl( ( LONG ) TreeView_GetSelection( ( HWND ) hb_parnl( 1 ) ) );
}
_wintree.c73
_winview.c
TypeFunctionSourceLine
HB_FUNCGETVIEWPORTEXTEX(void)
HB_FUNC( GETVIEWPORTEXTEX )
{
   SIZE siz ;
   PHB_ITEM aSize ;

   if ( GetViewportExtEx( (HDC) hb_parnl( 1 ), &siz ) )
   {
       aSize = Size2Array( &siz );
       _itemReturn( aSize );
       _itemRelease( aSize );
   }

}
_winview.c28
HB_FUNCGETVIEWPORTORGEX(void)
HB_FUNC( GETVIEWPORTORGEX )
{
   POINT pt ;
   PHB_ITEM aPoint;

   if (  GetViewportOrgEx( (HDC) hb_parnl( 1 ), &pt ) )
   {
      aPoint = Point2Array( &pt );
      _itemReturn( aPoint );
      _itemRelease( aPoint );
   }

}
_winview.c49
HB_FUNCGETWINDOWEXTEX(void)
HB_FUNC( GETWINDOWEXTEX )
{
   SIZE siz ;
   PHB_ITEM aSize ;

   if ( GetWindowExtEx( (HDC) hb_parnl( 1 ), &siz ) )
   {
       aSize = Size2Array( &siz );
       _itemReturn( aSize );
       _itemRelease( aSize );
   }
}
_winview.c70
HB_FUNCSCALEVIEWPORTEXTEX(void)
HB_FUNC( SCALEVIEWPORTEXTEX )
{
   SIZE siz ;
   PHB_ITEM aSize ;

   if (  ScaleViewportExtEx( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ),
                                hb_parni( 4 )    , hb_parni( 5 ), &siz  ) )
   {
       aSize = Size2Array( &siz );
       _itemReturn( aSize );
       _itemRelease( aSize );

   }
}
_winview.c90
HB_FUNCSETVIEWPORTEXTEX(void)
HB_FUNC( SETVIEWPORTEXTEX )
{
   SIZE siz ;
   PHB_ITEM aSize ;

   if ( SetViewportExtEx( (HDC) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ), &siz ) )
   {
       aSize = Size2Array( &siz );
       _itemReturn( aSize );
       _itemRelease( aSize );

   }
}
_winview.c112
HB_FUNCSETVIEWPORTORGEX(void)
HB_FUNC( SETVIEWPORTORGEX )
{
   POINT pt ;
   PHB_ITEM aPoint ;

   if ( SetViewportOrgEx( (HDC) hb_parnl( 1 ),hb_parni( 2 ), hb_parni( 3 ), &pt ) )
   {
       aPoint = Point2Array( &pt );
       _itemReturn( aPoint );
       _itemRelease( aPoint );

   }
}
_winview.c133
_winwnd.c
TypeFunctionSourceLine
HB_FUNCISICONIC(void)
HB_FUNC( ISICONIC )
{
   hb_retl( IsIconic( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c24
HB_FUNCISWINDOWVISIBLE(void)
HB_FUNC( ISWINDOWVISIBLE )
{
   hb_retl( IsWindowVisible( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c31
HB_FUNCISZOOMED(void)
HB_FUNC( ISZOOMED )
{
   hb_retl( IsZoomed( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c38
HB_FUNCISWINDOWUNICODE(void)
HB_FUNC( ISWINDOWUNICODE )
{
   hb_retl( IsWindowUnicode( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c47
HB_FUNCCLOSEWINDOW(void)
HB_FUNC( CLOSEWINDOW )
{
   hb_retl( CloseWindow( (HWND) hb_parnl(1) ) );
}
_winwnd.c56
HB_FUNCFINDWINDOW(void)
HB_FUNC( FINDWINDOW )
{

   hb_retnl((ULONG) FindWindow( (LPCSTR) hb_parcx(1), ISCHAR(2) ? hb_parcx(2):NULL ) ) ;
}
_winwnd.c63
HB_FUNCFINDWINDOWEX(void)
HB_FUNC( FINDWINDOWEX )
{
   hb_retnl( (LONG) FindWindowEx( (HWND) hb_parnl( 1 ) ,
                                  (HWND) hb_parnl( 2 ) ,
                                  (LPCSTR) hb_parcx( 3 ),
                                  (LPCSTR) hb_parcx( 4 )
                                ) ) ;
}
_winwnd.c73
HB_FUNCISCHILD(void)
HB_FUNC( ISCHILD )
{
   hb_retl( ( BOOL ) IsChild( (HWND) hb_parnl(1), (HWND) hb_parnl(2) ) ) ;
}
_winwnd.c85
HB_FUNCUPDATEWINDOW(void)
HB_FUNC( UPDATEWINDOW )
{
  hb_retl( UpdateWindow( (HWND) hb_parnl(1)) ) ;
}
_winwnd.c92
HB_FUNCGETWINDOWLONG(void)
HB_FUNC( GETWINDOWLONG )
{
   hb_retnl( GetWindowLong( (HWND) hb_parnl(1), hb_parni(2) ));
}
_winwnd.c99
HB_FUNCSETWINDOWLONG(void)
HB_FUNC( SETWINDOWLONG )
{
   hb_retnl( SetWindowLong( (HWND) hb_parnl(1), hb_parni(2), hb_parnl(3) ));
}
_winwnd.c106
HB_FUNCENABLEWINDOW(void)
HB_FUNC( ENABLEWINDOW )
{
   EnableWindow( (HWND) hb_parnl(1), hb_parl(2) ) ;
}
_winwnd.c114
HB_FUNCISWINDOWENABLED(void)
HB_FUNC( ISWINDOWENABLED )
{
   hb_retl( IsWindowEnabled( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c123
HB_FUNCDESTROYWINDOW(void)
HB_FUNC( DESTROYWINDOW )
{
   hb_retl( DestroyWindow( (HWND) hb_parnl( 1 )) );
}
_winwnd.c130
HB_FUNCISWINDOW(void)
HB_FUNC( ISWINDOW )
{
    hb_retl( IsWindow( (HWND) hb_parnl( 1 )) );
}
_winwnd.c137
HB_FUNCSHOWWINDOW(void)
HB_FUNC( SHOWWINDOW )
{
   hb_retl( ShowWindow( (HWND) hb_parnl( 1 ), hb_parni(2) ));
}
_winwnd.c144
HB_FUNCMOVEWINDOW(void)
HB_FUNC( MOVEWINDOW )
{
  hb_retl( MoveWindow(
                       (HWND) hb_parnl(1),
                       hb_parni(2),
                       hb_parni(3),
                       hb_parni(4),
                       hb_parni(5),
                       (ISNIL(6) ? TRUE : hb_parl(6))
                      ));
}
_winwnd.c149
HB_FUNCDEFWINDOWPROC(void)
HB_FUNC( DEFWINDOWPROC )
{
  hb_retnl( DefWindowProc( (HWND) hb_parnl(1), hb_parnl(2), hb_parnl(3), hb_parnl(4)));
}
_winwnd.c164
HB_FUNCDEFDLGPROC(void)
HB_FUNC( DEFDLGPROC )
{
  hb_retnl( DefDlgProc( (HWND) hb_parnl(1), hb_parnl(2), hb_parnl(3), hb_parnl(4)));
}
_winwnd.c171
HB_FUNCDEFMDICHILDPROC(void)
HB_FUNC( DEFMDICHILDPROC )
{
  hb_retnl( DefMDIChildProc( (HWND) hb_parnl(1), hb_parnl(2), hb_parnl(3), hb_parnl(4)));
}
_winwnd.c178
HB_FUNCDEFFRAMEPROC(void)
HB_FUNC( DEFFRAMEPROC )
{
  hb_retnl( DefFrameProc( (HWND) hb_parnl(1), (HWND) hb_parnl(2), hb_parnl(3), hb_parnl(4), hb_parnl(5)));
}
_winwnd.c185
HB_FUNCCALLWINDOWPROC(void)
HB_FUNC( CALLWINDOWPROC )
{
  hb_retnl( CallWindowProc( (WNDPROC) hb_parptr(1), (HWND) hb_parnl(2), hb_parni(3), hb_parnl(4), hb_parnl(5)));
}
_winwnd.c193
HB_FUNCINVALIDATERECT(void)
HB_FUNC( INVALIDATERECT )
{
   RECT rc;
   BOOL bRectOk ;

   bRectOk = ( ISARRAY( 2 )  &&   Array2Rect( hb_param(2,HB_IT_ARRAY), &rc ) ) ;

   hb_retl( InvalidateRect(
                           ISNIL(1) ? NULL : (HWND) hb_parnl( 1 )    ,  // handle of window with changed update region
                           bRectOk ? &rc : NULL ,  // address of rectangle coordinates
                           ISLOG(3) ? hb_parl( 3 ) : TRUE         // erase-background flag
                          ) );
}
_winwnd.c203
HB_FUNCREDRAWWINDOW(void)
HB_FUNC( REDRAWWINDOW )
{
   RECT rc ;
   BOOL bRectOk ;

   bRectOk = ( ISARRAY(2) && Array2Rect( hb_param(2,HB_IT_ARRAY), &rc ) ) ;

   hb_retl( RedrawWindow(
                          (HWND) hb_parnl( 1 )                     ,   // handle of window
                          bRectOk ? &rc : NULL                     ,   // address of structure with update rectangle
                          ISNIL( 3 ) ? NULL : (HRGN) hb_parnl( 3 ) ,   // handle of update region
                          hb_parni( 4 )                                // array of redraw flags
                         ) );

}
_winwnd.c221
HB_FUNCGETCLIENTRECT(void)
HB_FUNC( GETCLIENTRECT )
{
   RECT rc;

   PHB_ITEM aMetr ;
   GetClientRect( (HWND) hb_parnl( 1 ), &rc );

   aMetr = Rect2Array( &rc  );

   _itemReturn( aMetr );
   _itemRelease( aMetr );
}
_winwnd.c242
HB_FUNCGETWINDOWRECT(void)
HB_FUNC( GETWINDOWRECT )
{
   RECT rc;
   PHB_ITEM aMetr ;

   GetWindowRect( (HWND) hb_parnl( 1 ),   &rc );
   aMetr = Rect2Array( &rc  );

   _itemReturn( aMetr );
   _itemRelease( aMetr );
}
_winwnd.c260
HB_FUNCSHOWOWNEDPOPUPS(void)
HB_FUNC( SHOWOWNEDPOPUPS )
{
   hb_retl( ShowOwnedPopups( (HWND) hb_parnl( 1 ), hb_parl( 2 ) ) ) ;
}
_winwnd.c277
HB_FUNCOPENICON(void)
HB_FUNC( OPENICON )
{
   hb_retl( OpenIcon( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c286
HB_FUNCBEGINDEFERWINDOWPOS(void)
HB_FUNC( BEGINDEFERWINDOWPOS )
{
   hb_retnl( (LONG) BeginDeferWindowPos( hb_parni( 1 ) ) ) ;
}
_winwnd.c296
HB_FUNCDEFERWINDOWPOS(void)
HB_FUNC( DEFERWINDOWPOS )
{
   hb_retnl( (LONG) DeferWindowPos( (HDWP) hb_parnl( 1 ),
                                    (HWND) hb_parnl( 2 ),
                                    (HWND) hb_parnl( 3 ),
                                    hb_parni( 4 )       ,
                                    hb_parni( 5 )       ,
                                    hb_parni( 6 )       ,
                                    hb_parni( 7 )       ,
                                    (UINT) hb_parni( 8 )
                                  ) ) ;
}
_winwnd.c305
HB_FUNCENDDEFERWINDOWPOS(void)
HB_FUNC( ENDDEFERWINDOWPOS )
{
   hb_retl( EndDeferWindowPos( (HDWP) hb_parnl( 1 ) ) ) ;
}
_winwnd.c322
HB_FUNCSETWINDOWPOS(void)
HB_FUNC( SETWINDOWPOS )
{
   hb_retl( SetWindowPos( (HWND) hb_parnl( 1 ),
                          (HWND) hb_parnl( 2 ),
                          hb_parni( 3 )       ,
                          hb_parni( 4 )       ,
                          hb_parni( 5 )       ,
                          hb_parni( 6 )       ,
                          (UINT) hb_parni( 7 )
                        ) ) ;
}
_winwnd.c332
HB_FUNCSETFOCUS(void)
HB_FUNC( SETFOCUS )
{
   hb_retnl( (LONG) SetFocus( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c349
HB_FUNCGETACTIVEWINDOW(void)
HB_FUNC( GETACTIVEWINDOW )
{
   hb_retnl( (LONG) GetActiveWindow(  ) ) ;
}
_winwnd.c358
HB_FUNCSETACTIVEWINDOW(void)
HB_FUNC( SETACTIVEWINDOW )
{
   hb_retnl( (LONG) SetActiveWindow( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c368
HB_FUNCGETFOREGROUNDWINDOW(void)
HB_FUNC( GETFOREGROUNDWINDOW )
{
   hb_retnl( (LONG) GetForegroundWindow(  ) ) ;
}
_winwnd.c378
HB_FUNCGETFOCUS(void)
HB_FUNC( GETFOCUS )
{
   hb_retnl( (LONG) GetFocus(  ) ) ;
}
_winwnd.c388
HB_FUNCSETFOREGROUNDWINDOW(void)
HB_FUNC( SETFOREGROUNDWINDOW )
{
   hb_retl( SetForegroundWindow( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c398
HB_FUNCANYPOPUP(void)
HB_FUNC( ANYPOPUP )
{
   hb_retl( AnyPopup(  ) ) ;
}
_winwnd.c408
HB_FUNCBRINGWINDOWTOTOP(void)
HB_FUNC( BRINGWINDOWTOTOP )
{
   hb_retl( BringWindowToTop( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c417
HB_FUNCGETCLASSNAME(void)
HB_FUNC( GETCLASSNAME )
{
   char *cText= (char*) hb_xgrab( MAX_PATH+1 );

   GetClassName( (HWND) hb_parnl( 1 ),
                 (LPSTR) cText ,
                 MAX_PATH
                ) ;

   hb_retc( cText);
   hb_xfree( cText ) ;
}
_winwnd.c427
HB_FUNCGETTOPWINDOW(void)
HB_FUNC( GETTOPWINDOW )
{
   hb_retnl( (LONG) GetTopWindow( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c446
HB_FUNCSCROLLWINDOW(void)
HB_FUNC( SCROLLWINDOW )
{
   RECT lpRect     ;
   RECT lpClipRect ;
   Array2Rect( hb_param( 4 , HB_IT_ARRAY ) , &lpRect ) ;
   Array2Rect( hb_param( 5 , HB_IT_ARRAY ) , &lpClipRect ) ;

   hb_retl( ScrollWindow( (HWND) hb_parnl( 1 ),
                          hb_parni( 2 )       ,
                          hb_parni( 3 )       ,
                          &lpRect             ,
                          &lpClipRect
                        ) ) ;
}
_winwnd.c456
HB_FUNCSETWINDOWTEXT(void)
HB_FUNC( SETWINDOWTEXT )
{
   hb_retl( SetWindowText( (HWND) hb_parnl( 1 ), (LPSTR) hb_parcx( 2 ) ) ) ;
}
_winwnd.c476
HB_FUNCGETWINDOWTEXT(void)
HB_FUNC( GETWINDOWTEXT )
{
   int iLen = GetWindowTextLength( (HWND) hb_parnl( 1 ) )  ;
   char *cText = (char*) hb_xgrab( iLen+1 ) ;
   int iRet = GetWindowText( (HWND) hb_parnl( 1 ) ,
                            (LPSTR) cText       ,
                             iLen+1
                           ) ;

   hb_retclen( cText, iRet ) ;
   hb_xfree( cText ) ;
}
_winwnd.c486
HB_FUNCGETWINDOWTEXTLENGTH(void)
HB_FUNC( GETWINDOWTEXTLENGTH )
{
   hb_retni( GetWindowTextLength( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c503
HB_FUNCSETWINDOWCONTEXTHELPID(void)
HB_FUNC( SETWINDOWCONTEXTHELPID )
{
   hb_retl( SetWindowContextHelpId( (HWND) hb_parnl( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_winwnd.c513
HB_FUNCGETWINDOWCONTEXTHELPID(void)
HB_FUNC( GETWINDOWCONTEXTHELPID )
{
   hb_retnl( (LONG) GetWindowContextHelpId( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c522
HB_FUNCSETMENUCONTEXTHELPID(void)
HB_FUNC( SETMENUCONTEXTHELPID )
{
   hb_retl( SetMenuContextHelpId( (HMENU) hb_parnl( 1 ), (DWORD) hb_parnl( 2 ) ) ) ;
}
_winwnd.c531
HB_FUNCGETMENUCONTEXTHELPID(void)
HB_FUNC( GETMENUCONTEXTHELPID )
{
   hb_retnl( (LONG) GetMenuContextHelpId( (HMENU) hb_parnl( 1 ) ) ) ;
}
_winwnd.c540
HB_FUNCGETWINDOW(void)
HB_FUNC( GETWINDOW )
{
   hb_retnl( (LONG) GetWindow( (HWND)hb_parnl(1), (UINT) hb_parni( 2 ) ) ) ;
}


 //-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI ClientToScreen( IN HWND hWnd, IN OUT LPPOINT lpPoint);
// SYNTAX CLIENTTOSCREEN( nWhd , @aArray ) -> lSuccess
_winwnd.c549
HB_FUNCCLIENTTOSCREEN(void)
HB_FUNC( CLIENTTOSCREEN )
{
   POINT Point ;
   PHB_ITEM pArray;
   pArray=  hb_param( 2 , HB_IT_ARRAY );
   if (Array2Point( pArray ,&Point  ) )
   {
      if (ClientToScreen( (HWND) hb_parnl( 1 ), &Point ))
      {
          Point2ArrayEx( &Point   , pArray );
          hb_retl( TRUE ) ;
      }
      else
         hb_retl( FALSE ) ;
   }
      else
         hb_retl( FALSE ) ;

}


//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI ScreenToClient( IN HWND hWnd, IN OUT LPPOINT lpPoint);
// SYNTAX SCREENTOCLIENT( nWhd , @aArray ) -> lSuccess
_winwnd.c564
HB_FUNCSCREENTOCLIENT(void)
HB_FUNC( SCREENTOCLIENT )
{
   POINT Point ;
   PHB_ITEM pArray = hb_param( 2 , HB_IT_ARRAY );

   if (Array2Point(pArray, &Point ) )
   {
      if( ScreenToClient( (HWND) hb_parnl( 1 ), &Point ) >0)
      {
          Point2ArrayEx( &Point   , pArray );
          hb_retl( TRUE ) ;
      }
      else
         hb_retl( FALSE ) ;
   }
      else
         hb_retl( FALSE ) ;


}
_winwnd.c594
HB_FUNCMAPWINDOWPOINTS(void)
HB_FUNC( MAPWINDOWPOINTS )
{
   POINT lpPoints ;
   PHB_ITEM pArray =hb_param( 3 , HB_IT_ARRAY );
   Array2Point( pArray ,&lpPoints );

   hb_retni( MapWindowPoints( (HWND) hb_parnl( 1 ),
                              (HWND) hb_parnl( 2 ),
                               &lpPoints            ,
                              (UINT) hb_parni( 4 )
                            ) ) ;
          Point2ArrayEx( &lpPoints   , pArray );

}
_winwnd.c621
HB_FUNCWINDOWFROMPOINT(void)
HB_FUNC( WINDOWFROMPOINT )
{
   POINT Point ;
   Array2Point( hb_param( 1 , HB_IT_ARRAY ), &Point ) ;

   hb_retnl( (LONG) WindowFromPoint( Point ) ) ;
}
_winwnd.c643
HB_FUNCCHILDWINDOWFROMPOINT(void)
HB_FUNC( CHILDWINDOWFROMPOINT )
{
   POINT Point      ;

   Array2Point( hb_param( 2 , HB_IT_ARRAY ) ,&Point) ;

   hb_retnl( (LONG) ChildWindowFromPoint( (HWND) hb_parnl( 1 ), Point ) ) ;
}
_winwnd.c658
HB_FUNCCHILDWINDOWFROMPOINTEX(void)
HB_FUNC( CHILDWINDOWFROMPOINTEX )
{
   POINT PoInt ;

   Array2Point( hb_param( 2 , HB_IT_ARRAY ) ,&PoInt) ;

   hb_retnl( (LONG) ChildWindowFromPointEx( (HWND) hb_parnl( 1 ),
                                            PoInt               ,
                                            (UINT) hb_parni( 3 )
                                          ) ) ;
}
_winwnd.c673
HB_FUNCGETWINDOWWORD(void)
HB_FUNC( GETWINDOWWORD )
{
   hb_retni( GetWindowWord( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winwnd.c690
HB_FUNCSETWINDOWWORD(void)
HB_FUNC( SETWINDOWWORD )
{

   hb_retni( SetWindowWord( (HWND) hb_parnl( 1 ), hb_parni( 2 ), (WORD) hb_parni(3) ) ) ;
}
_winwnd.c698
HB_FUNCGETDESKTOPWINDOW(void)
HB_FUNC( GETDESKTOPWINDOW )
{
   hb_retnl( (LONG) GetDesktopWindow(  ) ) ;
}
_winwnd.c708
HB_FUNCGETPARENT(void)
HB_FUNC( GETPARENT )
{
   hb_retnl( (LONG) GetParent( (HWND) hb_parnl( 1 ) ) ) ;
}
_winwnd.c716
HB_FUNCSETPARENT(void)
HB_FUNC( SETPARENT )
{
   hb_retnl( (LONG) SetParent( (HWND) hb_parnl( 1 ), (HWND) hb_parnl( 2 ) ) ) ;
}
_winwnd.c724
HB_FUNCGETCLASSWORD(void)
HB_FUNC( GETCLASSWORD )
{
   hb_retni( GetClassWord( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winwnd.c734
HB_FUNCSETCLASSWORD(void)
HB_FUNC( SETCLASSWORD )
{

   hb_retni( SetClassWord( (HWND) hb_parnl( 1 ), hb_parni( 2 ), (WORD) hb_parni( 3 ) ) ) ;
}
_winwnd.c742
HB_FUNCGETCLASSLONG(void)
HB_FUNC( GETCLASSLONG )
{
   hb_retnl( (LONG) GetClassLong( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winwnd.c752
HB_FUNCSETCLASSLONG(void)
HB_FUNC( SETCLASSLONG )
{
   hb_retnl( (LONG) SetClassLong( (HWND) hb_parnl( 1 ),
                                  hb_parni( 2 )       ,
                                  hb_parnl( 3 )
                                ) ) ;
}
_winwnd.c760
HB_FUNCGETANCESTOR(void)
HB_FUNC( GETANCESTOR )
{
   hb_retnl( (LONG) GetAncestor( (HWND) hb_parnl( 1 ), (UINT) hb_parni( 2 ) ) ) ;
}
_winwnd.c772
HB_FUNCSHOWWINDOWASYNC(void)
HB_FUNC( SHOWWINDOWASYNC )
{
   hb_retl( ShowWindowAsync( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI FlashWindow( IN HWND hWnd, IN BOOL bInvert);
_winwnd.c783
HB_FUNCFLASHWINDOW(void)
HB_FUNC( FLASHWINDOW )
{
   hb_retl( FlashWindow( (HWND) hb_parnl( 1 ), hb_parl( 2 ) ) ) ;
}
_winwnd.c806
HB_FUNCANIMATEWINDOW(void)
HB_FUNC( ANIMATEWINDOW )
{
   hb_retl( AnimateWindow( (HWND) hb_parnl( 1 ) ,
                           (DWORD) hb_parnl( 2 ),
                           (DWORD) hb_parnl( 3 )
                         ) ) ;
}
_winwnd.c815
HB_FUNCGETWINDOWPLACEMENT(void)
HB_FUNC( GETWINDOWPLACEMENT )
{
   WINDOWPLACEMENT wndpl ;
   wndpl.length=sizeof(WINDOWPLACEMENT);
   if ( GetWindowPlacement( (HWND) hb_parnl( 1 ), &wndpl ) )
      hb_retclen( ( char *) &wndpl, sizeof(WINDOWPLACEMENT) );

}
_winwnd.c826
HB_FUNCSETWINDOWPLACEMENT(void)
HB_FUNC( SETWINDOWPLACEMENT )
{
   WINDOWPLACEMENT * lpwndpl = (WINDOWPLACEMENT *) hb_parc( 2 ); //hb_param( 2,HB_IT_STRING )->item.asString.value;


   hb_retl( SetWindowPlacement( (HWND) hb_parnl( 1 ), lpwndpl ) ) ;
}
_winwnd.c840
HB_FUNCSETWINDOWRGN(void)
HB_FUNC( SETWINDOWRGN )
{
   hb_retni( SetWindowRgn( (HWND) hb_parnl( 1 ),
                           (HRGN) hb_parnl( 2 ),
                           hb_parl( 3 )
                         ) ) ;
}
_winwnd.c852
HB_FUNCGETWINDOWRGN(void)
HB_FUNC( GETWINDOWRGN )
{
   hb_retni( GetWindowRgn( (HWND) hb_parnl( 1 ), (HRGN) hb_parnl( 2 ) ) ) ;
}
_winwnd.c863
HB_FUNCSETPROP(void)
HB_FUNC( SETPROP )
{
   hb_retl( SetProp( (HWND) hb_parnl( 1 )  ,
                     (LPCSTR) hb_parcx( 2 ) ,
                     (HANDLE) hb_parnl( 3 )
                   ) ) ;
}
_winwnd.c873
HB_FUNCGETPROP(void)
HB_FUNC( GETPROP )
{
   hb_retnl( (LONG) GetProp( (HWND) hb_parnl( 1 ), (LPCSTR) hb_parcx( 2 ) ) ) ;
}
_winwnd.c884
HB_FUNCREMOVEPROP(void)
HB_FUNC( REMOVEPROP )
{
   hb_retnl( (LONG) RemoveProp( (HWND) hb_parnl( 1 ), (LPCSTR) hb_parcx( 2 ) ) ) ;
}

//-----------------------------------------------------------------------------
// WINUSERAPI int WINAPI EnumPropsExA( IN HWND hWnd, IN PROPENUMPROCEXA lpEnumFunc, IN LPARAM lParam);


//T.B.D.

/*

HB_FUNC( ENUMPROPSEX )
{
   PROPENUMPROCEXA lpEnumFunc ;

   // Your code goes here

   hb_retni( EnumPropsEx( (HWND) hb_parnl( 1 )  ,
                          lpEnumFunc            ,
                          (LPARAM) hb_parnl( 3 )
                        ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINUSERAPI int WINAPI EnumPropsA( IN HWND hWnd, IN PROPENUMPROCA lpEnumFunc);

/*

HB_FUNC( ENUMPROPS )
{
   PROPENUMPROCA lpEnumFunc ;

   // Your code goes here

   hb_retni( EnumProps( (HWND) hb_parnl( 1 ), lpEnumFunc ) ) ;
}

*/



//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI AdjustWindowRect( IN OUT LPRECT lpRect, IN DWORD dwStyle, IN BOOL bMenu);
//SYNTAX ADJUSTWINDOWRECT(@aArray,nStyle,lMenu) -> lSuccess
_winwnd.c892
HB_FUNCADJUSTWINDOWRECT(void)
HB_FUNC( ADJUSTWINDOWRECT )
{
   RECT lpRect  ;

   PHB_ITEM pArray=hb_param(1,HB_IT_ARRAY);
   //PHB_ITEM pItem =hb_stackItemFromBase( 1 );

   if(Array2Rect(pArray,&lpRect))
   {
      if( AdjustWindowRect( &lpRect, (DWORD) hb_parnl( 2 ), hb_parl( 3 ) ) >0)
      {
         Rect2ArrayEx(&lpRect,pArray);
         hb_retl(TRUE);
      }
      else
         hb_retl(FALSE);
   }
      else
         hb_retl(FALSE);

}

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI AdjustWindowRectEx( IN OUT LPRECT lpRect, IN DWORD dwStyle, IN BOOL bMenu, IN DWORD dwExStyle);
//SYNTAX ADJUSTWINDOWRECT(@aArray,nStyle,lMenu,nStyleex) -> lSuccess
_winwnd.c947
HB_FUNCADJUSTWINDOWRECTEX(void)
HB_FUNC( ADJUSTWINDOWRECTEX )
{
   RECT lpRect    ;
   BOOL bAjust;
   PHB_ITEM pArray=hb_param(1,HB_IT_ARRAY);
   //PHB_ITEM pItem =hb_stackItemFromBase( 1 );

   Array2Rect(pArray,&lpRect);

   bAjust = AdjustWindowRectEx( &lpRect               ,
                                (DWORD) hb_parnl( 2 ),
                                hb_parl( 3 )         ,
                                (DWORD) hb_parnl( 4 )
                              )  ;
   if (bAjust)
            Rect2ArrayEx(&lpRect,pArray );

   hb_retl(bAjust);

}
_winwnd.c980
HB_FUNCGETWINDOWLONGPTR(void)
HB_FUNC( GETWINDOWLONGPTR )
{
   hb_retptr( ( void * ) GetWindowLongPtr( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winwnd.c1006
HB_FUNCSETWINDOWLONGPTR(void)
HB_FUNC( SETWINDOWLONGPTR )
{
   hb_retnl( (LONG) SetWindowLongPtr( (HWND) hb_parnl( 1 ),
                                      hb_parni( 2 )       ,
                                      ISPOINTER( 3 ) ? (LONG_PTR) hb_parptr( 3 ) : (LONG_PTR) hb_parnl( 3 )
                                    ) ) ;
}
_winwnd.c1014
HB_FUNCGETCLASSLONGPTR(void)
HB_FUNC( GETCLASSLONGPTR )
{
    hb_retnl((ULONG_PTR) GetClassLongPtr( (HWND) hb_parnl( 1 ), hb_parni( 2 ) ) ) ;
}
_winwnd.c1025
HB_FUNCSETCLASSLONGPTR(void)
HB_FUNC( SETCLASSLONGPTR )
{
   hb_retnl( (ULONG_PTR) SetClassLongPtr( (HWND) hb_parnl( 1 ), hb_parni( 2 ), (LONG_PTR) hb_parnl(3) ) ) ;
}
_winwnd.c1033
HB_FUNCGETWINDOWINFO(void)
HB_FUNC( GETWINDOWINFO )
{
   WINDOWINFO pwi ;

   if ( GetWindowInfo( (HWND) hb_parnl( 1 ), &pwi ) )

      hb_retclen( (char *) &pwi, sizeof( WINDOWINFO) ) ;

}
_winwnd.c1044
HB_FUNCGETTITLEBARINFO(void)
HB_FUNC( GETTITLEBARINFO )
{
   TITLEBARINFO pti  ;

     if ( GetTitleBarInfo( (HWND) hb_parnl( 1 ), &pti ) )

         hb_retclen( (char *) &pti, sizeof(TITLEBARINFO) );
}

#endif

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI EnumChildWindows( IN HWND hWndParent, IN WNDENUMPROC lpEnumFunc, IN LPARAM lParam);

//T.B.D

/*

HB_FUNC( ENUMCHILDWINDOWS )
{
   WNDENUMPROC lpEnumFunc ;

   // Your code goes here

   hb_retl( EnumChildWindows( (HWND) hb_parnl( 1 )  ,
                              lpEnumFunc            ,
                              (LPARAM) hb_parnl( 3 )
                            ) ) ;
}

*/

//-----------------------------------------------------------------------------
// WINUSERAPI BOOL WINAPI EnumWindows( IN WNDENUMPROC lpEnumFunc, IN LPARAM lParam);

/*

HB_FUNC( ENUMWINDOWS )
{
   WNDENUMPROC lpEnumFunc ;

   // Your code goes here

   hb_retl( EnumWindows( lpEnumFunc, (LPARAM) hb_parnl( 2 ) ) ) ;
}

*/


//-----------------------------------------------------------------------------
// WINUSERAPI UINT WINAPI RealGetWindowClassA( IN HWND hwnd, OUT LPSTR pszType, IN UINT cchType );

_winwnd.c1061
HB_FUNCREALCHILDWINDOWFROMPOINT(void)
HB_FUNC( REALCHILDWINDOWFROMPOINT )
{
   POINT ptParentClientCoords ;
   Array2Point( hb_param( 2 , HB_IT_ARRAY) , &ptParentClientCoords );

   hb_retnl( (LONG) RealChildWindowFromPoint( (HWND) hb_parnl( 1 ),
                                              ptParentClientCoords
                                            ) ) ;

}
_winwnd.c1130
HB_FUNCSETWINDOWEXTEX(void)
HB_FUNC( SETWINDOWEXTEX )
{
   SIZE lpSize ;
   PHB_ITEM pArray;

   if( SetWindowExtEx( (HDC) hb_parnl( 1 ),
                            hb_parni( 2 )      ,
                            hb_parni( 3 )      ,
                            &lpSize
                            ) >0)
     {

     pArray = Size2Array(&lpSize) ;
     _itemReturn( pArray );
     _itemRelease( pArray );

     }
}
_winwnd.c1150
HB_FUNCSETWINDOWORGEX(void)
HB_FUNC( SETWINDOWORGEX )
{
   POINT lpPoint ;
   PHB_ITEM pArray;

   if( SetWindowOrgEx( (HDC) hb_parnl( 1 ),
                            hb_parni( 2 )      ,
                            hb_parni( 3 )      ,
                            &lpPoint
                            ) >0)

   {
     pArray = Point2Array(&lpPoint) ;
     _itemReturn( pArray );
     _itemRelease( pArray );
   }
}




//-----------------------------------------------------------------------------
_winwnd.c1177
HB_FUNCCREATEMDICLIENT(void)
HB_FUNC( CREATEMDICLIENT )
{
  HWND hwndClient;
  HWND hFrame = (HWND) hb_parnl(1);
  CLIENTCREATESTRUCT clientCreate ;
  clientCreate.hWindowMenu  = (HMENU)hb_parnl(2);
  clientCreate.idFirstChild = (INT)hb_parni(3);
  hwndClient = CreateWindowEx(WS_EX_CLIENTEDGE,"MDICLIENT", NULL,WS_CHILD|WS_CLIPSIBLINGS|WS_VISIBLE,hb_parni(4), hb_parni(5), hb_parni(6), hb_parni(7), (HWND)hFrame,0,GetModuleHandle(NULL),&clientCreate);
  hb_retnl((LONG)hwndClient);
}
_winwnd.c1209
HB_FUNCSETMINMAXINFO(void)
HB_FUNC( SETMINMAXINFO )
{
  MINMAXINFO *mmi = (MINMAXINFO *) hb_parnl(1) ;
  POINT pt  ;

  pt.x = hb_parni( 3, 1 ) ;
  pt.y = hb_parni( 3, 2 ) ;

  switch (hb_parni(2)) {
    case 2:
      mmi->ptMaxSize = pt ;
      break;

    case 3:
      mmi->ptMaxPosition = pt ;
      break;

    case 4:
      mmi->ptMinTrackSize = pt ;
      break;

    case 5:
      mmi->ptMaxTrackSize = pt ;
      break;

  }

}


//-----------------------------------------------------------------------------
/*
BOOL AllowSetForegroundWindow( DWORD dwProcessId

usage:

#define ASFW_ANY    (-1)

AllowSetForegroundWindow( ASFW_ANY or GetCurrentProcessId() )

);
*/
_winwnd.c1224
HB_FUNCALLOWSETFOREGROUNDWINDOW(void)
HB_FUNC( ALLOWSETFOREGROUNDWINDOW )
{

   HINSTANCE h = LoadLibraryEx( "user32.dll", NULL, 0 );
   BOOL bASFWRet = (BOOL) FALSE ;
   DWORD dwProcessId = ISNIL( 1 ) ? ASFW_ANY : (DWORD) hb_parnl( 1 );

   if( h )
   {
      typedef BOOL (WINAPI *xbAllowSetForegroundWindow)( DWORD dwProcessId );
      xbAllowSetForegroundWindow pfnASFW = (xbAllowSetForegroundWindow)
      GetProcAddress( h, "AllowSetForegroundWindow") ;

      if( pfnASFW )
      {
         bASFWRet = (BOOL) pfnASFW( dwProcessId ) ;
      }

      FreeLibrary( h );
   }

   hb_retl( bASFWRet );
}

//-----------------------------------------------------------------------------
/*
BOOL LockSetForegroundWindow( UINT uLockCode
);
*/
/*
#if (WINVER >= 0X0500)

HB_FUNC( LOCKSETFOREGROUNDWINDOW )
{
   hb_retl( LockSetForegroundWindow( (UINT) hb_parnl( 1 ) ) );
}
_winwnd.c1283
HB_FUNCLOCKWINDOWUPDATE(void)
*/
HB_FUNC( LOCKWINDOWUPDATE )
{
   hb_retl( LockWindowUpdate( (HWND) hb_parnl( 1 ) ) );
}
_winwnd.c1320
whatutil.prg
TypeFunctionSourceLine
FUNCTIONtoUnicode( cString )
function toUnicode( cString )
   local i, cTemp := ""
   for i := 1 to len(cString)
      cTemp += substr(cString, i, 1) + chr(0)
   next
   return cTemp + chr(0)

*-----------------------------------------------------------------------------*
whatutil.prg63
FUNCTIONfromUnicode( cString )
function fromUnicode( cString )
   local i, cTemp := ""
   for i := 1 to len(cString) Step 2
      cTemp += substr(cString, i, 1)
   next
   return cTemp

*-----------------------------------------------------------------------------*
whatutil.prg73
FUNCTIONAlert( cMsg, aChoices )
Function Alert( cMsg, aChoices )

   Local aDlg, i, n, aChoose, amSG
   Local hWnd, hDC
   Local lErr := .F., w , h, t := 0, cTitle, msgh, butwidth
   Local crpos := 0, txth := 0, atm := { }
   LOCAL hFont:=CreateFont( { 8, 0, 0, 0, 700, 0, 0, 0, 0, 1, 2, 1, 34, "MS Sans Serif" } )
   LOCAL hOldFont
   LOCAL xBase

   If !ISCHARACTER( cMsg )
      IF ISARRAY( cMsg )
         cMsg:=a2str(cMsg,";")
      Else
         cMsg := asString( cMsg )
      Endif
   EndIf

   cTitle := 'Alert'

   If aChoices == NIL
      aChoices := { "&Ok" }
   EndIf

   cMsg := StrTran( cMsg, ";", CR )

   If ( crpos := at( CR, cMsg ) ) > 0
      cTitle := Left( cMsg, crpos - 1 )
      cMsg := SubStr( cMsg, crpos + 1 )
   EndIf

   hDC := GetDC( 0 )
   hOldFont := SelectObject( hDC, hFont )

* ------------- total width without buttons

   w := GetTextExtentPoint32( hDC, AllTrim( cTitle ) ) [ 1 ]

   amSG := str2a( cMsg, CR )

   AEVAL( amSG, { | X | w := Max( w, GetTextExtentPoint32( hDC, AllTrim( X ) ) [ 1 ] ) } )
   w += 20

* --------- total width of choices, also add "&" to the choices (if needed)

   n := Len( aChoices )
   aChoose := array( n )

   txth := 8 //ATM[TM_Height]
   msgh := Len( amSG ) * txth
   For i := 1 To n
      butwidth := Max( 20, GetTextExtentPoint32( hDC, aChoices[ i ] ) [ 1 ] + 20 )
      t := Max( t, butwidth )
      aChoose[ i ] := iif( at( "&", aChoices[ i ] ) == 0, "&" + aChoices[ i ] , aChoices[ i ] )
   Next i

   SelectObject( hDC, hOldFont )
   ReleaseDC( 0, hDC )
   DeleteObject( hFont )


   butwidth := t
   t *= ( n + 1 )
   w := Max( w+40, t )
   h := msgh + 33
   //w /= 2
   xBase:=LOWORD(GetDialogBaseUnits())
   w:=(w*4)/xBase


* ---------- get space between choices
   butwidth:=(butwidth*4)/xBase
   t := Max( Int( ( w - butwidth * n ) / ( n + 1 ) ) , 0 )

* ----------- create dialog

   hWnd := GetFocus( ) // default parent

   aDlg := MakeDlgTemplate( cTitle, ;
                           WS_CAPTION + DS_MODALFRAME + WS_VISIBLE + 4 + WS_POPUP + DS_SETFONT, ;
                           0, 0, w, h, 8, 'MS Sans Serif' )

   For i := 1 To n
      aDlg := AddDlgItem( aDlg, i, "BUTTON", ;
                         BS_PUSHBUTTON + WS_TABSTOP + WS_CHILD + WS_VISIBLE, ;
                         i * ( butwidth + t ) - butwidth, h - 16, butwidth, 14, ;
                         aChoose[ i ] )
   Next i


   aDlg := AddDlgItem( aDlg, "", "STATIC", ;
                      WS_BORDER + WS_CHILD + WS_VISIBLE, ;
                      0, 0, w , msgh + 14, ;
                      "" )

   aDlg := AddDlgItem( aDlg, "", "STATIC", ;
                      SS_CENTER + WS_CHILD + WS_VISIBLE, ;
                      2, 8, w - 4, msgh, ;
                      cMsg )

   MessageBeep( MB_OK )

   i := DialogBox( ,aDlg, hWnd, { | hDlg, nMsg, nwParam, nlParam | HB_SYMBOL_UNUSED( nlParam ), AlertProc( hDlg, nMsg, nwParam, nlParam ) } )

   SetFocus( hWnd )

   Return i

*----------------------------------------------------------------------------*
whatutil.prg81
FUNCTIONAlertProc( hDlg, nMsg, nwParam, nlParam )
Function AlertProc( hDlg, nMsg, nwParam, nlParam )

   HB_SYMBOL_UNUSED( nlParam )

   Do Case
   Case nMsg == WM_INITDIALOG
      CenterWindow( hDlg )
      Return( 1 )

   Case nMsg == WM_COMMAND
      EndDialog( hDlg, nwParam )

   EndCase

   Return( 0 )

*------------------------------------------------------------------------------*
whatutil.prg191
FUNCTIONCeiling( x )
Function Ceiling( x )

   Return( iif( x - Int( x ) > 0, Int( x ) + 1, x ) )


*-----------------------------------------------------------------------------*
whatutil.prg210
FUNCTIONSetIcon(hDlg,id,hicon)
Function SetIcon(hDlg,id,hicon)

  Return(SendDlgItemMessage(hDlg,id,STM_SETICON,hicon,0))

*-----------------------------------------------------------------------------*
whatutil.prg219
FUNCTIONGetIcon(hDlg,id)
Function GetIcon(hDlg,id)

  Return(SendDlgItemMessage(hDlg,id,STM_GETICON,0,0))


*------------------------------------------------------------------------------*
* uses current hDC and hFont
* returns array of lines, the cText was broken into
* assumes presence of spaces in the text !
whatutil.prg227
FUNCTIONWrapText(cText,nMaxSize,hFont)
Function WrapText(cText,nMaxSize,hFont)

  Local a:={Trim(cText)}
  Local i
  Local n
  Local c

  For i:=1 To Len(a)
    c:=""
    Do While UnMapDialogRect(a[i],hFont)[1] > nMaxSize
      If (n:=rat(' ',a[i])) > 0
        c:=SubStr(a[i],n+1)+' '+c
        a[i]:=Left(a[i],n-1)
      Else
        Exit
      EndIf
    EndDo
    If Len(c) > 0
      aAdd(a,Trim(c))
    EndIf
  Next

  Return(a)

*-----------------------------------------------------------------------------*
whatutil.prg237
FUNCTIONUnMapDialogRect(cText,hfont)
Function UnMapDialogRect(cText,hfont)

  Local nX,nY,nW,nH

  Local hDC := GetDC(0)
  Local hOldFont:=SelectObject(hDC,hFont)
  Local aTextExt:=GetTextExtentPoint32(hDC,;
  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')

  Local arect:={0,0,100,100}

  nW:=aTextExt[1]
  nH:=aTextExt[2]

  // Looks like this is what it should be (?)

  nW:=Int((Int(nW / 26) + 1)/2)
  nX:=GetTextExtentPoint32(hDC,cText)[1]
  nY:=nH

  SelectObject(hDC,hOldFont)
  ReleaseDC(0, hDC)

  Return({Ceiling(nX*4/nW),Ceiling(nY*8/nY)})


*-----------------------------------------------------------------------------*
*  CenterWindow() - Courtesy of Gerald Barber
*  Centers a window in it's parent window's client area
*  AJ modified to center within another  nominated window
*-----------------------------------------------------------------------------*
whatutil.prg263
FUNCTIONCenterWindow( hWnd, NewX, NewY, hParent )
Function CenterWindow( hWnd, NewX, NewY, hParent )

   Local aChild_[ 4 ]
   Local iCWidth
   Local iCHeight
   Local aParent_[ 4 ]
   Local aPoint_[ 2 ]

   aChild_ := GetWindowRect( hWnd )
   iCWidth := aChild_[ 3 ] - aChild_[ 1 ]
   iCHeight := aChild_[ 4 ] - aChild_[ 2 ]

   IF hparent == NIL
      hParent := GetWindow( hWnd, GW_OWNER )

      IF hParent == 0
         hParent := GetDesktopWindow()
      ENDIF
   ENDIF

   aParent_ := GetClientRect( hParent )
   aPoint_ := { ( aParent_[ 3 ] / 2 ) , ( aParent_[ 4 ] / 2 ) }
   ClientToScreen( hParent, aPoint_ )
   aPoint_[ 1 ] -= ( iCWidth / 2 )
   aPoint_[ 2 ] -= ( iCHeight / 2 )
   ScreenToClient( hParent, aPoint_ )
   aPoint_[ 1 ] := Max( 0, aPoint_[ 1 ] )
   aPoint_[ 2 ] := Max( 0, aPoint_[ 2 ] )
   ClientToScreen( hParent, aPoint_ )

   If NewX # NIL .AND. NewY # NIL
      MoveWindow( hWnd, NewX, NewY, iCWidth, iCHeight, .F. )
   Else
      MoveWindow( hWnd, aPoint_[ 1 ] , aPoint_[ 2 ] , iCWidth, iCHeight, .F. )
   EndIf

   Return( NIL )


*-----------------------------------------------------------------------------*
/*
    # DEFINE SWP_NOSIZE 1
    # DEFINE SWP_NOMOVE 2
    # DEFINE SWP_NOZORDER 4
    # DEFINE SWP_NOACTIVATE 16
*/
*-----------------------------------------------------------------------------*
whatutil.prg295
FUNCTIONSetOnTop( hDlg, nmode )
Function SetOnTop( hDlg, nmode )

   Local arect := GetWindowRect( hDlg )

   Return SetWindowPos( hDlg, nmode, ;
                        arect[ 1 ] , ;
                        arect[ 2 ] , ;
                        0, ;
                        0, ;
                        SWP_NOSIZE + SWP_NOMOVE + SWP_NOACTIVATE )

*-----------------------------------------------------------------------------*
whatutil.prg343
FUNCTIONasString( x )
Function asString( x )

   Local v := ValType( x )

   Do Case
   Case v == "C"
   Case v == "N"
      Return AllTrim( str( x ) )
   Case v == "L"
      If x
         Return ".T."
      Else
         Return ".F."
      EndIf
   Case v == "D"
      Return dtoc( x )
   Case v == "U"
      Return "NIL"
   Case v == "A"
      Return ""
   Case v == "O"
      Return x:classname()
   Case v == "B"
      Return ""
   Otherwise
      Return ""
   End Case

   Return( x )


*-----------------------------------------------------------------------------*
whatutil.prg356
FUNCTIONstr2a ( string, parser )
Function str2a ( string, parser )

   Local retar    := { }
   Local commapos := 0

   If parser == NIL
      parser := ','
   EndIf

   Do While Len( string ) > 0
      commapos := at( parser, string )
      If commapos > 0
         aAdd( retar, Left( string, commapos - 1 ) )
         string := SubStr( string, commapos + Len( parser ) )
      Else
         aAdd( retar, string )
         string := ''
      EndIf
   EndDo

   Return( retar )

*-----------------------------------------------------------------------------*
whatutil.prg389
FUNCTIONa2str( a, parser )
FUNCTION a2str( a, parser )

  LOCAL retstr := ''
  LOCAL i

  IF parser == NIL
    parser := ','
  ENDIF

  FOR i := 1 TO Len( a )
    IF i # 1
      retstr += parser
    ENDIF
    retstr += asstring( a[ i ] )
  NEXT

  RETURN( retstr )




*-----------------------------------------------------------------------------*
whatutil.prg412
STATIC FUNCTIONcTypes2aTypes(cTypes)
STATIC FUNCTION cTypes2aTypes(cTypes)

LOCAL aTypes:={}
LOCAL cType
LOCAL i,j

      ctypes:=strtran(ctypes," ","")
      cTypes:=substr(cTypes,2)
      DO While !EMPTY(cTypes)
         IF LEFT(ctypes,1)=="{"
            AADD(atypes,ctypes2atypes(@ctypes))
            cTypes:=SUBSTR(ctypes,1)
         ELSE
            if (i :=AT( ",", cTypes )) > 0
               ctype:=Left( cTypes, i - 1 )
            else
               ctype:=ctypes
            endif
            IF (j:=AT("}",ctype)) > 0

               // TBD: add multiple arrays!!

                ctype:=LEFT(ctype,j-1)
                IF !EMPTY(ctype)
                  AADD(atypes,ctype)
                endif
                cTypes := SubStr( cTypes, j + 1 )
                exit
            Endif
            if !EMPTY(cType)
               AADD(atypes,ctype)
            endif
            cTypes := SubStr( cTypes, i + 1 )
         Endif
      enddo
      RETURN(aTypes)


* ..........................................................................
whatutil.prg435
FUNCTIONArray2Bin( aValues, aTypes )
Function Array2Bin( aValues, aTypes )

   Local cRet := ""
   Local cTempRet
   Local i, j
   Local nLen := Len( aValues )
   Local nDone := 0
   Local cType
   Local xValue
   Local xType
   Local nQty := 0

   IF VALTYPE(aTypes)=="C"
     atypes:=cTypes2atypes(atypes)
   endif

   For i := 1 To nLen

      cType     := ValType( xValue := aValues[ i ] )

      If nQty == 0

         xType  := aTypes[ i ]
         If valtype( xType ) == "A"
            If cType == "A"
               If ( cTempRet := Array2Bin( xValue, xType ) ) != NIL
                  cRet += cTempRet
                  nDone ++
                  Loop
               Else
                  Return( NIL )
               EndIf
            Else
               Return( NIL )
            EndIf
         EndIf

         If ( j := AT( "[", xType ) ) > 0
            nQty := VAL( SubStr( xType, j + 1, Len( xType ) - j - 1 ) )
            xType := VAL( Left( xType, j - 1 ) )
         Else
            xType := VAL( xType )
            nQty := 1
         EndIf

      EndIf

      Do Case
      Case xType == CTYPE_SHORT .OR. xType == CTYPE_UNSIGNED_SHORT
         If !( cType == "N" )
            Return NIL
         EndIf
         cRet += W2BIN( xValue )

      Case xType == CTYPE_INT .OR. xType == CTYPE_UNSIGNED_INT
         If !( cType == "N" )
            Return NIL
         EndIf
         cRet += L2BIN( xValue )

      Case xType == CTYPE_CHAR .OR. xType == CTYPE_UNSIGNED_CHAR
         If cType == "N"
            cRet += CHR( xValue )
         ElseIf cType == "C"
            cRet += Left( xValue, nQty )
            nQty := 1
         Else
            Return NIL
         EndIf

      Case xType == CTYPE_LONG
         If cType == "N"
            cRet += L2BIN( xValue )
         ElseIf cType == "L"
            cRet += L2BIN( iif( xValue, 1, 0 ) )
         Else
            Return NIL
         EndIf

      Case xType == CTYPE_UNSIGNED_LONG
         If !( cType == "N" )
            Return NIL
         EndIf
         cRet += U2BIN( xValue )

      Case xType == CTYPE_CHAR_PTR .OR. xType == CTYPE_UNSIGNED_CHAR_PTR
         If !( cType == "C" )
            Return NIL
         EndIf
         cRet += xValue

      Case xType == CTYPE_BOOL
         If cType == "L"
            cRet += U2BIN( iif( xValue, 1, 0 ) )
         ElseIf cType == "N"
            cRet += U2BIN( xValue )
         Else
            Return NIL
         EndIf

      Case xType == CTYPE_FLOAT
         If !( cType == "N" )
            Return NIL
         EndIf
         cRet += F2BIN( xValue )

      Case xType == CTYPE_DOUBLE
         If !( cType == "N" )
            Return NIL
         EndIf
         cRet += D2BIN( xValue )

      Otherwise
         Return NIL

      EndCase

      IF --nQty ==0
        nDone ++
      endif

   Next

   Return iif( nDone == nLen, cRet, NIL )


*  ..........................................................................
whatutil.prg477
FUNCTIONBin2Array( cBin, aTypes )
Function Bin2Array( cBin, aTypes )

   Local aArr := { }
   Local nLen
   Local xType
   Local nDone := 0
   Local i := 0
   Local j
   Local nQty := 0

   IF VALTYPE(atypes)=="C"
      atypes:=ctypes2atypes(atypes)
   endif

   nLen := Len( aTypes )

   Do While nDone < nLen

      If nQty == 0

         If ++ i > Len( aTypes )
            Return( NIL )
         EndIf
         xType  := aTypes[ i ]
         If valtype( xType ) == "A"
            aAdd( aArr, Bin2Array( @cBin, xType ) )
            nDone ++
            Loop
         EndIf

         If ( j := AT( "[", xType ) ) > 0
            nQty := VAL( SubStr( xType, j + 1, Len( xType ) - j - 1 ) )
            xType := VAL( Left( xType, j - 1 ) )
         Else
            xType := VAL( xType )
            nQty := 1
         EndIf

      EndIf

      Do Case
      Case xType == CTYPE_INT .OR. xType == CTYPE_UNSIGNED_INT
         aAdd( aArr, BIN2L( cBin ) )
         cBin := SubStr( cBin, 5 )

      Case xType  == CTYPE_SHORT .OR. xType == CTYPE_UNSIGNED_SHORT
         aAdd( aArr, BIN2W( cBin ) )
         cBin := SubStr( cBin, 3 )

      Case xType == CTYPE_CHAR .OR. xType == CTYPE_UNSIGNED_CHAR
         aAdd( aArr, Left( cBin, nQty ) )
         cBin := SubStr( cBin, nQty + 1 )
         nQty := 1

      Case xType == CTYPE_LONG
         aAdd( aArr, BIN2L( cBin ) )
         cBin := SubStr( cBin, 5 )

      Case xType == CTYPE_CHAR_PTR .OR. xType == CTYPE_UNSIGNED_CHAR_PTR  // not sure
         aAdd( aArr, BIN2L( cBin ) )
         cBin := SubStr( cBin, 5 )

         /*
         AADD( aArr, LEFT( cBin, nQty )
         cBin := SUBSTR( cBin, nQty + 1 )
         */

      CASE xType == CTYPE_UNSIGNED_LONG
        aAdd( aArr, BIN2U( cBin ) )
        cBin := SubStr( cBin, 5 )

      Case xType == CTYPE_BOOL
         aAdd( aArr, iif( BIN2U( cBin ) == 0, .F., .T. ) )
         cBin := SubStr( cBin, 5 )

      Case xType == CTYPE_FLOAT
         aAdd( aArr, BIN2F( cBin ) )
         cBin := SubStr( cBin, 5 )

      Case xType == CTYPE_DOUBLE
         aAdd( aArr, BIN2D( cBin ) )
         cBin := SubStr( cBin, 9 )

      Otherwise
         Return NIL

      EndCase

      if --nQty == 0
         nDone ++
      endif

   EndDo

   Return iif( nDone == nLen, aArr, NIL )


*-----------------------------------------------------------------------------*
whatutil.prg607
FUNCTIONWinColors( nfg, nbg )
FUNCTION WinColors( nfg, nbg )

  LOCAL acolors := { ; // valueas below are PROBABLY (!) correct.
  { 'N' , RGB( 0, 0, 0 ) } , ;
  { 'B' , RGB( 0, 0, 128 ) } , ;
  { 'G' , RGB( 0, 128, 0 ) } , ;
  { 'BG' , RGB( 0, 128, 128 ) } , ;
  { 'GB' , RGB( 0, 128, 128 ) } , ;
  { 'R' , RGB( 128, 0, 0 ) } , ;
  { 'RB' , RGB( 128, 0, 128 ) } , ;
  { 'BR' , RGB( 128, 0, 128 ) } , ;
  { 'GR' , RGB( 128, 128, 0 ) } , ;
  { 'RG' , RGB( 128, 128, 0 ) } , ;
  { 'W' , RGB( 192, 192, 192 ) } , ;
  { 'N+' , RGB( 128, 128, 128 ) } , ;
  { 'B+' , RGB( 0, 0, 255 ) } , ;
  { 'G+' , RGB( 0, 255, 0 ) } , ;
  { 'BG+', RGB( 0, 255, 255 ) } , ;
  { 'GB+', RGB( 0, 255, 255 ) } , ;
  { 'R+' , RGB( 255, 0, 0 ) } , ;
  { 'RB+', RGB( 255, 0, 255 ) } , ;
  { 'BR+', RGB( 255, 0, 255 ) } , ;
  { 'GR+', RGB( 255, 255, 0 ) } , ;
  { 'RG+', RGB( 255, 255, 0 ) } , ;
  { 'W+' , RGB( 255, 255, 255 ) } }

  LOCAL ccolor := Left( setcolor( ) , at( ',', setcolor( ) ) - 1 )
  LOCAL ishibg := ( '*' $ ccolor )
  LOCAL cfg := Upper(StrTran( Left( ccolor, at( '/', ccolor ) - 1 ) , '*', '' ))
  LOCAL cbg := Upper(StrTran(SubStr( ccolor, at( '/', ccolor ) + 1 ),'*','')) + iif( ishibg, '+', '' )
  LOCAL npos := 0

  nfg := RGB( 255, 255, 255 )
  nbg := RGB( 0, 0, 0 )

  IF ( npos := aScan( acolors, { | x | x[ 1 ] == cfg } ) ) > 0
    nfg := acolors[ npos, 2 ]
  ENDIF
  IF ( npos := aScan( acolors, { | x | x[ 1 ] == cbg } ) ) > 0
    nbg := acolors[ npos, 2 ]
  ENDIF

  RETURN( NIL )

*-----------------------------------------------------------------------------*
whatutil.prg708
FUNCTIONProper(cStr)
FUNCTION Proper(cStr)

local n,ch,nLen
local c:=""
local l:=.T.

cStr:=strtran(lower(alltrim(cStr)),"_"," ")
nlen:=len(cStr)

FOR n:=1 TO nLen
   ch:=substr(cStr,n,1)
   c+=iif(l,upper(ch),ch)
   l:=(ch==" ")
NEXT

RETURN(c)
whatutil.prg754
FUNCTIONFontCreate(cFont,nSize,lBold,lItalic,lVert,lUnder)
Function FontCreate(cFont,nSize,lBold,lItalic,lVert,lUnder)
local aFont,hFont,nAngle
DEFAULT lItalic TO .F.
DEFAULT lBold   TO .T.
DEFAULT lUnder  TO .F.
DEFAULT lVert   TO .F.
nAngle:=IIF(lVert,900,0)
aFont := {nSize, 0, nAngle, nAngle, IIF(lBold,700,0), lItalic, lUnder, .F., 1, 1, 0, 0, 0, cFont}
hFont := CreateFont(aFont)
return hFont
whatutil.prg773
FUNCTIONGetMessageFont( nWeight )
FUNCTION GetMessageFont( nWeight ) // retrieves the current font used in MessageBox

   LOCAL cBuff
   LOCAL ncm IS NONCLIENTMETRICS

   ncm:cbSize := ncm:sizeof()
   cBuff := ncm:value

   SystemParametersInfo( SPI_GETNONCLIENTMETRICS, ncm:sizeof(), @cBuff, 0 )
   ncm:Buffer( cBuff )

   IF nWeight != NIL
      ncm:lfMessageFont:lfWeight := nWeight
   ENDIF

RETURN CreateFontIndirect( ncm:lfMessageFont:value )
whatutil.prg786
wincdlg.prg
TypeFunctionSourceLine
FUNCTIONFindText( hWnd, hInst, nFlags, cFindWhat, bAction)
Function FindText( hWnd, hInst, nFlags, cFindWhat, bAction)

   LOCAL nIndex
   LOCAL n
   LOCAL aDialog := _Get_aDialog()
   LOCAL aWindow := _Get_aWindow()
   LOCAL hDlg

   // register the dialog

   If  ( nIndex := aScan( aDialog, { | x | x[ 1 ] == NIL } ) ) == 0
      aAdd( aDialog, { 0, bAction, 1 } )
      nIndex := Len( aDialog )
   Else
      aDialog[ nIndex ] := { 0, bAction, 1 }  // 0 means waiting...
   EndIf                                      // 1 means modal

   // we need to add it here too, to QUIT on the last window !!!
   // note type 0

   If ( n := aScan( aWindow, { | x | x[ 1 ] == NIL } ) ) == 0
       aAdd( aWindow, { 0, WT_DIALOG, { } } )
       n := Len( aWindow )
   Else
      aWindow[ n ] := { 0, WT_DIALOG, { } }  // window 0 means waiting ...
   EndIf

   // create the dialog
   hDlg := _FindText( hWnd, hInst, nFlags, cFindWhat) //, _GetDlgProc( ) )

   // if failed to create
   If hDlg == 0
      aDialog[ nIndex ] := { NIL , NIL, NIL }
      aWindow[ n ] := { NIL , NIL , { } }
      __KillWindow( )
   EndIf

   Return( hDlg )

*-----------------------------------------------------------------------------*
wincdlg.prg25
FUNCTIONReplaceText( hWnd, hInst, nFlags, cFindWhat, cReplaceWith, bAction)
Function ReplaceText( hWnd, hInst, nFlags, cFindWhat, cReplaceWith, bAction)

   LOCAL n
   LOCAL nIndex
   LOCAL aDialog := _Get_aDialog()
   LOCAL aWindow := _Get_aWindow()
   LOCAL hDlg

   // register the dialog

   If  ( nIndex := aScan( aDialog, { | x | x[ 1 ] == NIL } ) ) == 0
      aAdd( aDialog, { 0, bAction, 1 } )
      nIndex := Len( aDialog )
   Else
      aDialog[ nIndex ] := { 0, bAction, 1 }  // 0 means waiting...
   EndIf                                      // 1 means modal

   // we need to add it here too, to QUIT on the last window !!!
   // note type 0

   If ( n := aScan( aWindow, { | x | x[ 1 ] == NIL } ) ) == 0
       aAdd( aWindow, { 0, WT_DIALOG, { } } )
       n := Len( aWindow )
   Else
      aWindow[ n ] := { 0, WT_DIALOG, { } }  // window 0 means waiting ...
   EndIf

   // create the dialog
   hDlg := _ReplaceText( hWnd, hInst, nFlags, cFindWhat,cReplaceWith ) //, _GetDlgProc( ) )

   // if failed to create
   If hDlg == 0
      aDialog[ nIndex ] := { NIL , NIL, NIL }
      aWindow[ n ] := { NIL , NIL , { } }
      __KillWindow( )
   EndIf

   Return( hDlg )


*-----------------------------------------------------------------------------*

wincdlg.prg71
FUNCTIONGetOpenFileName( hWnd, cPath, cTitle, aaFilters, nFlags, cIniDir, cDefExt, nIndex )
FUNCTION GetOpenFileName( hWnd, cPath, cTitle, aaFilters, nFlags, cIniDir, cDefExt, nIndex )

   LOCAL aFiles, cRet, cFile, x, aFilter, cFilter := "", cItem, nAt, cChar

   IF cPath == NIL
      cPath := ""
   ENDIF

   IF ValType( aaFilters ) == "A"
      FOR EACH aFilter IN aaFilters
          cFilter += aFilter[1] + Chr(0) + aFilter[2] + Chr(0)
      NEXT
   ENDIF

   IF AND(nFlags,OFN_ALLOWMULTISELECT ) > 0
      cFile := Space( 32000 )
   ELSE
      cFile := Padr( Trim( cPath ), 256, Chr(0) )
   ENDIF

   cRet := _GetOpenFileName( hWnd, @cFile, cTitle, cFilter, nFlags, cIniDir, cDefExt, @nIndex )

   IF AND( nFlags, OFN_ALLOWMULTISELECT ) > 0
      nAt := At( Chr(0) + Chr(0), cFile )

      cFile := Left( cFile, nAt )
      aFiles := {}

      IF nAt == 0 // no double chr(0) user must have pressed cancel
         RETURN( aFiles )
      ENDIF

      x := At( Chr(0), cFile ) // fist null
      cPath := Left( cFile, x )

      cFile := StrTran( cFile, cPath, "" )

      IF ! Empty(cFile) // user selected more than 1 file
         cItem := ""

         FOR EACH cChar IN cFile
             IF cChar == 0
                aAdd( aFiles, StrTran( cPath, Chr(0), "" ) + '\' + cItem )
                cItem := ""
                LOOP
             ENDIF

             cItem += cChar
         NEXT
      ELSE
         /*
         cFile:=cPath
         x:=RAT('\',cFile)
         cPath:=LEFT(cFile,x-1)
         */
         aFiles := { StrTran( cPath, CHR(0), "" ) } //STRTRAN(STRTRAN(cFile,cPath),'\')}
      ENDIF

      Return( aFiles )
   ELSE
     //cRet := Left( cRet, At( chr(0), cRet ) -1 )
   ENDIF

RETURN cRet



*-----------------------------------------------------------------------------*

wincdlg.prg135
FUNCTIONGetSaveFileName(hWnd, cFile, cTitle, aFilter, nFlags, cIniDir, cDefExt, nIndex )
FUNCTION GetSaveFileName(hWnd, cFile, cTitle, aFilter, nFlags, cIniDir, cDefExt, nIndex )
local n,c:=''
IF aFilter==nil
   aFilter:={}
END
FOR n:=1 TO LEN(aFilter)
    c+=aFilter[n][1]+chr(0)+aFilter[n][2]+chr(0)
NEXT
cFile:=_GetSaveFileName(hWnd, cFile, cTitle, c, nFlags, cIniDir, cDefExt, @nIndex )
Return(cFile)
wincdlg.prg220
wincomm.prg
TypeFunctionSourceLine
FUNCTIONCreateStatusBar(nStyle, cText, hParent, nId )
FUNCTION CreateStatusBar(nStyle, cText, hParent, nId  )
LOCAL hSBWnd
LOCAL nProc
   IF ( hSBWnd := CreateStatusWindow(nStyle, cText,hParent, nId )) != 0
      nProc:=SetProcedure(hParent, {|hWnd, nMsg, nwParam, nlParam| ;
             _SBMove( nProc, hWnd, nMsg, nwParam, nlParam, hSBWnd ) }, WM_SIZE )
   ENDIF
RETURN(hSBWnd)

*------------------------------------------------------------------------------
wincomm.prg16
STATIC FUNCTION_SBMove( nProc, hWnd, nMsg, nwParam, nlParam, hSBWnd )
Static FUNCTION  _SBMove(  nProc, hWnd, nMsg, nwParam, nlParam, hSBWnd )
   LOCAL aRect
   IF nMsg == WM_SIZE
      If IsWindow( hSBWnd )
         aRect := GetWindowRect( hSBWnd )
         MoveWindow( hSBWnd, 0, HiWord( nlParam ) - ( aRect[ 4 ] - aRect[ 2 ] ) , ;
                     LoWord( nlParam ) , aRect[ 4 ] - aRect[ 2 ] , .T. )

      Endif
   EndIf
   Return CallWindowProc( nProc, hWnd, nMsg, nwParam, nlParam )


*------------------------------------------------------------------------------
wincomm.prg29
FUNCTIONSetStatusBarParts( hSBWnd, aParts )
FUNCTION SetStatusBarParts( hSBWnd, aParts )
   LOCAL bSizes := ""
   AEVAL(aParts,{|x| bSizes+=L2BIN(x)})
   return SendMessage( hSBWnd, SB_SETPARTS, LEN( aParts ), bSizes )


*------------------------------------------------------------------------------
wincomm.prg44
FUNCTIONSetStatusBarText( hSBWnd, nPart, cText, nBorder )
FUNCTION SetStatusBarText( hSBWnd, nPart, cText, nBorder )
   nBorder:=IFNIL(nBorder,0,nBorder)
   return SendMessage( hSBWnd, SB_SETTEXT + nBorder, nPart, cText )


*------------------------------------------------------------------------------
wincomm.prg52
FUNCTIONSetStatusBkColor( hSBWnd, nPart, nColor )
FUNCTION SetStatusBkColor( hSBWnd, nPart, nColor )
   return SendMessage( hSBWnd, SB_SETBKCOLOR, nPart, nColor )


*------------------------------------------------------------------------------
wincomm.prg59
FUNCTIONSetStatusIcon( hSBWnd, nPart, hIcon )
FUNCTION SetStatusIcon( hSBWnd, nPart, hIcon )
   return SendMessage( hSBWnd, SB_SETICON, nPart, hIcon )

*------------------------------------------------------------------------------
wincomm.prg65
FUNCTIONSetStatusToolTip( hSBWnd, nPart, cTTip )
FUNCTION SetStatusToolTip( hSBWnd, nPart, cTTip )
   return SendMessage( hSBWnd, SB_SETTIPTEXT, nPart, cTTip )
wincomm.prg70
wincore.prg
TypeFunctionSourceLine
FUNCTIONWhatVersion(dDate)
FUNCTION WhatVersion(dDate)

 dDate:=stod("20020821")

 RETURN ("0.g")

*-----------------------------------------------------------------------------*
wincore.prg53
FUNCTIONRegisterClass( wndclass, nType, bAction, anWM, oObj, xCargo)
Function RegisterClass( wndclass, nType, bAction, anWM, oObj, xCargo)

   Local aAction

  // wndclass:cbSize        := LEN( wndclass:value )
   wndclass:lpfnWndProc   := 0
   wndclass:style         := iif( wndclass:style==NIL,(CS_HREDRAW + CS_VREDRAW + CS_OWNDC + CS_DBLCLKS), wndclass:style )
   wndclass:cbClsExtra    := iif( wndclass:cbClsExtra==NIL, 0, wndclass:cbClsExtra )
   wndclass:cbWndExtra    := iif( wndclass:cbWndExtra==NIL, 0, wndclass:cbWndExtra )
   wndclass:hInstance     := iif( wndclass:hInstance==NIL, GetModuleHandle(), wndclass:hInstance )
   wndclass:hIcon         := iif( wndclass:hIcon==NIL, LoadIcon(GetModuleHandle(),""), wndclass:hIcon )
   wndclass:hCursor       := iif( wndclass:hCursor==NIL, LoadCursor(, IDC_ARROW), wndclass:hCursor)
   wndclass:hbrBackground := iif( wndclass:hbrBackground==NIL, COLOR_WINDOW  + 1, wndclass:hbrBackground )
   wndclass:lpszMenuName  := iif( wndclass:lpszMenuName==NIL, "", wndclass:lpszMenuName ) ;

   IF !ISCHARACTER(wndclass:lpszClassName) .OR. EMPTY(wndclass:lpszClassName) .OR. ;
      ! _RegisterClass( wndclass:value )
      Return( .F. )
   ENDIF

   // note : _RegisterClass() function MUST add our
   //        default "C" window procedure address
   //        which will call our  __ProcessMessage() below

   If Empty( anWM )
      anWM := { 0 }
   ElseIf ValType( anWM ) == "N"
      anWM := { anWM }
   EndIf

   If !(ValType( bAction ) $ "BN")
      bAction := NIL
   EndIf

   aAction := { anWM, bAction, GetWndProc( 1 ) , 0, oObj, xCargo }
   aAdd( aClass, { WNDCLASS:lpszClassName, nType, aAction } )

   Return( .T. )


*-----------------------------------------------------------------------------*
wincore.prg66
FUNCTIONUnregisterClass( cClass, hInst )
Function UnregisterClass( cClass, hInst )

   Local n

   If ! _UnregisterClass( cClass, hInst )
      Return( .F. )
   EndIf

   If ( n := aScan( aClass, { | x | x[ 1 ] == cClass } ) ) > 0
      aDel( aClass, n )
      aSize( aClass, Len( aClass ) - 1 )
   EndIf

   Return( .T. )


*-----------------------------------------------------------------------------*
wincore.prg108
FUNCTIONCreateWindowEx( nExStyle, cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, hWndParent, hMenu, hInst , cParam )
Function CreateWindowEx( nExStyle, cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, ;
                         hWndParent, hMenu, hInst , cParam )

   Return CreateWindow( cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, ;
                        hWndParent, hMenu, hInst , cParam, nExStyle )


*-----------------------------------------------------------------------------*
wincore.prg126
FUNCTIONCreateWindow( cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, hWndParent, hMenu, hInst , cParam, nExStyle )
Function CreateWindow( cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, ;
                       hWndParent, hMenu, hInst , cParam, nExStyle )

   Local hWnd
   Local n
   Local nIndex

   // prepare a slot in aWindow array

   If ( nIndex := aScan( aWindow, { | x | x[ 1 ] == NIL } ) ) == 0  // waiting
      aAdd( aWindow, )
      nIndex := Len( aWindow )
   EndIf

   // add default class procedure address and block

   If ( n := aScan( aClass, { | x | cClass == x[ 1 ] } ) ) > 0 // own window class
      aWindow[ nIndex ] := { 0, aClass[ n, 2 ] , { } }
      If ! Empty( aClass[ n, 3 ] )                     // if default user codeblock exists
         aAdd( aWindow[ nIndex, 3 ] , aClass[ n, 3 ] )
      EndIf
   Else
      aWindow[ nIndex ] := { 0, WT_WINDOW, { } }         // no default codeblock
   EndIf

   // create a window


   If ( hWnd := _CreateWindowEx( nExStyle, cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, ;
                                 hWndParent, hMenu, hInst , cParam ) ) > 0


      If aWindow[ nIndex, 1 ] == 0
         aWindow[ nIndex, 1 ] := hWnd
      EndIf
   Else
      aWindow[ nIndex ] := { NIL, NIL, { } }
      __KillWindow( )
   EndIf

   Return( hWnd )

*-----------------------------------------------------------------------------*
wincore.prg138
FUNCTIONCreateMDIWindow( cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, hWndParent, hInst , lParam )
Function CreateMDIWindow( cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, ;
                       hWndParent, hInst , lParam )

   Local hWnd
   Local n
   Local nIndex

   // prepare a slot in aWindow array

   If ( nIndex := aScan( aWindow, { | x | x[ 1 ] == NIL } ) ) == 0  // waiting
      aAdd( aWindow, )
      nIndex := Len( aWindow )
   EndIf

   // add default class procedure address and block

   If ( n := aScan( aClass, { | x | cClass == x[ 1 ] } ) ) > 0 // own window class
      aWindow[ nIndex ] := { 0, aClass[ n, 2 ] , { } }
      If ! Empty( aClass[ n, 3 ] )                     // if default user codeblock exists
         aAdd( aWindow[ nIndex, 3 ] , aClass[ n, 3 ] )
      EndIf
   Else
      aWindow[ nIndex ] := { 0, WT_MDICHILD, { } }         // no default codeblock
   EndIf

   // create a window

   If ( hWnd := _CreateMDIWindow( cClass, cTitle, nStyle, nX, nY, nWidth, nHeight, ;
                                 hWndParent, hInst , lParam ) ) > 0

      If aWindow[ nIndex, 1 ] == 0
         aWindow[ nIndex, 1 ] := hWnd
      EndIf
   Else
      aWindow[ nIndex ] := { NIL, NIL, { } }
      __KillWindow( )
   EndIf

   Return( hWnd )

*-----------------------------------------------------------------------------*
wincore.prg184
FUNCTION_ProcessMsg( hWnd, nMsg, nwParam, nlParam, nIndex )
Function _ProcessMsg( hWnd, nMsg, nwParam, nlParam, nIndex )

   Local n
   Local i := 0
   Local anWM
   Local bProc
   Local nType := WT_WINDOW
   Local nRet := 0
   Local nProc //:=aProc[nIndex]
   Local oObj
   Local xCargo

   // setup list of possible procedures (max 10 per window )

   If aProc == NIL
      aProc := { ;
                 GetWndProc( 1 ) , ;
                 GetWndProc( 2 ) , ;
                 GetWndProc( 3 ) , ;
                 GetWndProc( 4 ) , ;
                 GetWndProc( 5 ) , ;
                 GetWndProc( 6 ) , ;
                 GetWndProc( 7 ) , ;
                 GetWndProc( 8 ) , ;
                 GetWndProc( 9 ) , ;
                 GetWndProc( 10 ) ;
               }
   EndIf

   // still in creation process ?

   If ( n := aScan( aWindow, { | x | hWnd == x[ 1 ] } ) ) == 0 //find the window
      If ( ( n := aScan( aWindow, { | x | 0 == x[ 1 ] .AND. WT_DIALOG != x[ 2 ] } ) ) > 0 )
         aWindow[ n, 1 ] := hWnd
      EndIf
   EndIf

   // find the procedure corresponding to the subclass index
   // bypass Windows procedure chain, where applicable

   nProc := aProc[ nIndex ]
   If !Empty( n )
      nType := aWindow[ n, 2 ]
      Do While ( i := aScan( aWindow[ n, 3 ] , { | x | nProc == x[ 3 ] } ) ) > 0 // does custom procedure exist ?
         anWM  := aWindow[ n, 3, i, 1 ]
         bProc := aWindow[ n, 3, i, 2 ]
         oObj  := aWindow[ n, 3, i, 5 ]
         xCargo:= aWindow[ n, 3, i, 6 ]
         If ! ( ValType( bProc ) $ "BN" .AND.  ( nMsg >= WM_USER .OR. anWM[ 1 ] == - 1 .OR. aScan( anWM, nMsg ) > 0 ) )
            If ( nProc := aWindow[ n, 3, i, 4 ] ) != 0 // old procedure exists
               If aScan( aProc, nProc ) == 0  // not our procedure
                  Return CallWindowProc( nProc, hWnd, nMsg, nwParam, nlParam ) // external
               EndIf
            Else
               i := 0 // end of the road, call default
            EndIf
         Else
            Exit  // ok, we got it
         EndIf
      EndDo

   EndIf

   // process message

   If i == 0 // no subclassed proc
      If nType == WT_MDICHILD
         nRet := DefMDIChildProc( hWnd, nMsg, nwParam, nlParam )
      ElseIf nType == WT_MDIFRAME
         nRet := DefFrameProc( hWnd, nMsg, nwParam, nlParam )
      ElseIf nType == WT_DIALOG
         nRet := DefDlgProc( hWnd, nMsg, nwParam, nlParam )
      Else  //WT_WINDOW
         nRet := DefWindowProc( hWnd, nMsg, nwParam, nlParam )
      EndIf
   Else
      If Valtype(bProc)=="N"
         nRet := HB_Exec( bProc, oObj, hWnd, nMsg, nwParam, nlParam, xCargo )
      Else
         nRet := Eval( bProc, hWnd, nMsg, nwParam, nlParam )
      Endif
   EndIf

   // remove the window from our internal list

   If nMsg == WM_NCDESTROY // last message to the window
      __KillWindow( hWnd )
   EndIf

   Return( nRet )


*-----------------------------------------------------------------------------*
wincore.prg226
FUNCTION__KillWindow( hWnd )
Function __KillWindow( hWnd )

   Local n

   If hWnd != NIL .AND. ( n := aScan( aWindow, { | x | hWnd == x[ 1 ] } ) ) > 0
      aWindow[ n ] := { NIL, NIL, { } }
   EndIf

   If aScan( aWindow, { | x | ! Empty( x[ 1 ] ) } ) == 0
      PostQuitMessage( 0 )
   EndIf

   Return( NIL )


*-----------------------------------------------------------------------------*
wincore.prg323
FUNCTION_ProcessDlgMsg( hDlg, nMsg, nwParam, nlParam )
Function _ProcessDlgMsg( hDlg, nMsg, nwParam, nlParam )

   Local nIndex := 0
   Local nResult
   Local n := 0

   If ( ( nIndex := aScan( aDialog, { | x | hDlg == x[ 1 ] } ) ) == 0 )
      If ( ( nIndex := aScan( aDialog, { | x | 0 == x[ 1 ] } ) ) == 0 )
         Return( 0 )
      Else
         aDialog[ nIndex, 1 ] := hDlg
         If ( ( n := aScan( aWindow, { | x | 0 == x[ 1 ] .AND. WT_DIALOG == x[ 2 ] } ) ) > 0 )
            aWindow[ n ] := { hDlg, WT_DIALOG, { } }
         EndIf
      EndIf
   EndIf

   nResult := iif( ValType(aDialog[ nIndex, 2 ]) == "B", ;
                  eval( aDialog[ nIndex, 2 ] , hDlg, nMsg, nwParam, nlParam ),;
                  iif(Valtype(aDialog[ nIndex, 2 ])=="N", ;
                     HB_Exec( aDialog[ nIndex,2 ], aDialog[ nIndex, 4], hDlg, nMsg, nwParam, nlParam, aDialog[ nIndex, 5 ]  ),;
                     0 );
                )

   If nMsg == WM_NCDESTROY
      aDialog[ nIndex ] := { NIL , NIL , NIL, NIL, NIL }
      If ( n := aScan( aWindow, { | x | hDlg == x[ 1 ] .AND. WT_DIALOG == x[ 2 ] .AND. Empty( x[ 3 ] ) } ) ) > 0
         __KillWindow( hDlg )
      EndIf
   EndIf

   Return( nResult )


*-----------------------------------------------------------------------------*
wincore.prg343
FUNCTIONDialogBox( hInst, acnDlg, hWnd, bAction, oObj, xCargo )
Function DialogBox( hInst, acnDlg, hWnd, bAction, oObj, xCargo )

   Local nResult := 0
   Local nIndex
   Local cTemplate

   If !(ValType( bAction ) $ "BN")
      Return( - 1 )
   EndIf

   // register the dialog

   If  ( nIndex := aScan( aDialog, { | x | x[ 1 ] == NIL } ) ) == 0
      aAdd( aDialog, { 0, bAction, 1, oObj, xCargo } )
      nIndex := Len( aDialog )
   Else
      aDialog[ nIndex ] := { 0, bAction, 1, oObj, xCargo }  // 0 means waiting...
   EndIf                                                    // 1 means modal

   // create the template from the array

   If ValType( acnDlg ) == "A"

      cTemplate := _MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ;
                                     acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ;
                                     acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] )

      nResult := _DialogBoxIndirect( hInst, cTemplate, hWnd, _GetDlgProc( ) )
   Else
      nResult := _DialogBox( hInst, acnDlg, hWnd, _GetDlgProc( ) )
   EndIf

   aDialog[ nIndex ] := { NIL , NIL , NIL, NIL, NIL }    // unused

   Return( nResult )



*-----------------------------------------------------------------------------*
wincore.prg379
FUNCTION_Get_aDialog()
FUNCTION _Get_aDialog()

  RETURN(aDialog)

*-----------------------------------------------------------------------------*
wincore.prg421
FUNCTION_Get_aWindow()
FUNCTION _Get_aWindow()

  RETURN(aWindow)

*-----------------------------------------------------------------------------*
wincore.prg429
FUNCTIONMakeDlgTemplate( cTitle, nStyle , x, y, nWidth, nHeight, nPointSize, cFaceName, nWeight, lItalic, nHelpId, nExStyle )
FUNCTION MakeDlgTemplate( cTitle, nStyle , x, y, nWidth, nHeight, nPointSize, ;
                          cFaceName, nWeight, lItalic, nHelpId, nExStyle )


   // Prepare the template array
   // Element 1: dialog template
   // Elements 2-12: Properties of an item (each elemet - different property)


  LOCAL aDlg := { { } , { } , { } , { } , { } , { } , { } , { } , { } , { } , { } , { } }

   //aAdd(aDlg[1],1)       // add in C
   //aAdd(aDlg[1],0xFFFF)  // add in C


   // style
   If !ISNUMERIC( nStyle ) // nStyle
      nStyle := 0
      //   acnDlg:=DS_SETFONT
      //elseif AND(acnDlg,DS_SETFONT)==0
      //  acnDlg+=DS_SETFONT
   EndIf

   // But the programming interface and the result is the same.

   aAdd( aDlg[ 1 ] , iif( Empty( nHelpId ) , 0, nHelpId ) )   // new
   aAdd( aDlg[ 1 ] , iif( Empty( nExStyle ) , 0, nExStyle ) ) // new
   aAdd( aDlg[ 1 ] , nStyle ) // nStyle
   aAdd( aDlg[ 1 ] , 0 ) // no. of items
   aAdd( aDlg[ 1 ] , x )
   aAdd( aDlg[ 1 ] , y )
   aAdd( aDlg[ 1 ] , nWidth )
   aAdd( aDlg[ 1 ] , nHeight )
   aAdd( aDlg[ 1 ] , 0 ) // no menu ? pity, maybe I'll add later
   aAdd( aDlg[ 1 ] , 0 ) // default windows class
   aAdd( aDlg[ 1 ] , iif( ValType( cTitle ) == "C", cTitle, "" ) )

   If AND( nStyle, DS_SETFONT ) == DS_SETFONT
      aAdd( aDlg[ 1 ] , iif( ValType( nPointSize ) == "N", nPointSize, 8 ) )
      aAdd( aDlg[ 1 ] , iif( ValType( nWeight ) == "N", nWeight, 400 ) )
      aAdd( aDlg[ 1 ] , iif( ValType( lItalic ) == "L", lItalic, .F. ) )
      aAdd( aDlg[ 1 ] , iif( ValType( cFaceName ) == "C", cFaceName, "MS Sans Serif" ) )
   EndIf

   Return( aDlg )

*-----------------------------------------------------------------------------*
wincore.prg435
FUNCTIONCreateDialog( hInst, acnDlg , hWnd, bAction, oObj, xCargo )
Function CreateDialog( hInst, acnDlg , hWnd, bAction, oObj, xCargo )

   Local nIndex
   Local hDlg
   Local cTemplate
   Local n

      If !(ValType( bAction ) $ "BN")
         Return( 0 )
      EndIf

      // prepare aDialog entry

      If ( nIndex := aScan( aDialog, { | x | x[ 1 ] == NIL } ) ) == 0
         aAdd( aDialog, { 0 , bAction, 0, oObj, xCargo } )    // must add before CreateDialog
         nIndex := Len( aDialog )
      Else
         aDialog[ nIndex ] := { 0, bAction, 0, oObj, xCargo }  // window 0 means waiting ...
      EndIf                                                    // type 0 means modeless

      // we need to add it here too, to QUIT on the last window !!!
      // note type 0

      If ( n := aScan( aWindow, { | x | x[ 1 ] == NIL } ) ) == 0
         aAdd( aWindow, { 0, WT_DIALOG, { } } )
         n := Len( aWindow )
      Else
         aWindow[ n ] := { 0, WT_DIALOG, { } }  // window 0 means waiting ...
      EndIf

      // create the dialog

      If ValType( acnDlg ) == "A"
         // create the template from the array
         cTemplate := _MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ;
                                        acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ;
                                        acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] )

         hDlg := _CreateDialogIndirect( hInst, cTemplate, hWnd, _GetDlgProc( ) )
      Else
         hDlg := _CreateDialog( hInst, acnDlg, hWnd, _GetDlgProc( ) )
      EndIf

      // if failed to create
      If hDlg == 0
         aDialog[ nIndex ] := { NIL , NIL, NIL, NIL, NIL }
         aWindow[ n ] := { NIL , NIL , { } }
         __KillWindow( )
      EndIf

      Return( hDlg )


*-----------------------------------------------------------------------------*
wincore.prg483
FUNCTIONAddDlgItem( aDlg, cnId, cnDlgClass, nStyle, nX, nY, nWidth, nHeight, cText, nHelpId, nExStyle, cData )
Function AddDlgItem( aDlg, cnId, cnDlgClass, nStyle, nX, nY, ;
                       nWidth, nHeight, cText, nHelpId, nExStyle, cData )

   HB_SYMBOL_UNUSED( cData )

   aDlg[ 1, 4 ] ++ // item count

   aAdd( aDlg[ 2 ] ,  iif( ValType( nHelpId ) == "N", nHelpId, 0 ) )
   aAdd( aDlg[ 3 ] ,  iif( ValType( nExStyle ) == "N", nExStyle, 0 ) )
   aAdd( aDlg[ 4 ] ,  iif( ValType( nStyle ) == "N", nStyle, WS_CHILD + WS_VISIBLE ) )
   aAdd( aDlg[ 5 ] ,  nX )
   aAdd( aDlg[ 6 ] ,  nY )
   aAdd( aDlg[ 7 ] ,  nWidth )
   aAdd( aDlg[ 8 ] ,  nHeight )
   aAdd( aDlg[ 9 ] ,  cnId )
   aAdd( aDlg[ 10 ] , cnDlgClass )
   aAdd( aDlg[ 11 ] , iif( ISCHARACTER( cText ), cText, iif( ISNUMERIC( cText ), cText, "" ) ) )
   aAdd( aDlg[ 12 ] , 0 )    // cData

   Return aDlg


*-----------------------------------------------------------------------------*
wincore.prg538
FUNCTIONSetProcedure( hWnd, bAction, anWM, oObj, xCargo )
Function SetProcedure( hWnd, bAction, anWM, oObj, xCargo )

   Local nProc := 0
   Local i, n
   Local nOldProc := 0

   // setup list of possible procedures (max 10 per window )

   If aProc == NIL
      aProc := { ;
                 GetWndProc( 1 ) , ;
                 GetWndProc( 2 ) , ;
                 GetWndProc( 3 ) , ;
                 GetWndProc( 4 ) , ;
                 GetWndProc( 5 ) , ;
                 GetWndProc( 6 ) , ;
                 GetWndProc( 7 ) , ;
                 GetWndProc( 8 ) , ;
                 GetWndProc( 9 ) , ;
                 GetWndProc( 10 ) ;
               }
   EndIf

   // make sure the window is in the array

   If IsWindow( hWnd )
      If ( n := aScan( aWindow, { | x | hWnd == x[ 1 ] } ) ) == 0
         If ( n := aScan( aWindow, { | x | x[ 1 ] == NIL } ) ) == 0
            aAdd( aWindow, )
            n := Len( aWindow )
         EndIf
         aWindow[ n ] := { hWnd, WT_WINDOW, { } }
      EndIf

      // get a unique procedure address

      nOldProc := GetWindowLong( hWnd, GWL_WNDPROC )
      For i := 1 To 10
         If aProc[ i ] != nOldProc
            If aScan( aWindow[ n, 3 ] , { | x | x[ 3 ] == aProc[ i ] .OR. x[ 4 ] == aProc[ i ] } ) == 0
               nProc := aProc[ i ]
               Exit
            EndIf
         EndIf
      Next

      If !Empty( nProc )
         SetWindowLongPtr( hWnd, GWL_WNDPROC, nProc )
         If Empty( anWM )
            anWM := { 0 }
         ElseIf ValType( anWM ) == "N"
            anWM := { anWM }
         EndIf

         If !(ValType( bAction ) $ "BN")
            bAction := NIL
         EndIf
         aAdd( aWindow[ n, 3 ] , { anWM, bAction, nProc, nOldProc, oObj, xCargo } )
      EndIf

   EndIf

   Return( nOldProc )


*-----------------------------------------------------------------------------*
wincore.prg562
FUNCTIONResetProcedure( hWnd, nProc )
Function ResetProcedure( hWnd, nProc )

   Local n, i
   Local lRet := .F.

   If ( n := aScan( aWindow, { | x | hWnd == x[ 1 ] } ) ) > 0 //find the window
      If !ISNUMERIC( nProc ) .OR. nProc == 0  // unsubclass all

         If Len( aWindow[ n, 3 ] ) > 0 // is subclassed
            If aWindow[ n, 3, 1, 4 ] == 0
               nProc := aWindow[ n, 3, 1, 3 ]
               aSize( aWindow[ n, 3 ] , 1 ) // class procedure must stay
            Else
               nProc := aWindow[ n, 3, 1, 4 ]
               aSize( aWindow[ n, 3 ] , 0 )
            EndIf
            If nProc != 0
               SetWindowLongPtr( hWnd, GWL_WNDPROC, nProc )
               lRet := .T.
            EndIf
         EndIf

      Else

         If ( i := aScan( aWindow[ n, 3 ] , { | x | x[ 4 ] == nProc } ) ) > 0
            Do While Len( aWindow[ n, 3 ] ) >= i
               aDel( aWindow[ n, 3 ] , i )
               aSize( aWindow[ n, 3 ] , Len( aWindow[ n, 3 ] ) - 1 )
            EndDo
            SetWindowLongPtr( hWnd, GWL_WNDPROC, nProc )
            lRet := .T.
         EndIf

      EndIf
   EndIf

   Return( lRet )


*-----------------------------------------------------------------------------*
wincore.prg629
FUNCTIONWinProcCount( hWnd, nProc )
Function WinProcCount( hWnd, nProc )

   Local n, i
   Local nRet := 0

   If ( n := aScan( aWindow, { | x | hWnd == x[ 1 ] } ) ) > 0 //find the window
      If !ISNUMERIC( nProc ) .OR. nProc == 0
         nRet := Max( 0, Len( aWindow[ n, 3 ] ) - 1 )
      Else
         If ( i := aScan( aWindow[ n, 3 ] , { | x | x[ 3 ] == nProc } ) ) > 0
            nRet := Max( 0, i - 1 )
         EndIf
      EndIf
   EndIf

   Return( nRet )


*-----------------------------------------------------------------------------*
wincore.prg670
FUNCTIONSelectWindow( hNewWnd )
Function SelectWindow( hNewWnd )

   Local hOldActive := hWndActive

   If hNewWnd != NIL .AND. IsWindow( hNewWnd )
      hWndActive := hNewWnd
   EndIf

   Return( hOldActive )


*------------------------------------------------------------------------------
wincore.prg690
FUNCTIONisDialogMessage( hDlg, cMsg )
Function isDialogMessage( hDlg, cMsg )

   If hDlg == NIL
     Return ( aScan( aDialog, {|x| 0 == x[ 3 ] .AND. _isDialogMessage( x[ 1 ], cMsg ) } ) > 0 )
   Endif

   Return( isDialogMessage(hDlg, cMsg ) )
wincore.prg703
windebug.prg
TypeFunctionSourceLine
FUNCTION_trace(c)
function _trace(c)

   local cn

   if valtype(c)=='C'
     cn:=c //:classname()
   endif


   OutputDebugString(iif(empty(cn),'',cn+':')+procname(1)+'('+alltrim(str(procline(1)))+')'+;
   ' <- '+procname(2)+'('+alltrim(str(procline(2)))+')'+;
   ' <- '+procname(3)+'('+alltrim(str(procline(3)))+')'+;
   ' <- '+procname(4)+'('+alltrim(str(procline(4)))+')'+;
   ' <- '+procname(5)+'('+alltrim(str(procline(5)))+')'+;
   CRLF)

   return(NIL)



*------------------------------------------------------------------------------*
* PARAM is used here on purpose to allow for macro expansion of the
* parameters which are passed here as private !!!!!!!!!
*------------------------------------------------------------------------------*
windebug.prg14
FUNCTION_DVIEW
FUNCTION _DVIEW
   PARAM p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18

   LOCAL no_of_param, x, dbg_array, description, half

   no_of_param := PCOUNT( )
   half := no_of_param / 2

   OutputDebugString( '------------------------------' +CRLF)
   BEGIN SEQUENCE
      FOR x := 1 TO half
         dbg_array := "p" + lTrim( STR( x, 2, 0 ) )
         description := "p" + lTrim( STR( x + half, 2, 0 ) )
         DLIST( &dbg_array, &description )
      NEXT
   END

   RETURN NIL

*------------------------------------------------------------------------------*
windebug.prg38
STATIC FUNCTIONDLIST( dbg_array, description )
STATIC FUNCTION DLIST( dbg_array, description )
*------------------------------------------------------------------------------*
   LOCAL heading, x, a_len, data_type, value

   IF ValType( dbg_array ) $ 'AOS'
      a_len := Len( dbg_array )
      DQOUT( '     Array:', description, '', iif( a_len == 0, '', dbg_array ) , Len( dbg_array ) )
      FOR x := 1 TO a_len
         heading := description + "[" + STR( x, 3, 0 ) + "]"
         data_type := ValType( dbg_array[ x ] )
         value := dbg_array[ x ]
         DSINGLE_VIEW( heading, data_type, value )
      NEXT
   ELSE
      heading := description
      data_type := ValType( dbg_array )
      value := dbg_array
      DSINGLE_VIEW( heading, data_type, value )
   ENDIF
   RETURN NIL

*------------------------------------------------------------------------------*
windebug.prg58
STATIC FUNCTIONDSINGLE_VIEW( heading, data_type, value )
STATIC FUNCTION DSINGLE_VIEW( heading, data_type, value )
*------------------------------------------------------------------------------*
   DO CASE
   CASE data_type == "A"
      DLIST( value, heading )
   CASE data_type == "B"
      DQOUT( "Code Block:", heading, " => ", value )
   CASE data_type == "C"
      DQOUT( " Character:", heading, " => ", value, .T. )
   CASE data_type == "D"
      DQOUT( "      Date:", heading, " => ", value )
   CASE data_type == "L"
      DQOUT( "   Logical:", heading, " => ", value )
   CASE data_type == "M"
      DQOUT( "      Memo:", heading, " => ", value )
   CASE data_type == "N"
      DQOUT( "   Numeric:", heading, " => ", value )
   CASE data_type == "O"
      OutputDebugString( "  Object vv" +CRLF) // arrows don't show in Windows
      DLIST( value, heading )
      OutputDebugString( "  Object ^^" +CRLF) // arrows don't show in windows
   CASE data_type == "N"
      DQOUT( "   Numeric:", heading, " => ", value )
   CASE data_type == "U"
      DQOUT( "Undefinded:", heading, " => ", value )
   OTHERWISE
      OutputDebugString( "Unknown data type returned by VALTYPE()" +CRLF)
   ENDCASE
   RETURN NIL

*------------------------------------------------------------------------------*
windebug.prg80
STATIC FUNCTIONDQOUT( a, b, c, d, show_len )
STATIC FUNCTION DQOUT( a, b, c, d, show_len )
*------------------------------------------------------------------------------*
   LOCAL e := ''

   IF ValType( show_len ) == 'L' .AND. show_len
      e := ' (' + LEFT(ALLTRIM(a),1)+ ALLTRIM(STR( Len( d ) , 4, 0 ))+')'
   ELSEIF ValType( show_len ) == 'N'
         e := ' ('+ LEFT(ALLTRIM(a),1) + AllTrim( STR( show_len, 10, 0 ) )+')'
    //  ENDIF
   ELSE
     e:=' ('+LEFT(ALLTRIM(a),1)+')'
   ENDIF

   e:=""

   OutputDebugString( b + e + c + asstring( d ) +CRLF)
   RETURN NIL

*-----------------------------------------------------------------------------*
windebug.prg111
STATIC FUNCTIONasString( x )
STATIC FUNCTION asString( x )
   local v := ValType( x )

   DO CASE
   CASE v == "C"
      RETURN '"' + x + '"'
   CASE v == "N"
      RETURN AllTrim( str( x ) )
   CASE v == "L"
      IF x
         RETURN ".T."
      ELSE
         RETURN ".F."
      ENDIF
   CASE v == "D"
      RETURN dtoc( x )
   CASE v == "U"
      RETURN "NIL"
   CASE v == "A"
      RETURN ""
   CASE v == "O"
      RETURN ""
   CASE v == "B"
      RETURN ""
   OTHERWISE
      RETURN ""
   END CASE

   RETURN( x )
windebug.prg130
winerror.prg
TypeFunctionSourceLine
PROCEDUREErrorSys( )
PROCEDURE ErrorSys( )

   ErrorBlock( { | e | DefError( e ) } )

   RETURN

*------------------------------------------------------------------------------*
winerror.prg22
STATIC FUNCTIONDefError( e )
STATIC FUNCTION DefError( e )

   LOCAL cMessage, aOptions, nChoice
   LOCAL cErr
   LOCAL cProcStack := ''
   LOCAL i

   IF e:genCode == EG_PRINT
      RETURN PrintError( )
   ENDIF
   IF ( e:genCode == EG_ZERODIV )
      RETURN ( 0 )
   ENDIF
   IF ( e:genCode == EG_OPEN .AND. e:osCode == 32 .AND. e:canDefault )
      NetErr( .T. )
      RETURN ( .F. ) // NOTE
   ENDIF
   IF ( e:genCode == EG_APPENDLOCK .AND. e:canDefault )
      NetErr( .T. )
      RETURN ( .F. ) // NOTE
   ENDIF

   i := 2
   DO WHILE ( ! Empty( ProcName( i ) ) )
      cProcStack += ( CRLF + ProcFile( i ) + "->" + ProcName( i ) + "(" + NTRIM( ProcLine( i ++ ) ) + ")" )
      IF ProcName( i ) == 'DEFERROR' // Oops, recursive arror, cannot continue !
         OutputDebugString( "" )
         OutputDebugString( "===============" + CRLF )
         OutputDebugString( "RECURSIVE ERROR" + CRLF )
         OutputDebugString( "===============" + CRLF )
         OutputDebugString( e:description + CHR( 13 ) + "Procedure Stack Depth:" + ntrim( getprocstack( ) ) + CRLF )
         OutputDebugString( cProcStack + CRLF )
         PostQuitMessage( 0 )
         Errorlevel( 1 )
         // quit
         RETURN( .F. )
      ENDIF
   ENDDO

   //OutputDebugString( cProcStack + CRLF )

   cErr := LogError( e, cProcStack )
   OutputDebugString( cErr )
   cMessage := ErrorMessage( e )

   aOptions := { "Quit" }
   IF ( e:canRetry )
      aAdd( aOptions, "Retry" )
   END
   IF ( e:canDefault )
      aAdd( aOptions, "Default" )
   END

   nChoice := 0

   IF ( Empty( e:osCode ) )
      nChoice := eAlert( cMessage, aOptions, cErr )
   ELSE
      nChoice := eAlert( cMessage + ;
                         ";(OS Error " + NTRIM( e:osCode ) + ")", ;
                         aOptions, cErr )
   END

   IF ( ! Empty( nChoice ) )

      // do as instructed
      IF ( aOptions[ nChoice ] == "Break" )
         SET DELETED ON
         BREAK( e )
         RETURN( .F. )
      ELSEIF ( aOptions[ nChoice ] == "Retry" )
         RETURN ( .T. )
      ELSEIF ( aOptions[ nChoice ] == "Default" )
         SET DELETED ON
         RETURN ( .F. )
      END

   END

   PostQuitMessage( 0 )
   ErrorLevel( 1 )
   Quit
   //CLOSE ALL
   //PGMEXIT()

   RETURN ( .F. )


*------------------------------------------------------------------------------*
winerror.prg30
STATIC FUNCTIONErrorMessage( e )
STATIC FUNCTION ErrorMessage( e )

   LOCAL cMessage

   // start error message
   cMessage := iif( e:severity > ES_WARNING, "Error", "Warning" )

   // add error description if available
   IF ( ValType( e:description ) == "C" )
      cMessage += ';' + e:description
   END

   // add either filename or operation
   IF ( ! Empty( e:filename ) )
      cMessage += ( ';' + e:filename )
   ELSEIF ( ! Empty( e:operation ) )
      cMessage += ( ';' + e:operation )
   END

   // add subsystem name if available
   IF ( ValType( e:subsystem ) == "C" )
      cMessage += ';ERROR: ' + e:subsystem( ) + ' '
   ELSE
      cMessage += ";ERROR: ??? "
   END

   // add subsystem's error code if available
   IF ( ValType( e:subCode ) == "N" )
      cMessage += ( NTRIM( e:subCode ) )
   END
   cMessage += ';Called from ' + ProcFile(3) + "->" + procname( 3 ) + ' (' + AllTrim( Str( procline( 3 ) ) ) + '),  ' + ;
               + ProcFile(4) + "->" + procname( 4 ) + ' (' + AllTrim( Str( procline( 4 ) ) ) + ')'
   cMessage += ';Error logged in file '+GetModuleFileName()+'\ERROR.LOG'

   RETURN ( cMessage )


*------------------------------------------------------------------------------*
winerror.prg120
STATIC FUNCTIONLogError( e, cProcStack )
STATIC FUNCTION LogError( e, cProcStack )

   LOCAL Args := convertargs( e:args )
   LOCAL i    := 3
   LOCAL cErr := ''
   LOCAL dVer

   cErr += 'SYSTEM'
   cErr += ( CRLF + '------' )
   cErr += ( CRLF + 'Error date:' + dtoc( date( ) ) + ' time:' + time( ) )
   cErr += ( CRLF + 'Application: ' + GetModuleFileName( ) )
   cErr += ( CRLF + 'What32.Lib ver.' + WhatVersion( @dVer ) + ", " + DTOC( dVer ) )

   // T.B.D.:
   // add here  Windows version, memory info, diskspace info, free resources info
   // add computer name and operator name

   cErr += ( CRLF )
   cErr += ( CRLF + "ERROR INFORMATION" )
   cErr += ( CRLF + "-----------------" )
   cErr += ( CRLF + "Arguments     " + Args )
   cErr += ( CRLF + "Description   " + e:description )
   cErr += ( CRLF + "Filename      " + IfEmpty( e:filename ) )
   cErr += ( CRLF + "GenCode       " + gencodetext( e:genCode ) )
   cErr += ( CRLF + "Operation     " + IfEmpty( e:operation ) )
   cErr += ( CRLF + "Severity      " + NTRIM( e:severity ) )
   cErr += ( CRLF + "SubCode       " + NTRIM( e:subCode ) )
   cErr += ( CRLF + "SubSystem     " + e:subSystem )
   cErr += ( CRLF + "Tries         " + NTRIM( e:tries ) )
   cErr += ( CRLF + "Alias()       " + IfEmpty( ALIAS( ) ) )
   cErr += ( CRLF + "Open DBFs     " + ntrim( GetAliasCount( ) ) )
   cErr += ( CRLF + "DOS Error     " + DosErrCode( e ) )
   cErr += ( CRLF + "Windows Error " + NTRIM( GetLastError( ) ) )
   cErr += ( CRLF )
   cErr += ( CRLF )
   cErr += ( CRLF + "PROCEDURE STACK" )
   cErr += ( CRLF + "---------------" )

   cErr += cProcStack

   SET PRINTER TO  "Error.Log" ADDITIVE
   SET CONSOLE OFF
   SET PRINTER ON

   QOut( "        Please mail or fax this error report to:" )
   /*
   ? '             +---------------------------+'
   ? '             |  YOUR BUSINESS NAME HERE  |'
   ? '             |        P.O.Box 123        |'
   ? '             |Some Prestigeous Town, 1234|'
   ? '             |    Fax: (01) 1234 1234    |'
   */
   QOut( "             +---------------------------+" )
   QOut( cErr )

   QOut(Replicate( "=", 70 ))

   EJECT
   SET PRINTER OFF
   SET PRINTER TO
   SET CONSOLE ON

   RETURN cErr


*------------------------------------------------------------------------------*
winerror.prg159
STATIC FUNCTIONIfEmpty( Msg )
STATIC FUNCTION IfEmpty( Msg )

   LOCAL Ret_Val := ""

   IF ! Empty( msg )
      Ret_Val := Left( msg, 68 )
   ENDIF

   RETURN Ret_Val


*------------------------------------------------------------------------------*
winerror.prg226
STATIC PROCEDUREPrintError
STATIC PROCEDURE PrintError

   BREAK

// RETURN


*------------------------------------------------------------------------------*
winerror.prg239
STATIC FUNCTIONConvertArgs( a )
STATIC FUNCTION ConvertArgs( a )

   LOCAL Ret_Val
   LOCAL x, cType
   LOCAL NumArgs := iif( ValType( a ) == "A", Len( a ) , iif( ValType( a ) == "C", ( a := { a } , 1 ) , 0 ) )

   IF NumArgs > 0
      Ret_Val := '{ '
      FOR x := 1 TO NumArgs
         cType := ValType( a[ x ] )
         DO CASE
         CASE cType == "C"
            Ret_Val += a[ x ]
         CASE cType == "N"
            Ret_Val += NTRIM( a[ x ] )
         CASE cType == "D"
            Ret_Val += dtoc( a[ x ] )
         CASE cType == "L"
            Ret_Val += iif( a[ x ] , ".T.", ".F." )
         CASE cType == "O"
            Ret_Val += a[ x ] :className + " Object"
         CASE cType == "U"
            Ret_Val += "NIL"
         ENDCASE
         //ÄÄÄÄÄ Next block added 1/8/92 To separate arguments
         IF x < NumArgs
            Ret_Val += ', '
         ENDIF
      NEXT
      Ret_Val += ' }'
   ENDIF

   RETURN ifempty( Ret_Val )


*------------------------------------------------------------------------------*
winerror.prg248
STATIC FUNCTIONGetAliasCount( )
STATIC FUNCTION GetAliasCount( )

   LOCAL Counter  := 0
   LOCAL nCounter := 0

   FOR Counter := 1 TO 255
      IF ! Empty( alias( Counter ) )
         nCounter ++
      ENDIF
   NEXT

   RETURN( nCounter )


*------------------------------------------------------------------------------*
winerror.prg285
STATIC FUNCTIONgetprocstack( )
STATIC FUNCTION getprocstack( )

   LOCAL i := 2

   DO WHILE ! Empty( procname( i ) )
      i ++
   ENDDO

   RETURN( i - 3 )


*------------------------------------------------------------------------------*
winerror.prg301
STATIC FUNCTIONDosErrCode( e )
STATIC FUNCTION DosErrCode( e )

   LOCAL Msg

   IF e:osCode > 0
      Msg := NTRIM( e:osCode ) + ": " + Left( DosErrText( e:osCode ) , 37 )
   ELSE
      Msg := "(not an operating system error)"
   ENDIF

   RETURN Msg


*------------------------------------------------------------------------------*

winerror.prg314
STATIC FUNCTIONDosErrText( n )
STATIC FUNCTION DosErrText( n )

   LOCAL desc_ := { "Invalid function number"                 , ; // 1
                    "File not found"                          , ; // 2
                    "Path not found"                          , ; // 3
                    "Too many files open (no handles left)"   , ; // 4
                    "Access denied"                           , ; // 5
                    "Invalid handle"                          , ; // 6
                    "Memory control blocks destroyed (oh, my)", ; // 7
                    "Insufficient memory"                     , ; // 8
                    "Invalid memory block address"            , ; // 9
                    "Invalid environment"                     , ; // 10
                    "Invalid format"                          , ; // 11
                    "Invalid access code"                     , ; // 12
                    "Invalid data"                            , ; // 13
                    , ; // 14
                    "Invalid drive was specified"             , ; // 15
                    "Attempt to remove the current directory" , ; // 16
                    "Not same device"                         , ; // 17
                    "No more files"                           , ; // 18
                    "Attempt to write on write-protected diskette", ; // 19
                    "Unknown unit"                            , ; // 20
                    "Drive not ready"                         , ; // 21
                    "Unknown command"                         , ; // 22
                    "Data error (CRC)"                        , ; // 23
                    "Bad request structure length"            , ; // 24
                    "Seek error"                              , ; // 25
                    "Unknown media type"                      , ; // 26
                    "Sector not found"                        , ; // 27
                    "Printer out of paper"                    , ; // 28
                    "Write fault"                             , ; // 29
                    "Read fault"                              , ; // 30
                    "General failure"                         , ; // 31
                    "Sharing violation"                       , ; // 32
                    "Lock violation"                          , ; // 33
                    "Invalid disk change"                     , ; // 34
                    "FCB unavailable"                         , ; // 35
                    "Sharing buffer overflow"                 , ; // 36
                    , , , , , , , , , , , , ,                   ; // 37-49
                    "Network request not supported"           , ; // 50
                    "Remote computer not listening"           , ; // 51
                    "Duplicate name on network"               , ; // 52
                    "Network name not found"                  , ; // 53
                    "Network busy"                            , ; // 54
                    "Network device no longer exists"         , ; // 55
                    "Network BIOS command limit exceeded"     , ; // 56
                    "Network adapter hardware error"          , ; // 57
                    "Incorrect response from network"         , ; // 58
                    "Unexpected network error"                , ; // 59
                    "Incompatible remote adapter"             , ; // 60
                    "Print queue full"                        , ; // 61
                    "Not enough space for print file"         , ; // 62
                    "Print file deleted (not enough space)"   , ; // 63
                    "Network name deleted"                    , ; // 64
                    "Access denied"                           , ; // 65
                    "Network device type incorrect"           , ; // 66
                    "Network name not found"                  , ; // 67
                    "Network name limit exceeded"             , ; // 68
                    "Network BIOS session limit exceeded"     , ; // 69
                    "Temporarily paused"                      , ; // 70
                    "Network request not accepted"            , ; // 71
                    "Print or disk redirection paused"        , ; // 72
                    , , , , , , ,                               ; // 73-79
                    "File already exists"                     , ; // 80
                    , ; // 81
                    "Cannot make directory entry"             , ; // 82
                    "Fail on INT 24h"                         , ; // 83
                    "Too many redirections"                   , ; // 84
                    "Duplicate redirection"                   , ; // 85
                    "Invalid password"                        , ; // 86
                    "Invalid parameter"                       , ; // 87
                    "Network device fault"                    , ; // 88
                    ;
                    "Undefined or reserved error code!"         ; // +1
                  }

   /*
     Check that code number is within known upper limit,
     AND that a description is available For it.
   */
/*
   IF ( n > ( Len( desc_ ) - 1 ) ) .OR. ( desc_[ n ] == NIL )
      n := Len( desc_ )
   ENDIF
*/
   IF ( ( n < 1 ) .OR. n > ( Len( desc_ ) - 1 ) ) .OR. ( desc_[ n ] == NIL )
      n := Len( desc_ )
   ENDIF

   RETURN desc_[ n ]


*------------------------------------------------------------------------------*
winerror.prg337
STATIC FUNCTIONGenCodeText( n )
STATIC FUNCTION GenCodeText( n )

   LOCAL desc_ := { "EG_ARG", ; // 1
                    "EG_BOUND"               , ; // 2
                    "EG_STROVERFLOW"         , ; // 3
                    "EG_NUMOVERFLOW"         , ; // 4
                    "EG_ZERODIV"             , ; // 5
                    "EG_NUMERR"              , ; // 6
                    "EG_SYNTAX"              , ; // 7
                    "EG_COMPLEXITY"          , ; // 8
                    , ,                        ; // 9-10
                    "EG_MEM"                 , ; // 11
                    "EG_NOFUNC"              , ; // 12
                    "EG_NOMETHOD"            , ; // 13
                    "EG_NOVAR"               , ; // 14
                    "EG_NOALIAS"             , ; // 15
                    "EG_NOVARMETHOD"         , ; // 16
                    "EG_BADALIAS"            , ; // 17 (new w/ 5.01a)
                    "EG_DUPALIAS"            , ; // 18 (new w/ 5.01a)
                    ,                          ; // 19
                    "EG_CREATE"              , ; // 20
                    "EG_OPEN"                , ; // 21
                    "EG_CLOSE"               , ; // 22
                    "EG_READ"                , ; // 23
                    "EG_WRITE"               , ; // 24
                    "EG_PRINT"               , ; // 25
                    , , , ,                    ; // 26-29
                    "EG_UNSUPPORTED"         , ; // 30
                    "EG_LIMIT"               , ; // 31
                    "EG_CORRUPTION"          , ; // 32
                    "EG_DATATYPE"            , ; // 33
                    "EG_DATAWIDTH"           , ; // 34
                    "EG_NOTABLE"             , ; // 35
                    "EG_NOORDER"             , ; // 36
                    "EG_SHARED"              , ; // 37
                    "EG_UNLOCKED"            , ; // 38
                    "EG_READONLY"            , ; // 39
                    "EG_APPENDLOCK"          , ; // 40
                    ;
                    "Unknown or reserved"      ; // +1
                  }

   /*
     Check that code number is within known upper limit,
     AND that a description is available For it.
   */
/*
   IF ( n > ( Len( desc_ ) - 1 ) ) .OR. ( desc_[ n ] == NIL )
      n := Len( desc_ )
   ENDIF
*/
   IF ( ( n < 1 ) .OR. n > ( Len( desc_ ) - 1 ) ) .OR. ( desc_[ n ] == NIL )
      n := Len( desc_ )
   ENDIF


   RETURN NTRIM( n ) + ": " + desc_[ n ]


*------------------------------------------------------------------------------*
winerror.prg431
STATIC FUNCTIONeAlert( cMsg, aChoices, cDetail )
STATIC FUNCTION eAlert( cMsg, aChoices, cDetail )

   LOCAL aDlg, i, n, aChoose, aMsg
   LOCAL hWnd, hDC
   LOCAL lErr     := .F., w , h, t := 0, cTitle, Msgh, ButWidth
   LOCAL crPos    := 0, txth := 0, atm := { }
   LOCAL isDetail := .F.

   IF !ISCHARACTER( cMsg )
      cMsg := asString( cMsg )
   ENDIF
   cTitle := 'Alert'

   IF aChoices == NIL
      aChoices := { "&Ok" }
   ENDIF

   aAdd( achoices, "&Details >>" )

   cMsg := StrTran( cMsg, ";", CR )

   IF ( crPos := at( CR, cMsg ) ) > 0
      cTitle := Left( cMsg, crPos - 1 )
      cMsg := SubStr( cMsg, crPos + 1 )
   ENDIF

   hWnd := GetDesktopWindow( ) // default parent
   hDC  := GetDC( hWnd )

   //------------- total width without buttons

   w := GetTextExtentPoint32( hDC, AllTrim( cTitle ) ) [ 1 ]
   aMsg := str2a( cMsg, CR )
   AEVAL( aMsg, { | x | w := Max( w, GetTextExtentPoint32( hDC, AllTrim( x ) ) [ 1 ] ) } )
   w += 20

   //--------- total width of choices, also add "&" to the choices (if needed)

   n := Len( aChoices )
   aChoose := array( n )

   txth := 8 //ATM[TM_Height]
   Msgh := Len( aMsg ) * txth
   FOR i := 1 TO n
      ButWidth := Max( 20, GetTextExtentpoint32( hDC, aChoices[ i ] ) [ 1 ] + 6 )
      t := Max( t, ButWidth )
      aChoose[ i ] := iif( at( "&", aChoices[ i ] ) == 0, "&" + aChoices[ i ] , aChoices[ i ] )
   NEXT i

   ReleaseDC( , hDC )

   ButWidth := t / 2
   t *= ( n + 1 )
   w := Max( Max( w, t ) + 40, 500 ) // minimum dlg width
   h := Msgh + 33
   w /= 2

   //----------- create dialog

   aDlg := MakeDlgTemplate( cTitle, ;
                           WS_CAPTION + DS_MODALFRAME + WS_VISIBLE + 4 + WS_POPUP + DS_SETFONT , ;
                           0, 0, w, h, 8, 'MS Sans Serif' )

   FOR i := 1 TO n
      aDlg := AddDlgItem( aDlg, i, "BUTTON", ;
                         BS_PUSHBUTTON + WS_TABSTOP + WS_CHILD + WS_VISIBLE, ;
                         w - ( n - i ) * ( ButWidth + 5 ) - ButWidth - 5, h - 18, ButWidth, 14, ;
                         aChoose[ i ] )
   NEXT i

   aDlg := AddDlgItem( aDlg, - 1, "STATIC", ;
                      SS_CENTER + WS_CHILD + WS_VISIBLE, ;
                      10, 8, w - 20, Msgh, ;
                      cMsg )

   aDlg := AddDlgItem( aDlg, - 1, "BUTTON", ;
                      BS_GROUPBOX + WS_CHILD + WS_VISIBLE, ;
                      5, 1, w - 10, Msgh + 10, ;
                      "" )

   aDlg := AddDlgItem( aDlg, 101, "EDIT", ;
                      WS_CHILD + WS_VISIBLE + WS_BORDER + ES_MULTILINE + ES_READONLY + WS_VSCROLL + WS_TABSTOP, ;
                      5, h + 1, w - 10, 115, ;
                      cDetail )

   MessageBeep( MB_ICONHAND )
   i := DialogBox( , aDlg, hWnd, { | hDlg, nMsg, nwParam, nlParam | ;
                                  eAlertProc( hDlg, nMsg, nwParam, nlParam, @isDetail, hWnd, n ) } )
   SetFocus( hWnd )

   RETURN i


*------------------------------------------------------------------------------*
winerror.prg492
STATIC FUNCTIONeAlertProc( hDlg, nMsg, nwParam, nlParam, isDetail, hWnd, n )
STATIC FUNCTION eAlertProc( hDlg, nMsg, nwParam, nlParam, isDetail, hWnd, n )

   LOCAL aRect

   HB_SYMBOL_UNUSED( nlParam )

   DO CASE
   CASE nMsg == WM_INITDIALOG
      CenterWindow( hDlg, , , hWnd )
      SetOnTop( hDlg, HWND_TOPMOST )
      RETURN( 1 )

   CASE nMsg == WM_COMMAND
      IF 'Detail' $ GetDlgItemText( hDlg, nwParam )
         aRect := getwindowrect( hDlg )
         IF isDetail
            SetDlgItemText( hDlg, nwParam, '&Detail >>' )
            MoveWindow( hDlg, aRect[ 1 ] , aRect[ 2 ] , aRect[ 3 ] - aRect[ 1 ] , aRect[ 4 ] - aRect[ 2 ] - 200, .T. )
            isDetail := .F.
         ELSE
            SetDlgItemText( hDlg, nwParam, '<< &Detail' )
            MoveWindow( hDlg, aRect[ 1 ] , aRect[ 2 ] , aRect[ 3 ] - aRect[ 1 ] , aRect[ 4 ] - aRect[ 2 ] + 200, .T. )
            isDetail := .T.
         ENDIF
      ELSE
         IF nwParam > 0 .AND. nwParam < n
            EndDialog( hDlg, nwParam )
         ENDIF
      ENDIF

   ENDCASE

   RETURN 0
winerror.prg587
winini.prg
TypeFunctionSourceLine
FUNCTIONGetPrivateProfileLog( cSection, cEntry, lDefault, cFile )
FUNCTION GetPrivateProfileLog( cSection, cEntry, lDefault, cFile )

  LOCAL cDefault:=iif(lDefault,"YES","NO")
  LOCAL cRet:=GetPrivateProfileString(cSection, cEntry, cDefault, cFile )

  RETURN(UPPER(cRet) $ "YESON1")

*-----------------------------------------------------------------------------*
winini.prg14
FUNCTIONGetPrivateProfileFloat(cSection, cEntry, nDefault, cFile )
FUNCTION GetPrivateProfileFloat(cSection, cEntry, nDefault, cFile )

  LOCAL cDefault:=STR(nDefault)
  LOCAL cRet:=GetPrivateProfileString(cSection, cEntry, cDefault, cFile )

  RETURN(VAL(cRet))

*-----------------------------------------------------------------------------*
winini.prg23
FUNCTIONGetPrivateProfileDate( cSection, cEntry, dDefault, cFile )
FUNCTION GetPrivateProfileDate( cSection, cEntry, dDefault, cFile )

  LOCAL cDefault:=DTOS( dDefault )
  LOCAL cRet:=GetPrivateProfileString(cSection, cEntry, cDefault, cFile )

  RETURN(STOD( cRet ))


// Get from Win.Ini

*-----------------------------------------------------------------------------*
winini.prg32
FUNCTIONGetProfileLog( cSection, cEntry, lDefault )
FUNCTION GetProfileLog( cSection, cEntry, lDefault )

  LOCAL cDefault:=iif(lDefault,"YES","NO")
  LOCAL cRet:=GetProfileString(cSection, cEntry, cDefault )

  RETURN(UPPER(cRet) $ "YESON1")

*-----------------------------------------------------------------------------*
winini.prg44
FUNCTIONGetProfileFloat(cSection, cEntry, nDefault )
FUNCTION GetProfileFloat(cSection, cEntry, nDefault )

  LOCAL cDefault:=STR(nDefault)
  LOCAL cRet:=GetProfileString(cSection, cEntry, cDefault )

  RETURN(VAL(cRet))

*-----------------------------------------------------------------------------*
winini.prg53
FUNCTIONGetProfileDate( cSection, cEntry, dDefault )
FUNCTION GetProfileDate( cSection, cEntry, dDefault )

  LOCAL cDefault:=DTOS( dDefault )
  LOCAL cRet:=GetProfileString(cSection, cEntry, cDefault )

  RETURN(STOD( cRet ))


// Write to Private Ini

*-----------------------------------------------------------------------------*
winini.prg62
FUNCTIONWritePrivateProfileInt( cSection, cEntry, nData, cFile )
FUNCTION WritePrivateProfileInt( cSection, cEntry, nData, cFile )

  RETURN( WritePrivateProfileString( cSection, cEntry, STR( INT(nData) ), cFile ) )

*-----------------------------------------------------------------------------*
winini.prg74
FUNCTIONWritePrivateProfileLog( cSection, cEntry, lData, cFile )
FUNCTION WritePrivateProfileLog( cSection, cEntry, lData, cFile )

  RETURN( WritePrivateProfileString( cSection, cEntry, iif(lData,"Yes","No") , cFile ) )

*-----------------------------------------------------------------------------*
winini.prg80
FUNCTIONWritePrivateProfileFloat( cSection, cEntry, nData, cFile )
FUNCTION WritePrivateProfileFloat( cSection, cEntry, nData, cFile )

  RETURN( WritePrivateProfileString( cSection, cEntry, STR( nData ) , cFile ) )

*-----------------------------------------------------------------------------*
winini.prg86
FUNCTIONWritePrivateProfileDate( cSection, cEntry, dData, cFile )
FUNCTION WritePrivateProfileDate( cSection, cEntry, dData, cFile )

  RETURN( WritePrivateProfileString( cSection, cEntry, DTOS( dData ) , cFile ) )



// Write to Win.Ini

*-----------------------------------------------------------------------------*
winini.prg92
FUNCTIONWriteProfileLog( cSection, cEntry, lData )
FUNCTION WriteProfileLog( cSection, cEntry, lData )

  RETURN( WriteProfileString( cSection, cEntry, iif(lData,"Yes","No") ) )


*-----------------------------------------------------------------------------*
winini.prg102
FUNCTIONWriteProfileFloat( cSection, cEntry, nData )
FUNCTION WriteProfileFloat( cSection, cEntry, nData )

  RETURN( WriteProfileString( cSection, cEntry, STR( nData ) ) )

*-----------------------------------------------------------------------------*
winini.prg109
FUNCTIONWriteProfileDate( cSection, cEntry, dData )
FUNCTION WriteProfileDate( cSection, cEntry, dData )

  RETURN( WriteProfileString( cSection, cEntry, DTOS( dData ) ) )

*-----------------------------------------------------------------------------*
winini.prg115
FUNCTIONWriteProfileInt( cSection, cEntry, nData )
FUNCTION WriteProfileInt( cSection, cEntry, nData )

  RETURN( WriteProfileString( cSection, cEntry, STR( INT(nData) ) ) )
winini.prg122
winrbar.prg
TypeFunctionSourceLine
CLASSREBAR
CLASS REBAR

  DATA hWnd
  DATA hParent
  DATA nStyle
  DATA nProc


  METHOD INIT() Constructor
  METHOD Create()
  METHOD AddBand()
  METHOD rbProc()
  METHOD GetHeight()
  ACCESS height INLINE ::GetHeight()
ENDCLASS
winrbar.prg103
REBAR:METHODGetHeight()
METHOD GetHeight()
LOCAL aRect:=GetWindowRect(::hWnd)
return aRect[4]-aRect[2]

*-----------------------------------------------------------------------------*
winrbar.prg119
REBAR:METHODINIT()
METHOD INIT()
   InitCommonControlsEx(ICC_COOL_CLASSES)


RETURN SELF


*-----------------------------------------------------------------------------*
winrbar.prg125
REBAR:METHODcreate(hParent,nStyle)
METHOD create(hParent,nStyle)

//   LOCAL rbi IS REBARINFO

   ::hParent:=hParent
   ::nStyle :=IFNIL(nStyle,WS_VISIBLE+WS_BORDER+WS_CHILD+WS_CLIPCHILDREN+;
                           WS_CLIPSIBLINGS+RBS_VARHEIGHT+RBS_BANDBORDERS+;
                           CCS_NODIVIDER+CCS_NOPARENTALIGN+CCS_TOP,nStyle)

   ::hWnd := CreateWindowEx(WS_EX_TOOLWINDOW,;
                           REBARCLASSNAME,;
                           "",;
                           ::nStyle,;
                           0,0,200,100,;
                           hParent,;
                           1,;
                           hInstance(),;
                           0)


  ::nProc:=SetProcedure(::hParent,{|hWnd, nMsg,nwParam,nlParam| HB_SYMBOL_UNUSED( hWnd ), ::rbProc(nMsg,nwParam,nlParam)},{WM_SIZE})




  // rbi:cbSize := rbi:sizeof()  // Required when using this struct.
  // rbi:fMask  := 0
  // rbi:himl   := 0

   SendMessage(::hWnd, RB_SETBKCOLOR, 0, GetSysColor(COLOR_BTNFACE))
  // view SendMessage(::hWnd, RB_SETBARINFO, 0, rbi:value)

   return self


*-----------------------------------------------------------------------------*
winrbar.prg134
REBAR:METHODrbProc(nMsg,nwParam,nlParam)
METHOD rbProc(nMsg,nwParam,nlParam)
   LOCAL acRect
   LOCAL aRect
   DO CASE
   CASE nMsg==WM_SIZE
     acRect:=GetClientRect(::hParent)
     aRect:=GetWindowRect(::hWnd)
     MoveWindow(::hWnd,0,0,acRect[3],aRect[4]-aRect[2],.t.)
   ENDCASE
RETURN CallWindowProc(::nProc,::hParent,nMsg,nwParam,nlParam)




*-----------------------------------------------------------------------------*
winrbar.prg171
REBAR:METHODaddband(nMask,nStyle,hChild,cxMin,cyMin,cx,cText,hBmp,nPos)
METHOD addband(nMask,nStyle,hChild,cxMin,cyMin,cx,cText,hBmp,nPos)

   LOCAL rbBand IS REBARBANDINFO
   LOCAL aRect:=GetWindowRect(hChild)

   HB_SYMBOL_UNUSED( nPos )

   rbBand:Reset()

   // Initialize structure members that most bands will share.
   rbBand:cbSize := rbBand:sizeof()  // Required

   rbBand:fMask  := IFNIL(nMask,RBBIM_TEXT +; //RBBIM_BACKGROUND +;
                                RBBIM_STYLE +RBBIM_CHILDSIZE+;
                                RBBIM_SIZE+RBBIM_CHILD,nMask)

   rbBand:fStyle     := IFNIL(nStyle,RBBS_GRIPPERALWAYS+RBBS_NOVERT/*+RBBS_CHILDEDGE*/,nStyle)// + RBBS_FIXEDBMP
   rbBand:hwndChild  := IFNIL(hChild,0,hChild)
   rbBand:cxMinChild := IFNIL(cxMin,aRect[3]-aRect[1],cxMin)
   rbBand:cyMinChild := IFNIL(cyMin,aRect[4]-aRect[2],cyMin)
   rbBand:cx         := IFNIL(cx,GetClientRect(::hParent)[3],cx)
   rbBand:lpText     := IFNIL(cText,"Test",cText)
   rbBand:hbmBack    := IFNIL(hBmp,0,hBmp) //LoadBitmap(hInstance(), "IDB_BACKGRND"),hBmp)


  // view rbBand,aRect,LoadBitmap(hInstance(), "IDB_BACKGRND"), rbBand:value

   // Add the band
   RETURN SendMessage(::hWnd, RB_INSERTBAND, -1, rbBand:value ) != 0
winrbar.prg186
wintabs.prg
TypeFunctionSourceLine
CLASSTabControl
CLASS TabControl

   DATA hParent
   DATA hTab AS  NUMERIC
   DATA Tabs AS  ARRAY HIDDEN
   DATA Dlgs AS  ARRAY HIDDEN
   DATA Procs AS ARRAY HIDDEN
   DATA nCurSel
   DATA nProc
   DATA nId
   DATA Cargo

   METHOD New() CONSTRUCTOR
   METHOD TabProc()
   METHOD Add()
   METHOD Insert()
   METHOD Delete()
   METHOD Configure()
   METHOD AdjustRect()
   METHOD DeleteAll()
   METHOD DeselectAll()
   METHOD GetCurFocus()
   METHOD GetCurSel()
   METHOD GetExtendedStyle()
   METHOD GetImageList()
   METHOD GetItem()
   METHOD GetItemCount()
   METHOD GetItemRect()
   METHOD GetRowCount()
   METHOD GetToolTips()
   METHOD GetUnicodeFormat()
   METHOD HighlightItem()
   METHOD HitTest()
   METHOD RemoveImage()
   METHOD SetCurFocus()
   METHOD SetCurSel()
   METHOD SetExtendedStyle()
   METHOD SetImageList()
   METHOD SetItem()
   METHOD SetItemExtra()
   METHOD SetItemSize()
   METHOD SetMinTabWidth()
   METHOD SetPadding()
   METHOD SetToolTips()
   METHOD SetUnicodeFormat()

ENDCLASS

*-----------------------------------------------------------------------------*
wintabs.prg26
TABCONTROL:METHODNew( hDlg, nL, nT, nW, nH, nStyle, nSel,nId )
METHOD New( hDlg, nL, nT, nW, nH, nStyle, nSel,nId )
   ::hParent:=hDlg
   ::Tabs:={}
   ::Dlgs:={}
   ::Procs:={}
   ::nId:=nId
   ::nCurSel:=iif(nSel==NIL,1,nSel)
   ::hTab:=TabCtrl_Create( hDlg, nL, nT, nW, nH, nStyle,nId)
   ::nProc:=SetProcedure( hDlg, {|hDlg,nMsg,nwParam,nlParam|;
            ::TabProc(hDlg,nMsg,nwParam,nlParam)} , {WM_NOTIFY} )
RETURN Self

*-----------------------------------------------------------------------------*
wintabs.prg76
STATIC FUNCTION_TempPageProc(nMsg)
static FUNCTION _TempPageProc(nMsg)
   IF nMsg==WM_CTLCOLORDLG
      return(GetStockObject(NULL_BRUSH))
   END

   RETURN(0)

*-----------------------------------------------------------------------------*
wintabs.prg90
TABCONTROL:METHODTabProc(hDlg, nMsg, nwParam, nlParam)
METHOD TabProc(hDlg, nMsg, nwParam, nlParam)

   LOCAL tnhdr

   LOCAL nSel

   IF nMsg==WM_NOTIFY

      tnhdr IS NMHDR
      tnhdr:Buffer( peek(nlParam,tnhdr:sizeof() ) )

      IF tnhdr:code==0//TCN_SELCHANGE

        nSel:=TabCtrl_GetCurSel( ::hTab )+1
        IF ::nCursel != nSel
           ShowWindow(::Tabs[::nCurSel], SW_HIDE)
           ::nCurSel:=nSel
           ShowWindow(::Tabs[::nCurSel], SW_SHOW)
           /*
           IF ::nCurSel > 0

              //nLen:=len(::Tabs[::nCurSel])
              nLen:=iif(EMPTY(::Tabs[::nCurSel]),0,len(::Tabs[::nCurSel]))
              FOR n:=1 TO nLen
                 ::Tabs[::nCurSel,n,2]:=isWindowEnabled(::Tabs[::nCurSel,n,1])
                 ::Tabs[::nCurSel,n,3]:=isWindowVisible(::Tabs[::nCurSel,n,1])
                 ShowWindow(::Tabs[::nCurSel,n,1],SW_HIDE)
                 EnableWindow(::Tabs[::nCurSel,n,1],.F.)
              NEXT
           ENDIF

           ::nCurSel:=nSel
           nLen:=iif(EMPTY(::Tabs[::nCurSel]),0,len(::Tabs[::nCurSel]))

           FOR n:=1 TO nLen
              IF ::Tabs[::nCurSel,n,2]
                 EnableWindow(::Tabs[::nCurSel,n,1],.T.)
              ENDIF
              IF ::Tabs[::nCurSel,n,3]
                 ShowWindow(::Tabs[::nCurSel,n,1],SW_SHOW)
              ENDIF
           NEXT
           */

        ENDIF

      ENDIF

   ENDIF

   Return( CallWindowProc(::nProc, hDlg, nMsg, nwParam, nlParam) )

*-----------------------------------------------------------------------------*
wintabs.prg102
TABCONTROL:METHODAdd(cText,cRes,bProc,nImgPos)
METHOD Add(cText,cRes,bProc,nImgPos)
LOCAL hTab

   IF (hTab:=TabCtrl_AddItem(::hTab,cText,nImgPos)) > -1
      AADD(::Dlgs,cRes)
      AADD(::Tabs,NIL )
      AADD(::Procs,bProc)
   ENDIF

   RETURN(hTab)

*-----------------------------------------------------------------------------*
wintabs.prg156
TABCONTROL:METHODInsert(nPos,cText,cRes,bProc,nImgPos)
METHOD Insert(nPos,cText,cRes,bProc,nImgPos)

   if TabCtrl_InsertItem(::hTab,cText,nPos,nImgpos) > -1
      AINS(::Dlgs,nPos,cRes,.T.)
      aIns(::Tabs,nPos,NIL,.T.)
      AINS(::Procs,nPos,bProc,.T.)
      RETURN(.T.)
   ENDIF

   return(.F.)

*-----------------------------------------------------------------------------*
wintabs.prg169
TABCONTROL:METHODDelete(nPos)
METHOD Delete(nPos)

   Local nCount:=LEN(::Tabs)
   if nPos > 0 .and. nPos <= nCount
      IF nPos <= ::nCurSel     // verify !!!!!
        ::nCurSel--
      ENDIF
      TabCtrl_DeleteItem(nPos-1)
      ADel(::Dlgs,nPos,.t.)
      if isWindow(::Tabs[nPos])
         DestroyWindow(::Tabs[nPos])
      endif
      ADel(::Tabs,nPos,.t.)
      ADEL(::Procs,nPos,.T.)
      return(.T.)
   Endif

   RETURN(.F.)

*-----------------------------------------------------------------------------*
wintabs.prg182
TABCONTROL:METHODConfigure()
METHOD Configure()

   LOCAL aTab :=GetClientRect(::hTab)
   local acRect:={0,0,0,0}
   LOCAL aTemp
   LOCAL aWnd:={}
   LOCAL hCtrl
   LOCAL i
   LOCAL aPt

   aPt:={aTab[1],aTab[2]}
   ClientToScreen(::hTab   ,aPt)
   ScreenToClient(::hParent,aPt)
   aTab[1]:=aPt[1]
   aTab[2]:=aPt[2]

   aPt:={aTab[3],aTab[4]}
   ClientToScreen(::hTab   ,aPt)
   ScreenToClient(::hParent,aPt)
   aTab[3]:=aPt[1]
   aTab[4]:=aPt[2]


   IF LEN(::Tabs) > 0
      acRect:=TabCtrl_GetItemRect(::hTab,0)
      FOR i:=1 TO LEN(::Tabs)-1
         aTemp:=TabCtrl_GetItemRect(::hTab,i)
         acRect[1]:=MIN(acRect[1],aTemp[1])
         acRect[2]:=MIN(acRect[2],aTemp[2])
         acRect[3]:=MAX(acRect[3],aTemp[3])
         acRect[4]:=MAX(acRect[4],aTemp[4])
      NEXT
   ENDIF

   aPt:={acRect[1],acRect[2]}
   ClientToScreen(::hTab   ,aPt)
   ScreenToClient(::hParent,aPt)
   acRect[1]:=aPt[1]
   acRect[2]:=aPt[2]
   /*
   aPt:={acRect[3],acRect[4]}
   ClientToScreen(::hTab   ,aPt)
   ScreenToClient(::hParent,aPt)
   acRect[3]:=aPt[1]
   acRect[4]:=aPt[2]
   */
   FOR i:=1 TO LEN(::Dlgs)
      IF ::Dlgs[i] != NIL .AND. EMPTY(::Tabs[i])

         hCtrl:=CreatePage(::Dlgs[i],::hParent,::Procs, i )
         ::Tabs[i]:=hCtrl
         MoveWindow( hCtrl, acRect[1]+4, acRect[2]+acRect[4]+4, aTab[3]-aTab[1]-8, aTab[4]-(acRect[4]+acRect[2])- 8, .F. )
         IF i != ::nCurSel
            ShowWindow(hCtrl,SW_HIDE)
         ENDIF
      ENDIF
   NEXT

   RETURN(self)

*-----------------------------------------------------------------------------*
wintabs.prg203
STATIC FUNCTIONCreatePage(acRes,hParent,aProcs, i)
Static Function CreatePage(acRes,hParent,aProcs, i)
   Local bBlock:=iif(valtype( aProcs[i])== "B", aProcs[i], {|nMsg| _TempPageProc(nMsg)} )
   RETURN CreateDialog( , acRes, hParent, bBlock )

*-----------------------------------------------------------------------------*
wintabs.prg264
TABCONTROL:METHODAdjustRect(lDisplay,aRect)
METHOD AdjustRect(lDisplay,aRect)

   TabCtrl_AdjustRect(::hTab,lDisplay,@aRect)

   RETURN(aRect)

*-----------------------------------------------------------------------------*
wintabs.prg269
TABCONTROL:METHODDeleteAll()
METHOD DeleteAll()

  Local lRet:=TabCtrl_DeleteAllItems(::hTab)

  AEVAL(::Tabs,{|hWnd| iif(isWindow(hWnd),DestroyWindow(hWnd),)})
  ::Tabs:={}
  ::aDlg:={}
  ::Procs:={}
  ::nCurSel:=0

  RETURN(lRet)

*-----------------------------------------------------------------------------*
wintabs.prg276
TABCONTROL:METHODDeselectAll(lExcludeFocus)
METHOD DeselectAll(lExcludeFocus)

   TabCtrl_DeselectAll(::hTab,lExcludeFocus)

   RETURN(NIL)

*-----------------------------------------------------------------------------*
wintabs.prg289
TABCONTROL:METHODGetCurFocus()
METHOD GetCurFocus()

  RETURN TabCtrl_GetCurFocus(::hTab )+1

*-----------------------------------------------------------------------------*
wintabs.prg296
TABCONTROL:METHODGetCurSel()
METHOD GetCurSel()

   RETURN TabCtrl_GetCurSel(::hTab)+1

*-----------------------------------------------------------------------------*
wintabs.prg301
TABCONTROL:METHODGetExtendedStyle()
METHOD GetExtendedStyle()

   RETURN TabCtrl_GetExtendedStyle(::hTab)

*-----------------------------------------------------------------------------*
wintabs.prg306
TABCONTROL:METHODGetImageList()
METHOD GetImageList()

   RETURN NIL //TabCtrl_GetImageList(::hTab)

*-----------------------------------------------------------------------------*
wintabs.prg311
TABCONTROL:METHODGetItem(nItem,ptrItem)
METHOD GetItem(nItem,ptrItem)

   RETURN TabCtrl_GetItem(::hTab,nItem-1,@ptrItem)

*-----------------------------------------------------------------------------*
wintabs.prg316
TABCONTROL:METHODGetItemCount()
METHOD GetItemCount()

   RETURN TabCtrl_GetItemCount(::hTab)

*-----------------------------------------------------------------------------*
wintabs.prg321
TABCONTROL:METHODGetItemRect(nItem)
METHOD GetItemRect(nItem)

   RETURN TabCtrl_GetItemRect(::hTab,nItem-1)

*-----------------------------------------------------------------------------*
wintabs.prg326
TABCONTROL:METHODGetRowCount()
METHOD GetRowCount()

   RETURN TabCtrl_GetRowCount(::hTab)

*-----------------------------------------------------------------------------*
wintabs.prg331
TABCONTROL:METHODGetToolTips()
METHOD GetToolTips()

   RETURN TabCtrl_GetToolTips(::hTab)

*-----------------------------------------------------------------------------*
wintabs.prg336
TABCONTROL:METHODGetUnicodeFormat()
METHOD GetUnicodeFormat()

   RETURN TabCtrl_GetUnicodeFormat(::hTab)

*-----------------------------------------------------------------------------*
wintabs.prg341
TABCONTROL:METHODHighlightItem(nItem,nHighlight)
METHOD HighlightItem(nItem,nHighlight)

   RETURN TabCtrl_HighlightItem(::hTab,nItem-1,nHighlight)

*-----------------------------------------------------------------------------*
wintabs.prg346
TABCONTROL:METHODHitTest(nPtrHitTestInfo)
METHOD HitTest(nPtrHitTestInfo)

   RETURN TabCtrl_HitTest(::hTab,nPtrHitTestInfo) + 1

*-----------------------------------------------------------------------------*
wintabs.prg351
TABCONTROL:METHODRemoveImage(nImageIndex)
METHOD RemoveImage(nImageIndex)

   RETURN TabCtrl_RemoveImage(::hTab, nImageIndex-1)

*-----------------------------------------------------------------------------*
wintabs.prg356
TABCONTROL:METHODSetCurFocus(nItem)
METHOD SetCurFocus(nItem)

   TabCtrl_SetCurFocus(::hTab, nItem-1)

   RETURN(NIL)

*-----------------------------------------------------------------------------*
wintabs.prg361
TABCONTROL:METHODSetCurSel(nItem)
METHOD SetCurSel(nItem)

   RETURN TabCtrl_SetCurSel(::hTab, nItem-1) + 1

*-----------------------------------------------------------------------------*
wintabs.prg368
TABCONTROL:METHODSetExtendedStyle(nExStyle)
METHOD SetExtendedStyle(nExStyle)

   RETURN TabCtrl_SetExtendedStyle(::hTab,nExStyle)

*-----------------------------------------------------------------------------*
wintabs.prg373
TABCONTROL:METHODSetImageList(hImageList)
METHOD SetImageList(hImageList)

   RETURN TabCtrl_SetImageList(::hTab, hImageList)

*-----------------------------------------------------------------------------*
wintabs.prg378
TABCONTROL:METHODSetItem(nItem, cText)
METHOD SetItem(nItem, cText)

   RETURN TabCtrl_SetItem(::hTab, nItem-1, cText )

*-----------------------------------------------------------------------------*
wintabs.prg383
TABCONTROL:METHODSetItemExtra(nBytes)
METHOD SetItemExtra(nBytes)

   RETURN TabCtrl_SetItemExtra(::hTab, nBytes)

*-----------------------------------------------------------------------------*
wintabs.prg388
TABCONTROL:METHODSetItemSize(x,y)
METHOD SetItemSize(x,y)

   RETURN TabCtrl_SetItemSize(::hTab, x, y )

*-----------------------------------------------------------------------------*
wintabs.prg393
TABCONTROL:METHODSetMinTabWidth(dx)
METHOD SetMinTabWidth(dx)

   RETURN TabCtrl_SetMinTabWidth( ::hTab, dx )

*-----------------------------------------------------------------------------*
wintabs.prg398
TABCONTROL:METHODSetPadding( cx, cy )
METHOD SetPadding( cx, cy )

   TabCtrl_SetPadding( ::hTab, cx, cy )

   RETURN(NIL)

*-----------------------------------------------------------------------------*
wintabs.prg403
TABCONTROL:METHODSetToolTips( hToolTips )
METHOD SetToolTips( hToolTips )

   TabCtrl_SetToolTips( ::hTab, hToolTips )

   RETURN(NIL)

*-----------------------------------------------------------------------------*
wintabs.prg410
TABCONTROL:METHODSetUnicodeFormat( lUnicode )
METHOD SetUnicodeFormat( lUnicode )

   RETURN TabCtrl_SetUnicodeFormat( ::hTab, lUnicode )

*-----------------------------------------------------------------------------*




wintabs.prg417
wintbar.prg
TypeFunctionSourceLine
CLASSTOOLBAR
CLASS TOOLBAR

 DATA abuttons
 DATA aBitmaps
 DATA hParent
 DATA hWnd
 DATA nId
 DATA nStyle
 DATA Created
 DATA aText
 DATA hBmp
 DATA nProc
 DATA aTips
 DATA nBtn HIDDEN
 DATA aMenus
METHOD Init() CONSTRUCTOR

METHOD AddButton
METHOD AddBitmap
METHOD AddString
METHOD Create
METHOD createbuttons
METHOD tbProc

METHOD setsizes(xBtn,yBtn,xImg,yImg )
METHOD setheight(nHeight )
METHOD loadbitmap
METHOD setbitmap
METHOD setbuttons
METHOD commandtoindex
METHOD GetItemId
METHOD getitemrect
METHOD getbuttonstyle
METHOD getbuttoninfo
METHOD setbuttoninfo
METHOD getbuttontext
METHOD setbuttontext
METHOD gettollbarctrl
METHOD disable
METHOD enable
METHOD disableall
METHOD enableall
METHOD CheckButton
METHOD IsButtonChecked
METHOD AddMenu
ENDCLASS


*-----------------------------------------------------------------------------*
wintbar.prg79
TOOLBAR:METHODInit()
METHOD Init()

  InitCommonControlsEx(ICC_BAR_CLASSES)
  ::aButtons:={}
  ::aTips   :={}
  ::nStyle  :=0
  ::nId     :=0
  ::Created := .F.
  ::aText   :={}
  ::aBitmaps:={}
  ::aMenus  :={}
RETURN(self)


*-----------------------------------------------------------------------------*
wintbar.prg129
TOOLBAR:METHODAddBitmap(hInst, nhIdBmp, nButtons)
METHOD AddBitmap(hInst, nhIdBmp, nButtons)

  LOCAL tbab IS TBADDBITMAP

    DEFAULT nButtons TO 1

    tbab:hInst := hInst
    tbab:nId   := nhIdBmp

    AADD(::aBitmaps,{tbab,nButtons})
    IF ::created
      SendMessage(::hWnd,TB_ADDBITMAP,nButtons,tbab:value)
    ENDIF


    RETURN(1)

*-----------------------------------------------------------------------------*
wintbar.prg145
TOOLBAR:METHODAddButton(nIndex, nId, nState, nStyle, ncargo, nString, cText, cToolTip )
METHOD AddButton(nIndex, nId, nState, nStyle, ncargo, nString, cText, cToolTip )

  LOCAL tbb IS TBBUTTON

  HB_SYMBOL_UNUSED( cText )

  tbb:ibitmap   :=IFNIL(nIndex,-1,nIndex)
  tbb:idCommand :=nId // must be supplied
  tbb:fsState   :=IFNIL(nState,TBSTATE_ENABLED,nState)
  tbb:fsStyle   :=IFNIL(nStyle,TBSTYLE_BUTTON,nStyle)
  tbb:dwData    :=IFNIL(ncargo,0,nCargo)
  tbb:iString   :=IFNIL(nString,0,nString)

  AADD(::aButtons,tbb)
  AADD(::aTips,cToolTip)
  IF ::Created
     SendMessage(::hWnd,TB_ADDBUTTONS,1,tbb:value)
  Endif


RETURN(self)
wintbar.prg164
TOOLBAR:METHODAddMenu(nButton, nMenuId, cMenuText )
METHOD AddMenu(nButton, nMenuId, cMenuText )
AADD(::aMenus,{nButton, nMenuId, cMenuText })
return(self)

*-----------------------------------------------------------------------------*
wintbar.prg186
TOOLBAR:METHODaddstring(cText)
METHOD addstring(cText)

  IF ::created
     SendMessage(::hWnd,TB_ADDSTRING,0,cText)
  Else
     AADD(::aText,cText)
  Endif

  RETURN(self)

*-----------------------------------------------------------------------------*
wintbar.prg191
TOOLBAR:METHODCreate(hParent,nStyle,nId,nImg,hBMInst,nBMId,xBtn,yBtn,xBmp,yBmp)
METHOD Create(hParent,nStyle,nId,nImg,hBMInst,nBMId,xBtn,yBtn,xBmp,yBmp)

   LOCAL cButtons:=""
   LOCAL cStrings:=""
   LOCAL tbb IS TBBUTTON
   LOCAL i


   ::hParent:=hParent
   ::nStyle :=IFNIL(nStyle,TBSTYLE_FLAT+WS_CHILD+WS_VISIBLE,nStyle)
   ::nId    :=IFNIL(nId,0,nId)

   if ISNIL(hBMInst) .AND. ISNIL(nBMId)
     hBMInst:=HINST_COMMCTRL
     nBMId  :=IDB_STD_LARGE_COLOR
   endif

   FOR i:=1 TO LEN(::aButtons)
      cButtons+=::aButtons[i]:Value
   NEXT

// ::hWnd:=CreateWindowEx(0,TOOLBARCLASSNAME,"",::nStyle,0,0,300,30,::hParent,::nId)


 ::hWnd:=CreateToolBarEx(::hParent,::nStyle,::nId,nImg,hBMInst,nBMId,cButtons,LEN(::aButtons),;
                 xbtn,yBtn,xBmp,yBmp, tbb:sizeof())

 ::nProc:=SetProcedure(::hParent,{|hWnd, nMsg,nwParam,nlParam| HB_SYMBOL_UNUSED( hWnd ), ::tbProc(nMsg,nwParam,nlParam)},{WM_NOTIFY})


//   SendMessage(::hWnd,TB_BUTTONSTRUCTSIZE,::aButtons[1]:sizeof,0)

 //  FOR i:=1 TO LEN(::aBitmaps)
 //    SendMessage(::hWnd,TB_ADDBITMAP,::aBitmaps[i,2],::aBitmaps[i,1]:value)
 //  NEXT

   sendmessage(::hwnd,TB_SETEXTENDEDSTYLE,0,TBSTYLE_EX_DRAWDDARROWS )

   //SendMessage(::hWnd,TB_ADDBUTTONS,LEN(::aButtons),cButtons)

   FOR i:=1 to LEN(::aText)
      SendMessage(::hWnd,TB_ADDSTRING,0,::aText[i])
   NEXT

   ::Created:=.T.

RETURN(::hWnd)


*-----------------------------------------------------------------------------*
wintbar.prg206
TOOLBAR:METHODtbProc(nMsg,nwParam,nlParam)
METHOD tbProc(nMsg,nwParam,nlParam)

   LOCAL Hdr
   LOCAL Ttt
   LOCAL nmt
   LOCAL hMenu,aRect, aPoint
   LOCAL n,x
   DO CASE
   CASE nMsg==WM_NOTIFY
     Hdr IS NMHDR
     Hdr:Buffer(peek(nlParam,Hdr:sizeof))

     DO CASE
     CASE Hdr:code==TBN_DROPDOWN
         Nmt IS NMTOOLBAR
         nmt:buffer(peek(nlParam,nmt:sizeof))
         IF (n:=ASCAN(::aMenus,{|a| a[1]==nmt:iItem})) > 0
            ::nBtn:=nmt:iItem
            hMenu := CreatePopupMenu( )
            FOR x:=1 TO LEN(::aMenus)
                IF ::aMenus[x][1] == nmt:iItem
                   IF ::aMenus[x][3] == "-".and. ::aMenus[x][2] == 0
                      AppendMenu( hMenu, MF_SEPARATOR )
                     ELSE
                      AppendMenu( hMenu, MF_ENABLED + MF_STRING,::aMenus[x][2],::aMenus[x][3])
                   ENDIF
                ENDIF
            NEXT

            x:= ASCAN(::aButtons,{|btn| btn:idCommand==nmt:iItem})
            aRect:=GetToolBarItemRect(::hWnd,x-1)
            aPoint := {aRect[1],aRect[4]}
            ClientToScreen( ::hParent, @aPoint )
            TrackPopupMenu( hMenu, TPM_LEFTALIGN+TPM_TOPALIGN, aPoint[1]+9, aPoint[2], 0, ::hWnd )
            DestroyMenu(hMenu)
            RETURN 0
         end
     CASE Hdr:code==TTN_NEEDTEXT
       IF (n:=ASCAN(::aButtons,{|btn| btn:idCommand==Hdr:idFrom})) > 0
         Ttt IS TOOLTIPTEXT
         Ttt:Buffer(peek(nlParam,Ttt:sizeof))
         Ttt:lpszText:=::aTips[n] //"ID:"+STR(Hdr:IdFrom)
         poke(nlParam,Ttt:value,Ttt:sizeof)
       ENDIF

     CASE Hdr:code==TBN_QUERYINSERT
         RETURN(1)
     CASE Hdr:code==TBN_QUERYDELETE
         RETURN(1)
     CASE Hdr:code==TBN_GETBUTTONINFO
         Nmt IS NMTOOLBAR
         nmt:buffer(peek(nlParam,nmt:sizeof))
         /*
         int     iItem;      // cmd
         TBBUTTON tbButton;
         int     cchText;    // str len
         LPSTR   pszText;    // btn text
         RECT    rcButton;   // new (!)
         */
         RETURN(1)

     ENDCASE

   ENDCASE

RETURN( CallWindowProc(::nProc,::hParent,nMsg,nwParam,nlParam))

*-----------------------------------------------------------------------------*
wintbar.prg269
TOOLBAR:METHODCreateButtons()
METHOD CreateButtons()

   LOCAL i

   FOR i:=1 TO LEN(::aBitmaps)
   NEXT

RETURN(NIL)

*-----------------------------------------------------------------------------*
wintbar.prg338
TOOLBAR:METHODsetsizes(xBtn,yBtn,xImg,yImg )
METHOD setsizes(xBtn,yBtn,xImg,yImg )

HB_SYMBOL_UNUSED( xBtn )
HB_SYMBOL_UNUSED( yBtn )
HB_SYMBOL_UNUSED( xImg )
HB_SYMBOL_UNUSED( yImg )

RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg350
TOOLBAR:METHODsetheight(nHeight )
METHOD setheight(nHeight )

HB_SYMBOL_UNUSED( nHeight )

RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg360
TOOLBAR:METHODloadbitmap
METHOD loadbitmap
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg367
TOOLBAR:METHODsetbitmap
METHOD setbitmap
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg371
TOOLBAR:METHODsetbuttons
METHOD setbuttons
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg375
TOOLBAR:METHODcommandtoindex
METHOD commandtoindex
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg379
TOOLBAR:METHODGetItemId
METHOD GetItemId
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg383
TOOLBAR:METHODgetitemrect(nIndex)
METHOD getitemrect(nIndex)
RETURN(GetToolbarItemRect(::hWnd,nIndex))

*-----------------------------------------------------------------------------*
wintbar.prg387
TOOLBAR:METHODgetbuttonstyle
METHOD getbuttonstyle
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg392
TOOLBAR:METHODgetbuttoninfo
METHOD getbuttoninfo
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg396
TOOLBAR:METHODsetbuttoninfo
METHOD setbuttoninfo
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg400
TOOLBAR:METHODgetbuttontext
METHOD getbuttontext
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg404
TOOLBAR:METHODsetbuttontext
METHOD setbuttontext
RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg408
TOOLBAR:METHODgettollbarctrl
METHOD gettollbarctrl

RETURN(self)
*-----------------------------------------------------------------------------*
wintbar.prg412
TOOLBAR:METHODdisable(nBtn)
METHOD disable(nBtn)
SendMessage(::hWnd,TB_ENABLEBUTTON,nBtn,0)
RETURN(SELF)

*-----------------------------------------------------------------------------*
wintbar.prg417
TOOLBAR:METHODenable(nBtn,lFlag)
METHOD enable(nBtn,lFlag)
DEFAULT lFlag TO .T.
SendMessage(::hWnd,TB_ENABLEBUTTON,nBtn,iif(lFlag,1,0))
RETURN(SELF)

*-----------------------------------------------------------------------------*
wintbar.prg423
TOOLBAR:METHODdisableall()
METHOD disableall()
AEVAL(::aButtons,{|btn| ::disable(btn:idCommand)})
return(self)

*-----------------------------------------------------------------------------*
wintbar.prg430
TOOLBAR:METHODenableall()
METHOD enableall()
AEVAL(::aButtons,{|btn| ::enable(btn:idCommand)})
return(self)
wintbar.prg436
TOOLBAR:METHODCheckButton(nBtn,lFlag)
METHOD CheckButton(nBtn,lFlag)
DEFAULT lFlag TO !::IsButtonChecked(nBtn)
SendMessage(::hWnd,TB_CHECKBUTTON,nBtn,iif(lFlag,1,0))
RETURN(SELF)
wintbar.prg440
TOOLBAR:METHODIsButtonChecked(nBtn)
METHOD IsButtonChecked(nBtn)
RETURN(IIF(SendMessage(::hWnd,TB_ISBUTTONCHECKED,nBtn,0)==0,.F.,.T.))
wintbar.prg445