Author Topic: Browse for Folder Custom type - almost there  (Read 18060 times)

0 Members and 1 Guest are viewing this topic.

Offline Guilect

  • Jr. Member
  • **
  • Posts: 86
Browse for Folder Custom type - almost there
« on: May 17, 2010, 07:17:27 PM »
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.

Offline sapero

  • Senior Developer
  • Hero Member
  • *****
  • Posts: 1291
Re: Browse for Folder Custom type - almost there
« Reply #1 on: May 18, 2010, 01:50:31 AM »
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

Offline Guilect

  • Jr. Member
  • **
  • Posts: 86
Re: Browse for Folder Custom type - almost there
« Reply #2 on: May 18, 2010, 05:22:17 AM »
Works like a champ now.
I have never really worked with threads.
Thanks sapero.