Jump to content

  • Log In with Google      Sign In   
  • Create Account


[WinAPI] - ShBrowseForFolder - modeless window not working


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 savail   Members   -  Reputation: 329

Like
0Likes
Like

Posted 17 November 2012 - 02:43 PM

Hey,
I was trying to create a modeless dialog window to choose a folder (that it doesn't stop the program).
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 );

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, 17 November 2012 - 02:45 PM.


Sponsor:

#2 kubera   Members   -  Reputation: 887

Like
0Likes
Like

Posted 21 November 2012 - 07:59 AM

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)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS