Salat Posted March 16, 2003 Posted March 16, 2003 Is it possible to show system's "file property page", I saw something like this in other applications. I was wondering If i can use it too in my programs. thank You for help... Quote profesjonalne programowanie na zlecenie :)
*Gurus* divil Posted March 16, 2003 *Gurus* Posted March 16, 2003 As far as I know there isn't a .NET way to do this. I've done it in vb6 before using ShellExecuteEx, you will probably be able to find an example online but you'll have to port it to .NET. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Salat Posted March 16, 2003 Author Posted March 16, 2003 I found one, but in Delphi, and I don't get it :( http://members.tripod.com/~delphipower/showpropertypage.htm Quote profesjonalne programowanie na zlecenie :)
*Gurus* divil Posted March 16, 2003 *Gurus* Posted March 16, 2003 Here it is in VB6, perhaps it'll get you started. Public Type SHELLEXECUTEINFO cbSize As Long fMask As Long hWnd As Long lpVerb As String lpFile As String lpParameters As String lpDirectory As String nShow As Long hInstApp As Long lpIDList As Long 'Optional parameter lpClass As String 'Optional parameter hkeyClass As Long 'Optional parameter dwHotKey As Long 'Optional parameter hIcon As Long 'Optional parameter hProcess As Long 'Optional parameter End Type Public Const SEE_MASK_INVOKEIDLIST = &HC Public Const SEE_MASK_NOCLOSEPROCESS = &H40 Public Const SEE_MASK_FLAG_NO_UI = &H400 Public Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long Public Sub ShowFileProperties(strFilename As String) 'open a file properties property page for 'specified file if return value Dim SEI As SHELLEXECUTEINFO 'Fill in the SHELLEXECUTEINFO structure With SEI .cbSize = Len(SEI) .fMask = SEE_MASK_NOCLOSEPROCESS Or _ SEE_MASK_INVOKEIDLIST Or _ SEE_MASK_FLAG_NO_UI .hWnd = 0 .lpVerb = "properties" .lpFile = strFilename .lpParameters = vbNullChar .lpDirectory = vbNullChar .nShow = 0 .hInstApp = 0 .lpIDList = 0 End With 'call the API to display the property sheet Call ShellExecuteEx(SEI) End Sub Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Salat Posted March 17, 2003 Author Posted March 17, 2003 I'm new to VB.NET, sometimes it's realy hard for me to handle this exception. An unhandled exception of type 'System.NullReferenceException' occurred in multiKlient FTP.exe Additional information: Object reference not set to an instance of an object. at line: Call ShellExecuteEx(SEI) I wrote Dim SEI As SHELLEXECUTEINFO = New SHELLEXECUTEINFO but it's still nothing, the 'System.NullReferenceException' occurs Thanks for help anyway, You are doing a great job... Quote profesjonalne programowanie na zlecenie :)
*Gurus* divil Posted March 17, 2003 *Gurus* Posted March 17, 2003 Here's a C# sample that does it (right near the bottom of the page): http://www20.tok2.com/home/tomoaki/CSSAMPLE/CSSAMPLE01.html Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.