In Windows when one is in Windows Explorer and right clicks a file or directory, a Windows context menu appears with all of the actions that one can do regarding this file or directory.
Way back in the day, Brad Stowers wrote a unit ItemProp.pas that did the exact same thing within one's own Delphi application. This unit works great through Delphi 5, but for D7 and above, a lot of errors are thrown.
http://www.koders.com/delphi/fid7ABE724EBD5F2123FF824AFD45151D2A087C5E6C.aspx?s=network
Okay! I admit it! I AM lazy and have Googled for an updated unit and even one like this, have worked for a couple hours trying to make this unit at least D7 compatible but I guess I am missing something somewhere as I have not been successful in any endeavor regarding this.
So... my question is, has anyone updated this unit for D7 and above OR does a unit or component exist that does what this code does?
Thanks in advance!
John
I suspect all that is needed is to update the compiler version directives in DFS.inc
I added
{$DEFINE DFS_DELPHI}
{$DEFINE DFS_COMPILER_4_UP}
{$DEFINE DFS_NO_COM_CLEANUP}
{$DEFINE DFS_COMPILER_3_UP}
to the main file (ItemProp.pas), and it compiled OK on Delphi 2007, but I haven't tried running the code yet.
Instead of translate this unit you can use the updated JEDI JCL library, check the JclShell unit, inside of this unit exist a function called DisplayContextMenu
whcih shows the shell context menu for a File.
function DisplayContextMenu(const Handle: HWND; const FileName: string;
Pos: TPoint): Boolean;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With