资源描述:
《Windows Handle.ppt》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、HANDLEHANDLEDefinitionDefinitioninVC++#ifdefSTRICTtypedefvoid*HANDLE;#defineDECLARE_HANDLE(name)structname##__{intunused;};typedefstructname##__*name#elsetypedefPVOIDHANDLE;#defineDECLARE_HANDLE(name)typedefHANDLEname#endiftypedefHANDLE*PHANDLE;DECLARE_HANDLE(HINSTANCE);DEC
2、LARE_HANDLE(HDC);DECLARE_HANDLE(HWND);HANDLEDefinition句柄代表一种系统资源内核对象GDI对象User对象GDI对象GDI对象创建方法销毁方法位图(HBITMAP)CreateBitmap,CreateBitmapIndirect,CreateCompatibleBitmap,CreateDIBitmap,CreateDIBSection,CreateDiscardableBitmapDeleteObject画刷(HBRUSH)CreateBrushIndirect,CreateDIBPatt
3、ernBrush,CreateDIBPatternBrushPt,CreateHatchBrush,CreatePatternBrush,CreateSolidBrushDeleteObject设备上下文(HDC)CreateDCDeleteDC,ReleaseDC内存DC(HDC)CreateCompatibleDCDeleteDC字体(HFONT)CreateFont,CreateFontIndirectDeleteObject调色板(HPALETTE)CreatePaletteDeleteObject画笔(HPEN)CreatePen,C
4、reatePenIndirectDeleteObject区域(HRGN)CombineRgn,CreateEllipticRgn,CreateEllipticRgnIndirect,CreatePolygonRgn,CreatePolyPolygonRgn,CreateRectRgn,CreateRectRgnIndirect,CreateRoundRectRgn,DeleteObjectGDI对象与绘图相关,用户创建的对象,用户具有管理权限User对象User对象创建方法销毁方法快捷键(HACCEL)CreateAcceleratorTabl
5、eDestroyAcceleratorTable光标(Caret)CreateCaretDestoryCaret焦点(HCURSOR)CreateCursor,LoadCursor,LoadImageDestoryCursor钩子(HHOOK)SetWindowsHookExUnhookWindowsHookEx图标(HICON)CreateIconIndirect,LoadIcon,LoadImageDestroyIcon菜单(HMENU)CreateMenu,CreatePopupMenuLoadMenu,LoadMenuIndirectD
6、eleteMenu窗体(HWND)CreateWindow,CreateWindowEx,CreateDialogParam,CreateMDIWindowDestroyWindowHDWPBeginDeferWindowPosEndDeferWindowPosUser对象与交互相关,用户创建的对象,用户具有管理权限内核对象内核对象创建方法销毁方法事件对象HANDLECreateEvent();CloseHandle文件对象HANDLECreateFile();CloseHandle文件映射对象HANDLECreateFileMapping()
7、;CloseHandleI/O完成对象HANDLECreateIoCompletionPort();CloseHandle作业对象HANDLECreateJobObject();CloseHandle邮槽对象HANDLECreateMailslot();CloseHandle互斥对象HANDLECreateMutex();CloseHandle管道对象BOOLCreatePipe();CloseHandle进程对象BOOLCreateProcess();CloseHandle信号量对象HANDLECreateSemaphore();CloseH
8、andle线程对象HANDLECreateThread();CloseHandle等待计时器对象HANDLECreateWaitableTimer()