February 16, 2020, 12:34:15 pm

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Browse for Folder Custom type - almost there

Started by Guilect, May 17, 2010, 07:17:27 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guilect

Hi,

The Browse for Folder Dialog code can be found here in the forum and has been done by a few people.
But, the way they all work is that they bring up the standard BFF dialog window.
The code I have ported to IWB does not use the standard dialog window.
It places the browse window into your own dialog.
So you can incorporate it into your own program directly or
make a highly customized version of the BFF dialog.

The code works as I had intended it to for a modal BFF window.
However, it would be great to get it to work 'non-blocking'
Perhaps someone can figure out how to get the messagebox in the code to
appear right after the BFF control is created in the dialog window.

sapero

Without creating a set of classes for ShellView, you can move the dialog to a separate thread, to make it nonblocking. Just replace the call to FolderRequest with CreateThread, and the FolderRequest put into thread subroutine:
Code Select
SHOWDIALOG d1
int ThreadId
DECLARE IMPORT, CreateThread(pointer security,int stack,int function,pointer parameter,int flags,lpThreadId AS POINTER),INT
_CloseHandle(CreateThread(0,0,&ThreadProc,0,0,&ThreadId))

MESSAGEBOX 0, dir, "", 0
WAITUNTIL done = true

END

sub ThreadProc(pointer parameter)
FolderRequest(0, "get folder", dir, GetStartPath, 0x441)
endsub

Guilect

Works like a champ now.
I have never really worked with threads.
Thanks sapero.