SAFELY removing desktop icons in VBA???
Posted on 2000-05-03
Sorry about the length of the question.
I have a program that interrogates the desktop.dsk file for references to hierarchical servers (should be flat in our organisation).
Once found, the path and server names are extracted and a list made.
I then open Notes, use the AddDatabase method to add each database to the workspace, and then simulate a FileDatabaseRemove to remove it from the workspace using the keybd_event API call (e.g. Alt key down, Alt key up, E key pressed, E key released, L key down, L key up, Enter key down, Enter key up - this removes a database icon using Enter to answer Yes to prompt).
Notes is then closed and restarted.
Once restarted, the deleted icons are added back onto the workspace without the hierarchical references to the servernames.
It is a somewhat dangerous practice to be using the keybd_event API call since if a database cannot be removed and one is not selected then the workspace page would be removed instead.
I need to find a SAFE way to either catch the prompts that Notes supplies to users (e.g. Are you sure you wish to remove this database icon?, identify the message prompt and perform an action accordingly.
Can anyone help?
Thanks in advance,