Created
April 6, 2015 19:53
-
-
Save jpluimers/b6edd5c287e75bd98f69 to your computer and use it in GitHub Desktop.
Windows 7 hangs with common dialogs when COM is not initialised correctly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
LDialogEvents := TFileDialogEvents.Create(Self); | |
Advise(LDialogEvents, LAdviseCookie); | |
try | |
Result := Succeeded(Show(ParentWnd)); //// <---- hangs here | |
if Result then | |
Result := Succeeded(GetResults); | |
finally | |
Unadvise(LAdviseCookie); | |
end; | |
finally | |
EnableTaskWindows(LWindowList); | |
SetActiveWindow(ParentWnd); | |
RestoreFocusState(LFocusState); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment