Telling the difference between Apply and OK on a PropertyPage?

O

Oliver Giesen

Hi all!

I have some fairly complex options framework in my addin where options
values can be inherited or overridden at different levels (e.g. user
registry, public folder properties, parent folder properties, etc.)
depending on context and several flags that could be manipulated via
checkboxes on a PropertyPage. As determining the actual option values
that are not overridden (and thus editable) at the current level is
rather costly performance-wise I do not update the values immediately
when the relevant checkboxes get ticked or unticked but only when the
user presses Apply.

Now, my problem is this: I could currently not differentiate whether
the user pressed the OK or Apply button. There's really no need to do
the costly update of the option values when the user presses OK as the
page would close anyway in that case. Thus I would like to be able to
omit that step when the user presses OK instead of Apply.

So far I haven't been able to come up with anything to detect which
method was used to trigger the Apply method.

Any ideas?

Cheers,

Oliver
 
K

Ken Slovak - [MVP - Outlook]

There's no way to tell that from the object model. You'd have to use Win32
API hacks to set up a message hook and trap mouse clicks and see what button
was clicked that way. Not a pretty thing to do.
 
O

Oliver Giesen

Ken said:
There's no way to tell that from the object model. You'd have to use
Win32 API hacks to set up a message hook and trap mouse clicks and
see what button was clicked that way. Not a pretty thing to do.

OK, thanks. I feared it would be so. I'd rather not go down that road
though...

I'll spend the time on trying to tweak the performance of the value
determination then (would have done that anyway but this way there's
all the more reason to do so).

Cheers,

Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top