dialogboxparamdialogboxparam
DialogBoxParam
TheDialogBoxParamfunctioncreatesamodaldialogboxfromadialogboxtemplateresource.Beforedisplayingthedialogbox,thefunctionpassesanapplication-definedvaluetothedialogboxprocedureasthelParamparameteroftheWM_INITDIALOGmessage.Anapplicationcanusethisvaluetoinitializedialogboxcontrols.
INT_PTRDialogBoxParam(
HINSTANCEhInstance,//handletomodule
LPCTSTRlpTemplateName,//dialogboxtemplate
HWNDhWndParent,//handletoownerwindow
DLGPROClpDialogFunc,//dialogboxprocedure
LPARAMdwInitParam//initializationvalue
);
Parameters
hInstance
[in]Handletothemodulewhoseexecutablefilecontainsthedialogboxtemplate.
lpTemplateName
[in]Specifiesthedialogboxtemplate.Thisparameteriseitherthepointertoanull-terminatedcharacterstringthatspecifiesthenameofthedialogboxtemplateoranintegervaluethatspecifiestheresourceidentifierofthedialogboxtemplate.Iftheparameterspecifiesaresourceidentifier,itshigh-orderwordmustbezeroanditslow-orderwordmustcontaintheidentifier.YoucanusetheMAKEINTRESOURCEmacrotocreatethisvalue.
hWndParent
[in]Handletothewindowthatownsthedialogbox.
lpDialogFunc
[in]Pointertothedialogboxprocedure.Formoreinformationaboutthedialogboxprocedure,seeDialogProc.
dwInitParam
[in]SpecifiesthevaluetopasstothedialogboxinthelParamparameteroftheWM_INITDIALOGmessage.
ReturnValues
Ifthefunctionsucceeds,thereturnvalueisthevalueofthenResultparameterspecifiedinthecalltotheEndDialogfunctionusedtoterminatethedialogbox.
IfthefunctionfailsbecausethehWndParentparameterisinvalid,thereturnvalueiszero.ThefunctionreturnszerointhiscaseforcompatibilitywithpreviousversionsofWindows.Ifthefunctionfailsforanyotherreason,thereturnvalueis–1.Togetextendederrorinformation,callGetLastError.
Remarks
TheDialogBoxParamfunctionusestheCreateWindowExfunctiontocreatethedialogbox.DialogBoxParamthensendsaWM_INITDIALOGmessage(andaWM_SETFONTmessageifthetemplatespecifiestheDS_SETFONTorDS_SHELLFONTstyle)tothedialogboxprocedure.Thefunctiondisplaysthedialogbox(regardlessofwhetherthetemplatespecifiestheWS_VISIBLEstyle),disablestheownerwindow,andstartsitsownmessagelooptoretrieveanddispatchmessagesforthedialogbox.
WhenthedialogboxprocedurecallstheEndDialogfunction,DialogBoxParamdestroysthedialogbox,endsthemessageloop,enablestheownerwindow(ifpreviouslyenabled),andreturnsthenResultparameterspecifiedbythedialogboxprocedurewhenitcalledEndDialog.
Windows95/98:Thesystemcansupportamaximumof255controlsperdialogboxtemplate.Toplacemorethan255controlsinadialogbox,createthecontrolsintheWM_INITDIALOGmessagehandlerratherthanplacingtheminthetemplate.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-33495-1.html
总觉得宋茜在里面怪怪的总是不能把宋茜和唱歌联系在一起
早上看到系统有更新提示
选择新的