Show BrowseForFolder API dialog as Modal? 
Author Message
 Show BrowseForFolder API dialog as Modal?

I know how to call BrowseForFolder( ) for user to select a folder. It is
much better choice than VB's built-in FolderListBox when you want user to
pick a folder's path. But I could not find what setting makes it a modal
dialog. Would someone give me a pointer, please?

TIA,

Norm



Tue, 15 Jun 2004 06:13:27 GMT  
 Show BrowseForFolder API dialog as Modal?
Private Type BrowseInfo
     hWndOwner As Long
     pIDLRoot As Long
     pszDisplayName As Long
     lpszTitle As Long
     ulFlags As Long
     lpfnCallback As Long
     lParam As Long
     iImage As Long
End Type

Set the hWndOwner to that of a form

On Thu, 27 Dec 2001 22:13:27 GMT, "Norm Yuan"

Quote:

>I know how to call BrowseForFolder( ) for user to select a folder. It is
>much better choice than VB's built-in FolderListBox when you want user to
>pick a folder's path. But I could not find what setting makes it a modal
>dialog. Would someone give me a pointer, please?

>TIA,

>Norm



Tue, 15 Jun 2004 23:52:19 GMT  
 Show BrowseForFolder API dialog as Modal?
Thanks.

In my wrapped function of BrowseForFolder, "GetDescktopWindow" API (Private
Declare Function GetDesktopWindow Lib "User32" () As Long) to get hWndOwner,
somehow it does not work (I cannot remember where I got the code, on the
web, or a VB book).

Now that I always call MyBrowseForFolder() from a form of my applications, I
now redefine this function by adding a new parameter hForm: Function
MyBowseFolder(hForm as Long, ....) as String. Then when using the function,
simply pass Me.hWnd as argument.


Quote:
> Private Type BrowseInfo
>      hWndOwner As Long
>      pIDLRoot As Long
>      pszDisplayName As Long
>      lpszTitle As Long
>      ulFlags As Long
>      lpfnCallback As Long
>      lParam As Long
>      iImage As Long
> End Type

> Set the hWndOwner to that of a form

> On Thu, 27 Dec 2001 22:13:27 GMT, "Norm Yuan"

> >I know how to call BrowseForFolder( ) for user to select a folder. It is
> >much better choice than VB's built-in FolderListBox when you want user to
> >pick a folder's path. But I could not find what setting makes it a modal
> >dialog. Would someone give me a pointer, please?

> >TIA,

> >Norm



Wed, 16 Jun 2004 01:33:54 GMT  
 Show BrowseForFolder API dialog as Modal?
It is so obvious that I should have used GetActiveWindows() API instead of
GetDesktopWindow() API. for hWndOwner. Why didn't I find it earlier?


Quote:
> Thanks.

> In my wrapped function of BrowseForFolder, "GetDescktopWindow" API
(Private
> Declare Function GetDesktopWindow Lib "User32" () As Long) to get
hWndOwner,
> somehow it does not work (I cannot remember where I got the code, on the
> web, or a VB book).

> Now that I always call MyBrowseForFolder() from a form of my applications,
I
> now redefine this function by adding a new parameter hForm: Function
> MyBowseFolder(hForm as Long, ....) as String. Then when using the
function,
> simply pass Me.hWnd as argument.



> > Private Type BrowseInfo
> >      hWndOwner As Long
> >      pIDLRoot As Long
> >      pszDisplayName As Long
> >      lpszTitle As Long
> >      ulFlags As Long
> >      lpfnCallback As Long
> >      lParam As Long
> >      iImage As Long
> > End Type

> > Set the hWndOwner to that of a form

> > On Thu, 27 Dec 2001 22:13:27 GMT, "Norm Yuan"

> > >I know how to call BrowseForFolder( ) for user to select a folder. It
is
> > >much better choice than VB's built-in FolderListBox when you want user
to
> > >pick a folder's path. But I could not find what setting makes it a
modal
> > >dialog. Would someone give me a pointer, please?

> > >TIA,

> > >Norm



Wed, 16 Jun 2004 02:35:13 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. GetOpenFilename API shows a non-modal dialog

2. Showing Modal Dialog Boxes in COM Add-Ins

3. Most down window shows up with modal dialog

4. modal dialog not showing

5. Background Processing while Modal Dialog is Shown

6. Modal Common Dialog Boxes using Windows API Calls

7. Dialog Boxes - Application Modal vs. System Modal

8. closing chains of modal dialogs... - modal [1/1]

9. Show Local AND Shared (network) drives in Browseforfolder

10. Browseforfolder should show only local and shared drives

11. Modal Dialogs and Arrays as Dialog Arguments

12. Posting a form from a modal dialog to a IFRAME in the Dialog

 

 
Powered by phpBB® Forum Software