From: dinu on
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
From: Christian ASTOR on
On 28 déc, 15:24, dinu <dinu...(a)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(), ..)
From: dinu on
On Dec 29, 3:00 am, Christian ASTOR <casto...(a)club-internet.fr> wrote:
> On 28 déc, 15:24, dinu <dinu...(a)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(), ..)

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..



From: Christian ASTOR on
On 29 déc, 07:02, dinu <dinu...(a)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

From: dinu on
On Dec 29, 4:30 pm, Christian ASTOR <casto...(a)club-internet.fr> wrote:
> On 29 déc, 07:02, dinu <dinu...(a)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

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