資源描述:
《whcbt回調(diào)函數(shù)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、CBTProcCallbackFunctionAnapplication-definedorlibrary-definedcallbackfunctionusedwiththeSetWindowsHookExfunction.Thesystemcallsthisfunctionbeforeactivating,creating,destroying,minimizing,maximizing,moving,orsizingawindow;beforecompletingasystemcommand;beforeremov
2、ingamouseorkeyboardeventfromthesystemmessagequeue;beforesettingthekeyboardfocus;orbeforesynchronizingwiththesystemmessagequeue.Acomputer-basedtraining(CBT)applicationusesthishookproceduretoreceiveusefulnotificationsfromthesystem.TheHOOKPROCtypedefinesapointertoth
3、iscallbackfunction.CBTProcisaplaceholderfortheapplication-definedorlibrary-definedfunctionname.Syntax復(fù)制LRESULTCALLBACKCBTProc(__in??intnCode,__in??WPARAMwParam,__in??LPARAMlParam);ParametersnCode[in]Type:intThecodethatthehookprocedureusestodeterminehowtoprocessth
4、emessage.IfnCodeislessthanzero,thehookproceduremustpassthemessagetotheCallNextHookExfunctionwithoutfurtherprocessingandshouldreturnthevaluereturnedbyCallNextHookEx.Thisparametercanbeoneofthefollowingvalues.ValueMeaningHCBT_ACTIVATE5Thesystemisabouttoactivateawind
5、ow.HCBT_CLICKSKIPPED6Thesystemhasremovedamousemessagefromthesystemmessagequeue.Uponreceivingthishookcode,aCBTapplicationmustinstallaWH_JOURNALPLAYBACKhookprocedureinresponsetothemousemessage.HCBT_CREATEWNDAwindowisabouttobecreated.Thesystemcallsthehookprocedure3b
6、eforesendingtheWM_CREATEorWM_NCCREATEmessagetothewindow.Ifthehookprocedurereturnsanonzerovalue,thesystemdestroysthewindow;theCreateWindowfunctionreturnsNULL,buttheWM_DESTROYmessageisnotsenttothewindow.Ifthehookprocedurereturnszero,thewindowiscreatednormally.Atthe
7、timeoftheHCBT_CREATEWNDnotification,thewindowhasbeencreated,butitsfinalsizeandpositionmaynothavebeendeterminedanditsparentwindowmaynothavebeenestablished.Itispossibletosendmessagestothenewlycreatedwindow,althoughithasnotyetreceivedWM_NCCREATEorWM_CREATEmessages.I
8、tisalsopossibletochangethepositioninthez-orderofthenewlycreatedwindowbymodifyingthehwndInsertAftermemberoftheCBT_CREATEWNDstructure.HCBT_DESTROYWND4Awindowisab