Beruflich Dokumente
Kultur Dokumente
Tothanhmenumi:VocasWorkspace>chnResourceView>chn menu resources > nhn nt phi chut v chn Insert > xut hin ca s InsertResourcevchnMenu,saunhnntNew. Thm cc phn t vo thanh Menu: Trong ca s ResourceView > DoubleClickvochsIDcathanhmenu>xuthincasdngthm ccphntvothanhmenu. Vd:Tothanhmenunhhnhsau
HmtrvcontrqunlthanhMenucamtcas.()
CMenu*GetMenu()const
) HmEnables,disablesmtmcchntrnthanhmenu
UINTEnableMenuItem( UINTnIDEnableItem, UINTnEnable
) HmtrvmtcontritngCMenucamtpopupmenu.
CMenu*GetSubMenu( intnPos )const
Hmhinthmtpopupmenutimtvtrxcnh.
BOOLTrackPopupMenu( UINTnFlags, intx, inty, CWnd*pWnd, LPCRECTlpRect=0 )
ContextMenu: Mt Context Menu l mt popup menu c th hin th bt k u trn mnhnh. ToContextMenu: B1:TothanhmenubngMenuResource. B2:ThmthngipWM_CONTEXTMENUvongdng. B3: Trong hm OnContextMenu() dng cc hm LoadMenu(), GetSubMenu(),vTrackPopupMenu()hinthContextMenu.
2) Images,BitmapsvIcons
CchdngImageEditor CchdngPicture Gn kt Picture vi Icon, Bitmap: Chn Picture,nhn nt phi chut > chn Properties > Xut hin ca s Picture Properties > Chn th General,vomcchnTypelachnkiuPicturelIconhayBitmap >VomcchnImagelachnchsIDcaIconhayBitmapto ratrc. CchnpIconvBitmaptrongqutrnhthcthichngtrnh: HmAfxGetApp():Thepointerreturnedbythisfunctioncanbeusedtoaccess applicationinformationsuchasthemainmessagedispatchcodeorthetopmost window.
CWinApp*AFXAPIAfxGetApp()
HmSetIcon()calpCStatic:Associatesanewiconimagewiththestaticcontrol.
HICONSetIcon( HICONhIcon )
HmSetBitmap()calpCStatic:Associatesanewbitmapwiththestaticcontrol.
HBITMAPSetBitmap( HBITMAPhBitmap )
CchdnglpCImageList: Thng c s dng hin th nhng Image trong ListControl v TreeControl. Cch tccImagevomtControl: B1:TomtBitmapchanhiuImage B2:DnghmLoadBitmap()npBitmap B3:DnghmCreate()mtImageList. B4:DnghmAdd()thmBitmapvoImageList. B5:DnghmSetImageList()tImageListvoControl B6:ChnccphntvoControl Nguynmumtshm: HmCreate()calpCImageList:Initializesanimagelistandattachesittoa CImageListobject.
BOOLCreate( UINTnBitmapID, intcx, intnGrow, COLORREFcrMask
HmAdd()calpCImageList:Callthisfunctiontoaddoneormoreimagesoran icontoanimagelist.
intAdd( CBitmap*pbmImage, COLORREFcrMask ) intAdd( HICONhIcon
) HmSetImageList():Assignsanimagelisttoalistviewcontrolandatreeview control.
CImageList*SetImageList( CImageList*pImageList, intnImageListType )
Vd:
3) DialogBoxes
ToDialog ModalDialogBoxes CchmthngdngthuclpCDialog. HmDoModal():Callthismemberfunctiontoinvokethemodal dialogboxandreturnthedialogboxresultwhendone.
virtualINT_PTRDoModal()
HmShowWindow():Setsthevisibilitystateofthewindow.
BOOLShowWindow( intnCmdShow )
Vid:
HmGetFileName():Callthisfunctiontoretrievethenameofthefilename enteredinthedialogbox.
CStringGetFileName()const
HmGetPathName():Callthisfunctiontoretrievethefullpathofthefile enteredinthedialogbox.
CStringGetPathName()const
HmOpen():OpenisdesignedforusewiththedefaultCFileconstructor.
virtualBOOLOpen( LPCTSTRlpszFileName, UINTnOpenFlags, CFileException*pError=NULL )
HmClose():Closesthefileassociatedwiththisobjectandmakesthefile unavailableforreadingorwriting.
virtualvoidClose()
HmWrite():WritesdatafromabuffertothefileassociatedwiththeCFile object.
virtualvoidWrite( constvoid*lpBuf, UINTnCount )
HmRead():ReadsdataintoabufferfromthefileassociatedwiththeCFile object.
Vd:Tongdngsau: