FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Shell Common Dialogs
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Shell Common Dialogs
Posted: Mon Jul 11, 2011 08:18 AM
http://koti.mbnet.fi/vaultec/files/miscellaneous/undocw95/common.html

comdlg32.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   MsgInfo( PickIconDlg() )

return nil

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

BOOL WINAPI PickIconDlg(
     HWND     hwndOwner, 
     LPSTR    lpstrFile, 
     DWORD    nMaxFile, 
     LPDWORD  lpdwIconIndex );

HB_FUNC( PICKICONDLG )
{
   DWORD dwIconIndex = 0; 
   char buffer[ 256 ];
   
   memset( buffer, 0, 256 );

   if( PickIconDlg( ( HWND ) hb_parnl( 1 ), buffer, 256, &dwIconIndex ) )
      hb_retnl( dwIconIndex );
} 

#pragma ENDDUMP


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Shell Common Dialogs
Posted: Mon Jul 11, 2011 08:32 AM
http://www.codeproject.com/KB/shell/runfiledlg.aspx

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   // MsgInfo( PickIconDlg() )

   RunFileDlg()

return nil

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

BOOL WINAPI PickIconDlg(
     HWND     hwndOwner, 
     LPSTR    lpstrFile, 
     DWORD    nMaxFile, 
     LPDWORD  lpdwIconIndex );
     
typedef void WINAPI ( * PRUNFILEDLG ) (
     HWND    hwndOwner, 
     HICON   hIcon, 
     LPCSTR  lpstrDirectory, 
     LPCSTR  lpstrTitle, 
     LPCSTR  lpstrDescription,
     UINT    uFlags );     

HB_FUNC( PICKICONDLG )
{
   DWORD dwIconIndex = 0; 
   char buffer[ 256 ];
   
   memset( buffer, 0, 256 );

   if( PickIconDlg( ( HWND ) hb_parnl( 1 ), buffer, 256, &dwIconIndex ) )
      hb_retnl( dwIconIndex );
} 

HB_FUNC( RUNFILEDLG )
{
   FARPROC pRunFileDlg = GetProcAddress( GetModuleHandle( "shell32.dll" ), ( LPCSTR ) 61 );
   PRUNFILEDLG p = ( PRUNFILEDLG ) pRunFileDlg;
   
   p( ( HWND ) hb_parnl( 1 ), ( HICON ) hb_parnl( 2 ), hb_parc( 3 ), hb_parc( 4 ), hb_parc( 5 ), hb_parnl( 6 ) );
}
   
#pragma ENDDUMP


regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion