|
-
Jun 3rd, 2005, 07:17 AM
#1
Thread Starter
Addicted Member
Get Summary information [still needing help]
I'm wanting to get the file summary from a selected file and put it into seperate strings, title and so on.
Cheers..
Last edited by Chrispybee; Jun 14th, 2005 at 11:06 AM.
-
Jun 3rd, 2005, 07:20 AM
#2
Re: Get file summary and put it into strings
What kind of file and what do you mean by "file summary"?
-
Jun 3rd, 2005, 10:10 AM
#3
Thread Starter
Addicted Member
Re: Get file summary and put it into strings
A file that you have saved on your hard drive. Like, "C:\test.txt". If you right click this file and select Summary (win 2k >) then you have the title, version etc..
This is the data that I'm wanting to get from files.
-
Jun 3rd, 2005, 10:22 AM
#4
Re: Get file summary and put it into strings
 Originally Posted by Chrispybee
A file that you have saved on your hard drive. Like, "C:\test.txt". If you right click this file and select Summary (win 2k >) then you have the title, version etc..
This is the data that I'm wanting to get from files.
Oh...you want the property page. Try something like this
VB Code:
Option Explicit
Private 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
Private Const SEE_MASK_INVOKEIDLIST = &HC
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
Private Const SEE_MASK_FLAG_NO_UI = &H400
Private Declare Function ShellExecuteEx Lib "shell32.dll" _
(SEI As SHELLEXECUTEINFO) As Long
Private Sub ShowProperties(filename As String, OwnerhWnd As Long)
'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 = OwnerhWnd
.lpVerb = "properties"
.lpFile = filename
.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
'Usage: Place the full path and file name in the text box
Private Sub Command1_Click()
Call ShowProperties((Text1.Text), Me.hwnd)
End Sub
-
Jun 3rd, 2005, 05:53 PM
#5
Thread Starter
Addicted Member
Re: Get file summary and put it into strings
Sorry, maybe I didn't make myself clear. I've done this but it's not what I want. This will open the property page where all I want to do, is to say. I want the Title (from the summary page) from C:\test.txt in strTitleSummary.
I hope that this makes sense. I've tried using FSO and file1 but no joy. I do fell that this is an API call I may have to make but I dont know what it would be??
Please help..
-
Jun 3rd, 2005, 06:04 PM
#6
-
Jun 11th, 2005, 03:32 PM
#7
Thread Starter
Addicted Member
Re: Get file summary and put it into strings
Thanks manavo11 for the reply. I cannot make head nor tail of this post. It looks like this is for vb.net and I've not had any experience with vb.net or c++
Please could explain how this could be used in Visual Basic 6?
-
Jun 11th, 2005, 06:06 PM
#8
-
Jun 12th, 2005, 10:34 AM
#9
Thread Starter
Addicted Member
Re: Get file summary and put it into strings
I need to use the function stgOpenStorageEX that I've found on MSDN. How would I format the below into VB format?
HRESULT StgOpenStorageEx(
const WCHAR* pwcsName,
DWORD grfMode,
STGFMT stgfmt,
DWORD grfAttrs,
STGOPTIONS* pStgOptions,
void* reserved2,
REFIID riid,
void** ppObjectOpen
);
-
Jun 12th, 2005, 01:22 PM
#10
Thread Starter
Addicted Member
Re: Get file summary and put it into strings
I've found the source code I need to perform the required task, the only problem is that it's in Delphi!! Cannot find any VB6 source code at all!!
Here is the link http://www.delphi-central.com/tutori...mary_Info.aspx
Please can someone help me rewrite this to VB??
Thanks
-
Jun 12th, 2005, 03:42 PM
#11
Thread Starter
Addicted Member
Re: convert Deplhi source code to VB6 - Get Summary information
I'm trying to rewrite the Delphi code from the above website but having difficulties..
I'm trying to put this
VB Code:
Public Declare Sub FmtIdToPropStgName Lib "iprop.dll" (ByRef pfmtid As FMTID, ByVal oszName As String)
but getting "User -Defined Type Not Defined"
I dont know where to get the FMTID from?
Any Ideas?? I think that I'm putting the correct API calls into my code but no joy!
-
Jun 12th, 2005, 04:42 PM
#12
Re: convert Delphi source code to VB6 - Get Summary information
Delphi has built in support for the Windows API, but in VB 6 you need to declare all the functions and UDT's your self. A user defined type is the equivalent of a record in Delphi.
The best I could find on FMTID is this:
http://msdn.microsoft.com/library/de...n_istorage.asp
I don't rewally understnad it though, so hopefully someone else will be able to help you convert it to something you can use in VB.
-
Jun 12th, 2005, 04:58 PM
#13
Thread Starter
Addicted Member
Re: convert Delphi source code to VB6 - Get Summary information
Thanks Visual App!! I've been trying to understand how I can declare the FMTID.
If anyone else can help me, that would be great!! I'm struggling here a bit and new to writing API stuff!!
-
Jun 13th, 2005, 02:40 PM
#14
Thread Starter
Addicted Member
Re: convert Delphi source code to VB6 - Get Summary information
If you have a look at the Delphi code, it has a few functions that I cannot find by either Internet Search or Using API Viewer.
Code:
IPropertySetStorage
This is the delphi code that i've found
Code:
function StgOpenStorageEx (
const pwcsName : POleStr; //Pointer to the path of the
//file containing storage object
grfMode : LongInt; //Specifies the access mode for the object
stgfmt : DWORD; //Specifies the storage file format
grfAttrs : DWORD; //Reserved; must be zero
pStgOptions : Pointer; //Address of STGOPTIONS pointer
reserved2 : Pointer; //Reserved; must be zero
riid : PGUID; //Specifies the GUID of the interface pointer
out stgOpen : //Address of an interface pointer
IStorage ) : HResult; stdcall; external 'ole32.dll';
I have been able to find this fine and put it into my Module. The issue that I'm having is finding the IPropertySetStorage, IPropertyStorage, TPropVariant, TPropSpec & IStorage.
Please help as I cannot find a VB example on how to do this and would be great to be able to get this information.
Many thanks for all your help!
-
Jun 14th, 2005, 11:09 AM
#15
Thread Starter
Addicted Member
Re: Get Summary information [still needing help]
I am starting to cry!! Please could someone help me. I may be going around this the wrong way. :@(
-
Sep 26th, 2007, 11:45 AM
#16
Re: Get Summary information [still needing help]
OK 2 yrs later, any know how to access the StgOpenStorageEx from OLE32.dll using VB6? I can't find any good wrappers.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|