How do you get a handle on the Notes executable?

Does anyone know how to get a programatic handle on the executeable itself, not a database? My users sometimes click the Close “X” for the Notes executable thinking they are closing a Notes dB, so Notes exits and they lose all data in open documents (they have disabled the user pref. which asks them if they really want to close Notes, and this will remain disabled…). I want to write a custom piece of code that will prompt them on Notes Exit but triggered only if they have an open dB document, in which case it will return them to the workspace where they can manually save.

But I don’t know how to get a handle on Notes itself.

No dB event (eg, Terminate) is triggered by the executable exiting: they are ignored.

Hope someone can help out! Thanks!!

Subject: How do you get a handle on the Notes executable?

You can try using the QueryClose event in the Database Script of the Bookmarks.nsf.

Subject: RE: How do you get a handle on the Notes executable?

I’ll give this a try Stan, thanks.

Subject: How do you get a handle on the Notes executable?

It probably can be done using the API but if they were my users I would tell them to go and do one - politely of course.

If they are playing with their user settings then they obviously consider themselves as power users so can’t complain if they have enabled a setting that means they lose their work if they use it incorrectly.

If I decided to tell windows not to prompt me when I chose to delete a file and to hard delete it instead of sending it to the trash folder I couldn’t moan if I deleted a file in error.

Subject: RE: How do you get a handle on the Notes executable?

Thanks for the input!

Subject: RE: How do you get a handle on the Notes executable?

Good luck, I know what you are dealing with.

I was about to write a win C++ program for them (as Doug mentioned) to watch the notes.exe and check to see if the prorgram is running. As Rich mentioned, you will loose any handles to the uidocs which defeats the purpose.

Subject: RE: How do you get a handle on the Notes executable?

There’s nothing in the Notes API that can do this in a straightforward way. It doesn’t hook UI any events. You might be able to find some database event that the API can hook, and which uniquely occurs during the beginning of the closing sequence of Notes, but then you would have no idea what documents are open in various windows for the same reason: the API didn’t hook the UI events that opened those windows.

Subject: How do you get a handle on the Notes executable?

Have halted the exit on doc QueryClose, but it displays twice (called twice); doesn’t know that Executable called it as still haev no handle there (so still can’t make message as accurate as I’d like); and, again as no handle on the executable, I can only delay the Exit not stop it…

Subject: RE: How do you get a handle on the Notes executable?

This is a bit beyond my level of expertise but since nobody has responded I’m more than happy to guess… :wink:

I think you need to look in one of two places; the Notes C/C++ API or at the OS level. In either case, you’ll need to write some kind of ‘watcher’ program.

Wish I had specific advice but this is stuff I just let the user handle. This is no different from what happens if you ‘x’ out of Excel or so why should Notes be special? Folks will do this a couple of times and then learn how to use the OS…

Good luck.

Doug

Subject: How do you get a handle on the Notes executable?

If a Windows platform only solution is acceptable you need to subclass the main window and eat the WM_SYSCOMMAND SC_CLOSE message.

You can probably do this by writing an extension manager dll that doesn’t register any callbacks but instead sets up the subclassing when it is loaded.

In case you are not familiar with subclassing see About Window Procedures - Win32 apps | Microsoft Learn