void CreateMemoryMapView(int x, int y) { int cxBorder = ::GetSystemMetrics(SM_CXDLGFRAME); int cyBorder = ::GetSystemMetrics(SM_CYDLGFRAME); int cxScroll = ::GetSystemMetrics(SM_CXVSCROLL); int cyScroll = ::GetSystemMetrics(SM_CYHSCROLL); int cyCaption = ::GetSystemMetrics(SM_CYSMCAPTION); int width = 256 * 2 + cxScroll + cxBorder * 2; int height = 256 * 2 + cyScroll + cyBorder * 2 + cyCaption; g_hwndMemoryMap = CreateWindowEx( WS_EX_TOOLWINDOW | WS_EX_TOPMOST, CLASSNAME_OVERLAPPEDWINDOW, _T("BK Memory Map"), WS_POPUPWINDOW | WS_CAPTION | WS_VISIBLE, x, y, width, height, NULL, NULL, g_hInst, NULL); // ToolWindow subclassing m_wndprocMemoryMapToolWindow = (WNDPROC) LongToPtr( SetWindowLongPtr( g_hwndMemoryMap, GWLP_WNDPROC, PtrToLong(MemoryMapViewWndProc)) ); RECT rcClient; GetClientRect(g_hwndMemoryMap, &rcClient); m_hwndMemoryMapViewer = CreateWindow( CLASSNAME_MEMORYMAPVIEW, NULL, WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | WS_TABSTOP, 0, 0, rcClient.right, rcClient.bottom, g_hwndMemoryMap, NULL, g_hInst, NULL); MemoryMapView_InitBitmap(); MemoryMapView_UpdateScrollPos(); ::SetFocus(m_hwndMemoryMapViewer); }
void MemoryMapView_Create(HWND hwndParent, int x, int y) { int cxScroll = ::GetSystemMetrics(SM_CXVSCROLL); int cyCaption = TOOLWINDOW_CAPTION_HEIGHT; int width = m_nMemoryMap_ViewCX + cxScroll; int height = m_nMemoryMap_ViewCY + cyCaption; g_hwndMemoryMap = CreateWindow( CLASSNAME_TOOLWINDOW, _T("Memory Map"), WS_CHILD | WS_VISIBLE, x, y, width, height, hwndParent, NULL, g_hInst, NULL); // ToolWindow subclassing m_wndprocMemoryMapToolWindow = (WNDPROC) LongToPtr( SetWindowLongPtr( g_hwndMemoryMap, GWLP_WNDPROC, PtrToLong(MemoryMapViewWndProc)) ); RECT rcClient; GetClientRect(g_hwndMemoryMap, &rcClient); m_hwndMemoryMapViewer = CreateWindow( CLASSNAME_MEMORYMAPVIEW, NULL, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 0, 0, rcClient.right, rcClient.bottom, g_hwndMemoryMap, NULL, g_hInst, NULL); MemoryMapView_InitBitmap(); MemoryMapView_UpdateScrollPos(); }