views:

200

answers:

2

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

+1  A: 

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?

Allen Bauer
i have a issuse where my program crashes on tool tip but handles the file fine if its avoided. i have traced everything and personaly made sure all candles are closed it even checks before it runs this code, but i still get a random crash that the debugger has no explanation for so im working arond
Arthur
Sounds more like a problem with an explorer plugin on the machine, rather than your code.
Gerry
+1  A: 

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.
The_Fox
where does the finalization bit go?
Arthur
At the end of your unit, just above the last end, you should place the initialization and finalization statements. ActiveX has to be placed in your uses section.
The_Fox