Advertisement Jump to content
Sign in to follow this  

[WinAPI] - ShBrowseForFolder - modeless window not working

This topic is 2255 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was trying to create a modeless dialog window to choose a folder (that it doesn't stop the program).

memset( & bi, 0, sizeof( bi ) );
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = FolderPath;
bi.lpszTitle = "Choose path of your folder";
LPITEMIDLIST pIDL = SHBrowseForFolder( & bi );

Though it should work, it doesn't... I put some breakpoints after LPITEMIDLIST pIDL = SHBrowseForFolder( & bi ); 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
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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!