Unable to find SHObjectProperties

Hi..

I am using the SHObjectProperties. I have written the code as:

public partial class Form1 : Form

{

[DllImport("shell32.dll", EntryPoint = "SHObjectProperties", CharSet = CharSet.Auto)]

public static extern bool CallPropDialog(IntPtr hwnd, GetProperties dwType, string szObject, string szPage);

public enum GetProperties

{

SHOP_PRINTERNAME = 0x00000001, // lpObject points to a printer friendly name

SHOP_FILEPATH = 0x00000002, // lpObject points to a fully qualified path+file name

SHOP_VOLUMEGUID = 0x00000004 // lpObject points to a Volume GUID

};

private void Form1_Load(object sender, EventArgs e)

{

CallPropDialog ( this.Handle , GetProperties.SHOP_FILEPATH , "c:\\Windows",null);

}

}

I am getting an error as : Unable to find an entry point named 'SHObjectProperties' in DLL 'shell32.dll'.

Could anyone please help in correcting this error..



Answer this question

Unable to find SHObjectProperties

  • Mike Hadlow

    Yes, I copy pasted your code and it works on my machine. I am running Windows XP with SP2. What version of Windows are you running You can download a PE viewer like the Anywhere PE Viewer then open the shell32.dll and navigate to the export tab and perform a search on SHObjectProperties.

  • Steve Jackson

    Musafir wrote:

    I am using windows 2000 professional service pack 4.

    I have one more query. Does the SHObjectProperties return the folder name, size,Type,location, and created informations as we see in the property

    What it does is open the Properties window.



  • EisenB

    Just replace the 3rd parameter with:

    System.Reflection.Assembly.GetExecutingAssembly().Location



  • Starfish2000

    I am using windows 2000 professional service pack 4.

    I have one more query. Does the SHObjectProperties return the folder name, size,Type,location, and created informations as we see in the property


  • 2006

    Hi..

    I tried the same code in windows xp machine and it worked properly. Thank you.

    I have a small query., I used the code:

    CallPropDialog ( this.Handle , GetProperties.SHOP_FILEPATH , "c:\\Windows\\notepad.exe",null);

    which got the notepad's property. Is it possible to pass my application's exe, rather than "c:\\windows\\notepad.exe" , so that it opens my application, in which i have some other functionalities added .


  • losdude

    Can you also verify the version numbers of the following libraries:

    • Comctl32.dll
    • Shlwapi.dll

    Both should be higher than version 5 as well if I am not mistaken.



  • kcchesnut

    The shell32.dll version is 5.00.3700.6705. Could you please look into my earlier code.. Is it the proper way to use the SHObjectProperties
  • martin.kolarik

    Can you look at the version number of the shell32.dll file in your %windir%\system32\ folder It should be version 5 at least (Starting with Windows 2000).



  • Unable to find SHObjectProperties