Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing Pad/Bar Prompt at run-time
Message
De
31/07/2004 10:57:21
 
 
À
31/07/2004 06:37:18
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00928219
Message ID:
00929873
Vues:
18
Emanuele,

>Can you explain me in poor word what is the difference from hooking a thread (MSGFILTER, SYSMSGFILTER or WNDPROC)and changing the offset of the dispathcer function ?? Why i can't trap soime messages with hooking ?
>
>Sorry for my curiosity.

Curiousity is good, really!! Although sometimes it is killing yourself :-)

I'm not an expert of internal OS programming myself. Well, still a long way to reach there <*vbg*>. So for a real technical and accurate answer please look at MSDN site about SetWindowsHookEx & SetWindowLong. Also search by keyword "Subclass" or "Hook" for related documentation and grab yourself a few books of Windows Programming.

I can only explain in general and also this is based on my own experience. So I apologies in advance if there is a mistake :)

1) "Hooking" means you are creating your own subroutine to "monitor the system traffic messages". The system will "notify" your subroutine about any messages (depends on the hook type) that will be send to the particular window. So since hook only receive a "notification" there will be some messages that you can not trap here. You can only trap that kind of messages with "Subclass". But there are also a certain messages that is better to trap by hooking (i.e.: monitoring windows creation)

Subclass is replacing the original window procedure messages so your subroutine becomes the default procedure messages for that particular window/class. Since this technique replaced the original window procedure you must pass in the messages that you will not process by calling the original procedure ( CallWindowProc() ).


2) Hook can monitor for a particular windows/threads only or any windows (system-wide / global), while subclass only works for the window you are replacing.


To replace the default messages for a particular window and it's child window (or the new window created in the same process), there is another technique called Superclass. Look at WNDCLASS/WNDCLASSEX structure.

BTW, this thread is beginning to off VFP topic. So if you want to continue the discusion I think it is better if you mail me in private

Again, I'm sorry if there is a mistake
Regards
Herman
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform