Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tracking File Saving using 'Save As' menu options...

5 views
Skip to first unread message

dinu

unread,
Dec 28, 2009, 9:24:13 AM12/28/09
to
I need your help in cracking a problem i am facing.......

I want to track the saving of a file using 'Save As' menu option of
different applications(like notepad, word, excel , acrobat) etc. I
guess it requires system wide hooking of some APIis like
getsavefilename etc. But then what i found is MS OFFICE utilities
(like word, excel, powerpoint etc ) use some other APIs which i am not
able to figure out, I am really struck here... I appreciate any help
in this direction


I am using VC++ on windows XP

Thanks in advance
Dinakara K

Christian ASTOR

unread,
Dec 28, 2009, 5:00:04 PM12/28/09
to
On 28 déc, 15:24, dinu <dinu...@gmail.com> wrote:
> I need your help in cracking a problem i am facing.......
>
> I want to track the saving of a file using 'Save As' menu option of
> different applications(like notepad, word, excel , acrobat) etc. I
> guess it requires system wide hooking of some APIis like
> getsavefilename etc. But then what i found is MS OFFICE utilities
> (like word, excel, powerpoint etc ) use some other APIs which i am not
> able to figure out, I am really struck here... I appreciate any help
> in this direction

But when you click on "Save", Word calls standard apis to write the
file (CreateFileW(), WriteFile(), ..)

dinu

unread,
Dec 29, 2009, 1:02:51 AM12/29/09
to

Dear Christian ASTOR

Thanks for the reply.
see some of the applications like Acrobat, notepad, wordpad, IE calls
getsavefilename API when 'Save As' dialog is called. But as far as MS
OFFICE suite is concerned it won't use MFC common dialog controls, i
was just wondering if there any such apis like getsavefilename which
can be hooked in case of MS office applications. You rightly pointed
out applications may inturn call CreateFile()/WriteFIle() api .
Tracking these APIs would not fit into my requirement because i will
get too many such calls. Moreover i will not get the information that
whether these calls are being made to create a new file or to 'save' a
file or to 'save as' a file........

Do you have any suggestions in this regard..

Christian ASTOR

unread,
Dec 29, 2009, 6:30:53 AM12/29/09
to
On 29 déc, 07:02, dinu <dinu...@gmail.com> wrote:

> Tracking these APIs would not fit into my requirement because i will
> get too many such calls. Moreover i will not get the information that
> whether these calls are being made to create a new file or to 'save' a
> file or to 'save as' a file........
> Do you have any suggestions in this regard..

For Office, a way is to use a WH_CBT hook, subclass the "Save As"
dialog box and handle the WM_OBJECTSEL message (lParam = 0x25 for
"Save")
I tested on XP SP2 + Word 2003

dinu

unread,
Dec 30, 2009, 5:54:29 AM12/30/09
to

Dear Christian ASTOR,

Thank you for the answer...
I will test it and get back to you....
By the way, i would also have to test on word 2007

0 new messages