Their is a way to do this but it requires the use of C and the WIN32 API, basically you use a combination of the following API calls:
_beginthreadex()
EnumThreadWindows()
SetWindowLong()
I use this in a lot of my C/C++ code to do exactly what your talking about including doing things like messagebox timeouts etc. Basically the way it works is we rely on the fact that messagebox's are dialogs with a windows class of #32770 (not to be confused with an OOP class):
1. Create a new thread.
2. Call the MessageBox() API function.
3. Enumerate all windows in the current thread with EnumThreadWindows().
4. Stash away the HWND (Now you can do all kinds of things).
5. Subclass the messagebox callback procedure.
6. Use EndDialog() to kill the messagebox.
Obviously their are a lot of other details to take care of and (this only illustrates that this can be done :-)) if I get time this week I will turn all the messagebox() stuff into a DLL and submit it to the files section.
Hope this helps.
Neil
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement