Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

Avoid Drag & Drop in Windows 7 Explorer using C# programming......
Please some one Help me sir/madam..
Posted
Comments
Shanu2rick 25-Mar-13 2:00am    
I don't understand your question, please provide some more information

1 solution

Create DWORD(32-bit) "DefaultDropEffect"
value="4" - create Shorcut for drag and drop
value="0" - normal

HKEY_CLASSES_ROOT/*/DefaultDropEffect


C# Code for creat shortcut link for mouse drag and drop

CreateShortCut(4); // Function Cll
C#
#region "Drag And Drop"
       private void CreateShortCut(int iAction)
       {
               RegistryKey registryKey = Registry.ClassesRoot.CreateSubKey("*");
               if (registryKey == null)
               {
                   throw new Exception("CreateSubKey failed");
               }
               if (iAction != 0)
               {
                   registryKey.SetValue("DefaultDropEffect", iAction, RegistryValueKind.DWord);
               }
               else
               {
                   registryKey.DeleteValue("DefaultDropEffect", false);
               }

               registryKey.Close();

               registryKey = Registry.ClassesRoot.CreateSubKey("AllFilesystemObjects");
               if (registryKey == null)
               {
                   throw new Exception("CreateSubKey failed (AllFilesystemObjects)");
               }

               if (iAction != 0)
               {
                   registryKey.SetValue("DefaultDropEffect", iAction, RegistryValueKind.DWord);
               }
               else
               {
                   registryKey.DeleteValue("DefaultDropEffect", false);
               }

           }

       #endregion
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900