Windows program design review, garbage article do not look [original]

xiaoxiao2021-03-06  41

Windows programming review

"WINDOW Program Design" book review:

__stdcall __cdecl widechartomultibyte multibytetowideChar

Multi-byte character set and Unicode: IstextUnicode

TCHAR.H_TCSLEN (WCSLEN and STRLEN)

Tchar (wchar_t and char) _t, _text, l

Unicode / ANSI: LSTRLEN LSTRCPY LSTRCPYN LSTRCAT LSTRCMP LSTRCMPI

vSprintf WSPrintf wvsprintf _vsntprintf

VA_LIST, VA_START, VA_ARG, VA_END

Plays ScrollWindow ScrollDC

InvalidateERECT Invalidatergb

GetTextMetrics (Get Text Metrics from DC) GetTextFace (Set ...)

GetClientDC getWindowdc

SetscrollRange setscrollpos setscrollsizes setScrollInfo

WM_Paint: BeginPaint function call makes the DC area become effective

CreateCompatibleDC getDeviceCaps setTextAlign

Graphics drawing function: setpixel (getpixel)

TEXTOUT

LINTO POLYLINE (NO FILL) / POLYGON (FILL) POLYLINETO POLYPOLYLINE ARC

Polybezier polybezierto

Arcto Anglearc PolyDraw

Ellipse Rectangle RoundRect Chord Pie

Createpen CreatepenIndirect GetObject SelectObject DeleteObject (HPEN)

SetBkcolor SetTextColor SetBkmode Setrop2 (Getrop2) SetPolyfillmode

Createbrushindirect Createsolidbrush Createhatchbrush

CreatePatternbrush CreateDibPatternbrushpt (Create Brush Base On Bitmap)

SetMapMode (getmapmode) setWindowExTex DPTOLP LPTODP

GetClientRect

SetViewportorgex setWindoWorgex

Regional and tailoring:

FillRect Framerect InvertRect (Rectangular All Pixel Colors Flip)

SetRect OffsetRect InflateRect SetrECTempty CopyRect

INTERSECTRECT UNIONRECT ISRECTEMPTY PTINRECT

CreateRectrgn (Create an area, get the handle of this area) CreateRectrGnIndirect

CreatellipticRGN CreateellipticRgn Indirect

CreatePolygonRGN Combinergn

Region handle can be used for the lower 4 drawing functions: FillRgn Framergn InvertRgn PainTrgn

(You Must Use deleteObject (hrgn) to delete after not use the region: getKeyState getasynckeyState getKeyNameText

ScreenToClient Clienttoscreen CreateCaret setcaretpos showcaret

WINDOWCLASS CS | = CS_DBLCLKS;

Mouse: wm_nchittest showcursor getCursorpos (SetCursorpos)

SetCapture ReleaseCapture

SetWindowlong (getWindowl) setClasslong (getClasslong)

SetFocus (getfocus) getdlgitem WM_SETFOCUS WM_KILLFOCUS

SystemParametersInfo Drawboxoutline

Timer: SetTimer KillTimer WM_TIMECHANGE

GetLocalTime (setlocaltime) getSystemTime (SetsystemTime)

GetDateFormat getLocaleInfo

GetParent Getdlgctrlid IswindowVisible

Button: BS_OWNERDRAW

Notice: BN_SETFOCUS Send Message: BM_SETCHECK BM_SETIMAGE

Getsyscolors (Setsyscolors) ScrollWindow

Button Draw: WM_CTLCOLORBTN Cabbage Style: BS_OWNERDRAW WM_DRAWITEM Message

WM_CTLCOLORBTN: Little use

WM_ERASEBKGND: RETURN TRUE;

WM_PAINT: Window does not respond

WM_DRAWITEM: self-drawn

SetClasslong (hwnd, gcl_hbrbackground, (long) CreateSolidbrush (...))

WM_CTLCOLORSCROLLBAR (Back to Background Colors)

WM_CTLCOLORSTATIC (set the foreground and background color with settextcolor and setbkcolor)

WM_SYSCOLORCHANGE

Text Editor: Notice: En_setfocus En_killFocus En_Change En_Update

Message: EM_GETSEL EM_SETSEL EM_GETLINECount EM_LINEIndex

EM_LINELENGTH EM_GETLINE

Heavy painting mark: wm_setredraw (true / false)

List box: lb_resetcontent lb_deleteString lb_addstring lb_insertstring ETC

Powerful news: lb_dir

Notice: LBN_SELCHANGE LBN_KILLFOCUS ETC GetENVIRONMENTSTRINGS

GetCurrentDirectory

Menu and Resources: Drawicon Ansinext LockResource (LoadResource (FindResource))

CreateMenu Appendmenu DeleteMenu InsertMenu ModifyMenu RemoveMenu

EnableMenuItem IsclipboardFormatavaliabledrawmenuBar GetSubmenu GetMenuItemcount GetMenuItemid CheckMenuItem

Getmenustring GetmenusTate DestroyMenu TRACKPOPUPMENU LOADMENU SEMENU

Accelerator: loadAccelerators RegisterhotKey TranslateAccelerator

Modal dialog: Dialogbox DialogboxIndirect DialogBoxParam

Processing WM_INITDIALOG messages, exiting enddialog

Senddlgitemmessage Checkradiobutton CheckdlgButton IsdlgButtonChecked

Non-modular dialog: CreateDialog CreateDialogindirect ShowWindow SetdlgiteMtext

Message processing, join in the main window message loop: IsdialogMessage

General dialog: GetopenFileName GetsaveFileName Choosecolor

FindText ReplaceText

MSDN Examples: Using Common Dialog Boxes

RegisterWindowMessage

Memory Allocation: GlobalAlloc GlobalRealloc GlobalSize GlobalFree (GlobalHandle (P));

GlobalLock Globalunlock CopyMemory

Clipboard: OpenClipboard EmptyClipboard SetClipboardData CloseClipboard

GetClipboardData IsclipboardFormatavailable EnumclipboardFormats

CountClipboardFormats RegisterClipboardFormat getClipboardFormatName

Clipboard Hook: SetClipboardViewer (HWND) -> WM_DRAWCLIPBOARD)

UnHook: Changeclipboardchain

GetClipboardViewer WM_Changecbchain WM_DrawClipboard

"WINDOW program design" review review:

Printer: createdc printdlg StartDoc StartPage Endpage Enddoc

Enumprinters getversion (ex) WM_SETTINGCHANGE WM_INITMENUPOPUP

Openprinter PrinterProperties Createic getprinterdc

SetabortProc (Use callback to abort task) WM_SETTINGCHANGE

Device related bitmap:

CreateBitmap CreateBitMapIndirect

Bitblt Stretchblt setstretchbltmode Patblt

Setbitmapbits getBitmapbits

CreatePatternbrush Createbrush Createbrushindirectirectirect

WM_DISPLAYCHANGE CREATECOMPATIBLEDC (Memory DC Multiple)

GetSystemBMenu Appendmenu: Insert bitmap menu GettextExtentPoint32LockWindowUpdata (getDesktopwindow or other or null) getDCEX

Device is unlocked:

BitmapfileHeader Bitmapcoreheader setFilePointer setEndoffile

CreateFile GetFileSize CloseHandle SetCursor showcursor

SetDibitStodevice StretchDibits Master DIB Format and Display Method

CreateDibitMap (create) setDibits (init pixels) These two functions from DIB to DDB

GetDibits from DDB to DIB

DIB: file or memory block

DDB: GDI bitmap object, and is represented by bitmap

CreateDibsection: Create A Dib, Reture A Handle of Dib Data Section, Not GDI

(Windows Important: Point to the device's unacceptable bitmap, but the returned handle can be used to operate the function)

Three ways to display DIB

1 Use setDibitStodevice or StretchDibits to display DIB directly on the screen, slow speed

2 Convert DIB to DDB with createDibitmap and setDibits, then display with Bitblt or StretchBLT

3 Create a DIB section with createDibsection, then use Bitblt or StretchBLT display

GDIFLUSH

Palette: CreatePalette SelectPalette RealizePalette UpdateColors

This chapter is not interested in learning, after seeing related articles on the Internet, then go to learn, :)

Text and font:

TrueType: Contour Font Technology

TextOut TabbedTextOut ExtTextOut DrawText DrawTextex

SetTextColor SetBkmode SetBkcolor SetTextCharacterextra

GDI font: dot matrix, stroke, TrueType

Equipment font: Hardware built-in device font (printer)

CreateFont CreateFontIndirect (Rotating Font)

SetgraphicsMode SetMapperflags ModifyWorldTransform

ENUMFONTFAMILIES setTextJustification

GetDialogbaseUnits GetTextExtentPoint32 (Get Text Width and Height)

Program needs to be carefully debugged, especially the programs that come out

ExtCreatepen (Use logical brush) Beginpath (in the middle of these functions) endpath

Strokepath strokeAndfillPath

Yuan Document: CreateMetafile Closemetafile deletemetafile / deletefile

PlaymetAfile setmetafilebitsex

This chapter is not interested in learning, after seeing related articles on the Internet, then go to learn, :)

Multi-document interface:

The program needs to be carefully debugged, the important 咚咚

HClient = getWindow (HFrame, GW_CHILD) A window class: Mdinticlient

Five functions: DefframeProc DefmdichildProc

TranslateMdisysaccel

Two structures: ClientCreatestruct (this customer window covers the display area of ​​the frame window)

MdicreateStruct (with a metrics pointing to this structure to send the message WM_mdicreate to the customer window, used to create a sub-window)

Twelve news:

WM_mdicreate creates a message of sub-window, returns this sub-window handle

WM_MDiGetActive gets the sub-window handle of the event

WM_MDIDESTROY destroys MDI sub-windows (handle can be obtained by message)

WM_MDITILE

WM_MDICASCADE

WM_MDIICONARRANGE

WM_MDIRESTORE recovery sub-window status

WM_MDisetMenu Settings Frame Menu

Thread: CreateThread _BeginthRead

Critical_section EntercriticalSection LeaveCritics

DeleteCriticalSection CreateEvent Resetion WaitforsingleObject

Each thread has its own stack TLSalloc TLSSetValue () TLSGetValue Tlsfree

__Declspec (thread) Extern "C" "Capital"!)

DLL:

DLL into / export points: DLL_PROCESS_ATTACH, ETC

DLL Shared Memory: Create a shared section for DLL. #pragma data_seg ("Shared")

/ Section: Shared, RWS

Loadlibrary FreeElibrary GetProcaddress

Sound and music: McISendstring Waveout ...

Appreciate Internet: ...

2005.2.28 Shenzhen Nanshan Science and Technology Park

转载请注明原文地址:https://www.9cbs.com/read-52529.html

New Post(0)