cGetDir dialog, and make new folder button

cGetDir dialog, and make new folder button

Postby AlexSchaft » Tue Oct 30, 2007 7:21 am

Hi,

Is there a way to hide the New folder button when using cGetDir()?

I've been reading through the GetOpenFileName API docs, but can't find it in the flags...

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa


Postby Antonio Linares » Tue Oct 30, 2007 10:01 am

Alex, Enrico,

I guess that you could locate the button handle and hide it :-)

Stepping through the dialog controls, checking the control classname and once found a button, hide it, until the right one is located. winapi\getdir.c ComDlgHkFile() seems the right place to do it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Oct 30, 2007 11:11 am

Yes, it could work. But is it worth the pain?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Oct 30, 2007 11:17 am

Probably not :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AlexSchaft » Tue Oct 30, 2007 12:05 pm

I found that ShBrowseForFolder is used. A google search found the following constant:

#define BIF_NONEWFOLDERBUTTON 0x200

But it had no effect. Will keep trying...
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby AlexSchaft » Tue Oct 30, 2007 1:10 pm

Found the problem

Had to change:

if ( ISNUM( 5 ) ) {
// lpbi.ulFlags = _parni( 5 ) ;
lpbi.ulFlags = _parnl( 5 ) ;
}

lpIDList = SHBrowseForFolder( &lpbi );
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

cGetDir - more

Postby AlexSchaft » Tue Oct 30, 2007 1:21 pm

Hi again,

Have to call as follows:


Code: Select all  Expand view

#define BIF_NONEWFOLDERBUTTON 0x200
#define BIF_RETURNONLYFSDIRS  0x0001
#define BIF_DONTGOBELOWDOMAIN  0x0002
#define BIF_STATUSTEXT  0x0004
#define BIF_RETURNFSANCESTORS  0x0008
#define BIF_EDITBOX  0x0010
#define BIF_VALIDATE  0x0020
#define BIF_NEWDIALOGSTYLE  0x0040
#define BIF_USENEWUI  (BIF_NEWDIALOGSTYLE|BIF_EDITBOX)
#define BIF_BROWSEINCLUDEURLS  0x0080
#define BIF_BROWSEFORCOMPUTER  0x1000
#define BIF_BROWSEFORPRINTER  0x2000
#define BIF_BROWSEINCLUDEFILES 0x4000
#define BIF_SHAREABLE  0x8000

cGetDir( cTitle, cPath,,, BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN + BIF_USENEWUI + BIF_NONEWFOLDERBUTTON )
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Tue Oct 30, 2007 1:40 pm

Alex,

Very good, thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Oct 30, 2007 3:45 pm

AlexSchaft wrote:I found that ShBrowseForFolder is used.


Ops! Right!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, Willi Quintana and 114 guests