Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Repositioning messageboxes
Message
De
05/01/2000 05:09:24
 
 
À
04/01/2000 15:24:12
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00312704
Message ID:
00313090
Vues:
45
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
Fil
Voir

Click here to load this message in the networking platform