relive Lu Xin MFC instructional Video (i)
1. Use of the picture control to display icon and bitmap
2. Creation of the Wm_create window
3. Creation of destruction messages and differences wm_syscommand wm_close wm_cancel Wm_destroywindow
4. Familiar with Window general style Ws_popup ws_child ws_minimize ws_visible ws_disabled ws_caption
Ws_tabtop ws_clipsibings
5. Familiar with the window general extension style
6. Operator HWND (); automatic type conversion, converting an object to a handle
7. Pwnd->m_hwnd and Getsafehandle () differences
8. List Private Style Lvs_
9. FromHandle returns a temporary object that is limited to the member variable
10.GetDlgItem returned is also a temporary object, can be cwnd* by the following methods M_pwnd = Attach (HWND hwnd); M_pwnd.detach ();
11.SubClassWindow and UnsubclassWindow Sub-and non-subclasses, receive window messages by sub-class
12.IsIconic GetStyle () &ws_minimize judgment window minimized
13.IsZoomed Judging window maximization
14.IsWindowEnable iswindowvisble
15.SetActiveWindow and GetActiveWindow windows in the active state
16 Window Relationship: GetDlgItem getdlgitemtext setdlgitemtext getdlgitemint setdlgitemint getdlgctrlid
Setdlgctrlid GetParent ischild Getwinddow Getnextwindow
17 Refresh function Invalidate InvalidateRect UpdateWindow RedrawWindow screentocilent clienttoscreen
EndDialog () has not used this function before, habitual use of delete This;destroywindow ();
STRLWR (char *) CString str;str. Makelower (); Convert a string to lowercase
CListCtrl function Insertcolumn/insertitem/getitemcount/getitemtext/setitemtext/deleteallitem/deleteitem
MFC file read-write CFile File;file.open (char*,cfile::modecreate| cfile::modewrite| Moderead); File.write (char*,size); File.close ();
CFileDialog ccolordialog cfontdialog cprintdialog cpagesetupdialog CFindReplaceDialog
SetDialogBkColor (COLORREF)
Use of the SetImageList
1) Use the image list class to set the list control item icon step
A) cimagelist::create Create image list
b) cimagelist::add add multiple icons to the image list and setimagelist to specific controls
D) clistctrl::setimagelist
C) when the Clistctrl::insertitem function inserts a new list item in a list control, the third parameter specifies the icon index
CImageList ImageList;
Imagelist.create (16,16,ilc_color32| Ilc_mask, 6,6); Note the role of Ilc_mask, set the background transparent, otherwise the icon will have black black edge
The next two digits can be added at will, not enough to allocate the system again
Imagelist.add (CBitmap * or ciccon*); parameter is LoadIcon or LoadBitmap return value
CListCtrl Listctrl;
Listctrl.setimagelist (cimagelist*, int nimagelist); Parameter two is of type of image list
Lvsil_normal Lvsil_small Lvsil_state
Listctrl. Setitemtext (I,,str,nimageindex);
Use of SetItem
Relive Lu Xin MFC instructional Video (i)