Question

I have a TOpenDialog component I am creating on runtime and I want to disable the hint that pops up over files when it is used. I have not written any exrta code for this than creating the object, executing the object and extracting the filename,, then freeing the instance.

Can I do what I want to do? If so, how do I do this?

Was it helpful?

Solution

I googled for "opendialog crash tooltip" and the first hit gave me this. The solution for their problem (and probably yours) is this:

[...]

You only need to add this modification to the first form of your application:

uses ActiveX;

initialization
  OleInitialize(nil);

finalization
  OleUninitialize 
end.

OTHER TIPS

Since this is a Windows common dialog, you may have to jump in and hook into the dialogproc and manually try and process the tooltip messages. You can look here for a start about how to customize the common dialogs; http://msdn.microsoft.com/en-us/library/ms646951.aspx. You can also look at creating your own TOpenDialog descendant and override the WndProc protected method to get access to the dialog messages and notifications. I suspect you'd also need to do some deeper hooking and start getting into dealing with the explorer shell. The file list in that dialog is actually an instance of parts of the Windows Explorer shell.

Another question is what is it you're trying to accomplish by hiding this information from the user? Maybe there is some other solution to what you're trying to do rather than disabling some intrinsic functionality?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top