Sign in to follow this  
savail

[WinAPI] - ShBrowseForFolder - modeless window not working

Recommended Posts

savail    333
Hey,
I was trying to create a modeless dialog window to choose a folder (that it doesn't stop the program).
[CODE]
BROWSEINFO bi;
memset( & bi, 0, sizeof( bi ) );
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = FolderPath;
bi.lpszTitle = "Choose path of your folder";
bi.ulFlags = BIF_USENEWUI | BIF_VALIDATE | BIF_NONEWFOLDERBUTTON;
LPITEMIDLIST pIDL = SHBrowseForFolder( & bi );
[/CODE]

Though it should work, it doesn't... I put some breakpoints after [CODE]LPITEMIDLIST pIDL = SHBrowseForFolder( & bi );[/CODE] and program appears to stop here and not go further until I close ShBrowseforFolder window. Also when dragging the window, my main window doesn't redraw. However by clicking on my main window I'm making it active (the titlebar becomes blue normally)... but it's still blocked by the ShBrowseForFolder window... What might be the problem?
I would be very grateful for any help! Edited by savail

Share this post


Link to post
Share on other sites
kubera    1589
It would be because both operations are processed in a single thread.
You could consider running this Shell API in an additional thread.
(a synchronization would be required)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this