本文整理汇总了C++中CtrlMemView类的典型用法代码示例。如果您正苦于以下问题:C++ CtrlMemView类的具体用法?C++ CtrlMemView怎么用?C++ CtrlMemView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CtrlMemView类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Core_WaitInactive
void CDisasm::SetDebugMode(bool _bDebug)
{
HWND hDlg = m_hDlg;
// Update Dialog Windows
if (_bDebug)
{
Core_WaitInactive(TEMP_BREAKPOINT_WAIT_MS);
CBreakPoints::ClearTemporaryBreakPoints();
updateBreakpointList();
threadList->reloadThreads();
updateThreadLabel(false);
EnableWindow( GetDlgItem(hDlg, IDC_GO), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEP), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPHLE), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_STOP), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_SKIP), TRUE);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDontRedraw(false);
ptr->gotoPC();
CtrlMemView *mem = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
mem->redraw();
// update the callstack
//CDisam::blah blah
UpdateDialog();
}
else
{
updateThreadLabel(true);
EnableWindow( GetDlgItem(hDlg, IDC_GO), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEP), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STEPHLE), FALSE);
EnableWindow( GetDlgItem(hDlg, IDC_STOP), TRUE);
EnableWindow( GetDlgItem(hDlg, IDC_SKIP), FALSE);
CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
reglist->redraw();
}
}
示例2: Dialog
CMemoryDlg::CMemoryDlg(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_MEMORY, _hInstance,_hParent)
{
cpu = _cpu;
TCHAR temp[256];
sprintf(temp,"Memory Viewer - %s",cpu->GetName());
SetWindowText(m_hDlg,temp);
ShowWindow(m_hDlg,SW_HIDE);
CtrlMemView *ptr = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_MEMVIEW));
ptr->setDebugger(_cpu);
Button_SetCheck(GetDlgItem(m_hDlg,IDC_RAM), TRUE);
Button_SetCheck(GetDlgItem(m_hDlg,IDC_MODESYMBOLS), TRUE);
GetWindowRect(GetDlgItem(m_hDlg,IDC_SYMBOLS),&slRect);
// subclass the edit box
HWND editWnd = GetDlgItem(m_hDlg,IDC_ADDRESS);
DefAddressEditProc = (WNDPROC)GetWindowLongPtr(editWnd,GWLP_WNDPROC);
SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)AddressEditProc);
AddressEditParentHwnd = m_hDlg;
Size();
}
示例3: Dialog
CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
{
cpu = _cpu;
lastTicks = PSP_IsInited() ? CoreTiming::GetTicks() : 0;
keepStatusBarText = false;
hideBottomTabs = false;
SetWindowText(m_hDlg, ConvertUTF8ToWString(_cpu->GetName()).c_str());
#ifdef THEMES
//if (WTL::CTheme::IsThemingSupported())
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
#endif
RECT windowRect;
GetWindowRect(m_hDlg,&windowRect);
int defaultWidth = windowRect.right-windowRect.left;
int defaultHeight = windowRect.bottom-windowRect.top;
minWidth = defaultWidth - 100;
minHeight = defaultHeight - 200;
int x = g_Config.iDisasmWindowX == -1 ? windowRect.left : g_Config.iDisasmWindowX;
int y = g_Config.iDisasmWindowY == -1 ? windowRect.top : g_Config.iDisasmWindowY;
int w = g_Config.iDisasmWindowW == -1 ? defaultWidth : g_Config.iDisasmWindowW;
int h = g_Config.iDisasmWindowH == -1 ? defaultHeight : g_Config.iDisasmWindowH;
// init status bar
statusBarWnd = CreateWindowEx(0, STATUSCLASSNAME, L"", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, m_hDlg, (HMENU)IDC_DISASMSTATUSBAR, _hInstance, NULL);
if (g_Config.bDisplayStatusBar == false)
{
ShowWindow(statusBarWnd,SW_HIDE);
}
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDebugger(cpu);
ptr->gotoAddr(0x00000000);
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
rl->setCPU(cpu);
leftTabs = new TabControl(GetDlgItem(m_hDlg,IDC_LEFTTABS));
leftTabs->SetIgnoreBottomMargin(true);
leftTabs->AddTab(GetDlgItem(m_hDlg,IDC_REGLIST),L"Regs");
leftTabs->AddTab(GetDlgItem(m_hDlg,IDC_FUNCTIONLIST),L"Funcs");
leftTabs->ShowTab(0);
// subclass the goto edit box
HWND editWnd = GetDlgItem(m_hDlg,IDC_ADDRESS);
DefGotoEditProc = (WNDPROC)GetWindowLongPtr(editWnd,GWLP_WNDPROC);
SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)GotoEditProc);
// subclass the function list
HWND funcListWnd = GetDlgItem(m_hDlg,IDC_FUNCTIONLIST);
DefFuncListProc = (WNDPROC)GetWindowLongPtr(funcListWnd,GWLP_WNDPROC);
SetWindowLongPtr(funcListWnd,GWLP_WNDPROC,(LONG_PTR)FuncListProc);
// init bottom tabs
bottomTabs = new TabControl(GetDlgItem(m_hDlg,IDC_DEBUG_BOTTOMTABS));
HWND memHandle = GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW);
CtrlMemView *mem = CtrlMemView::getFrom(memHandle);
mem->setDebugger(_cpu);
bottomTabs->AddTab(memHandle,L"Memory");
breakpointList = new CtrlBreakpointList(GetDlgItem(m_hDlg,IDC_BREAKPOINTLIST),cpu,ptr);
breakpointList->reloadBreakpoints();
bottomTabs->AddTab(breakpointList->GetHandle(),L"Breakpoints");
threadList = new CtrlThreadList(GetDlgItem(m_hDlg,IDC_THREADLIST));
threadList->reloadThreads();
bottomTabs->AddTab(threadList->GetHandle(),L"Threads");
stackTraceView = new CtrlStackTraceView(GetDlgItem(m_hDlg,IDC_STACKFRAMES),cpu,ptr);
stackTraceView->loadStackTrace();
bottomTabs->AddTab(stackTraceView->GetHandle(),L"Stack frames");
moduleList = new CtrlModuleList(GetDlgItem(m_hDlg,IDC_MODULELIST),cpu);
moduleList->loadModules();
bottomTabs->AddTab(moduleList->GetHandle(),L"Modules");
bottomTabs->SetShowTabTitles(g_Config.bShowBottomTabTitles);
bottomTabs->ShowTab(memHandle);
// Actually resize the window to the proper size (after the above setup.)
// do it twice so that the window definitely receives a WM_SIZE message with
// the correct size (the default from the .rc tends to be off)
MoveWindow(m_hDlg,x,y,1,1,FALSE);
MoveWindow(m_hDlg,x,y,w,h,TRUE);
SetDebugMode(true, true);
}
示例4: switch
//.........这里部分代码省略.........
{
symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
break;
}
default:
return FALSE;
}
return TRUE;
}
case WM_DEB_MAPLOADED:
NotifyMapLoaded();
break;
case WM_DEB_GOTOWPARAM:
{
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->gotoAddr(wParam);
SetFocus(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
break;
}
case WM_DEB_GOTOADDRESSEDIT:
{
if (!PSP_IsInited()) {
break;
}
wchar_t szBuffer[256];
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
GetWindowText(GetDlgItem(m_hDlg,IDC_ADDRESS),szBuffer,256);
u32 addr;
if (parseExpression(ConvertWStringToUTF8(szBuffer).c_str(),cpu,addr) == false)
{
displayExpressionError(GetDlgItem(m_hDlg,IDC_ADDRESS));
} else {
ptr->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
UpdateDialog();
}
break;
case WM_DEB_SETDEBUGLPARAM:
SetDebugMode(lParam != 0, true);
return TRUE;
case WM_DEB_UPDATE:
Update();
return TRUE;
case WM_DEB_TABPRESSED:
bottomTabs->NextTab(true);
SetFocus(bottomTabs->CurrentTabHandle());
break;
case WM_DEB_SETSTATUSBARTEXT:
if (!keepStatusBarText)
SetWindowText(statusBarWnd, ConvertUTF8ToWString((const char *)lParam).c_str());
break;
case WM_DEB_GOTOHEXEDIT:
{
CtrlMemView *memory = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
memory->gotoAddr(wParam);
// display the memory viewer too
bottomTabs->ShowTab(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
}
break;
case WM_SIZE:
{
UpdateSize(LOWORD(lParam), HIWORD(lParam));
SendMessage(statusBarWnd,WM_SIZE,0,10);
SavePosition();
return TRUE;
}
case WM_MOVE:
SavePosition();
break;
case WM_GETMINMAXINFO:
{
MINMAXINFO *m = (MINMAXINFO *)lParam;
// Reduce the minimum size slightly, so they can size it however they like.
m->ptMinTrackSize.x = minWidth;
//m->ptMaxTrackSize.x = m->ptMinTrackSize.x;
m->ptMinTrackSize.y = minHeight;
}
return TRUE;
case WM_CLOSE:
Show(false);
return TRUE;
case WM_ACTIVATE:
if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE)
{
g_activeWindow = WINDOW_CPUDEBUGGER;
}
break;
}
return FALSE;
}
示例5: switch
BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_COMMAND:
{
CtrlMemView *mv = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_MEMVIEW));
switch (LOWORD(wParam))
{
case IDC_REGIONS:
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
{
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ComboBox_GetCurSel(lb);
if (n!=-1)
{
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
mv->gotoAddr(addr);
}
}
break;
};
break;
case IDC_SYMBOLS:
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
{
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ListBox_GetCurSel(lb);
if (n!=-1)
{
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);
mv->gotoAddr(addr);
}
}
break;
};
break;
case IDC_MODENORMAL:
mv->setMode(MV_NORMAL);
break;
case IDC_MODESYMBOLS:
mv->setMode(MV_NORMAL);
// mv->setMode(MV_SYMBOLS);
break;
}
}
break;
case WM_DEB_MAPLOADED:
NotifyMapLoaded();
break;
case WM_DEB_GOTOADDRESSEDIT:
{
CtrlMemView *mv = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_MEMVIEW));
char temp[256];
u32 addr;
GetWindowText(GetDlgItem(m_hDlg,IDC_ADDRESS),temp,255);
if (parseExpression(temp,cpu,addr) == false)
{
displayExpressionError(m_hDlg);
} else {
mv->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg,IDC_MEMVIEW));
}
break;
}
case WM_INITDIALOG:
{
return TRUE;
}
break;
case WM_SIZE:
Size();
break;
case WM_CLOSE:
Show(false);
break;
}
return FALSE;
}
示例6: Dialog
CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
{
cpu = _cpu;
lastTicks = CoreTiming::GetTicks();
SetWindowText(m_hDlg,_cpu->GetName());
#ifdef THEMES
//if (WTL::CTheme::IsThemingSupported())
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
#endif
int x = g_Config.iDisasmWindowX == -1 ? 500 : g_Config.iDisasmWindowX;
int y = g_Config.iDisasmWindowY == -1 ? 200 : g_Config.iDisasmWindowY;
int w = g_Config.iDisasmWindowW;
int h = g_Config.iDisasmWindowH;
// Start with the initial size so we have the right minimum size from the rc.
SetWindowPos(m_hDlg, 0, x, y, 0, 0, SWP_NOSIZE);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDebugger(cpu);
ptr->gotoAddr(0x00000000);
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
rl->setCPU(cpu);
GetWindowRect(m_hDlg, &defaultRect);
//symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
GetWindowRect(GetDlgItem(m_hDlg, IDC_REGLIST), ®Rect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_DISASMVIEW), &disRect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST), &breakpointRect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST), &defaultBreakpointRect);
HWND tabs = GetDlgItem(m_hDlg, IDC_LEFTTABS);
TCITEM tcItem;
ZeroMemory (&tcItem,sizeof (tcItem));
tcItem.mask = TCIF_TEXT;
tcItem.dwState = 0;
tcItem.pszText = "Regs";
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
tcItem.iImage = 0;
int result1 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Funcs";
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
int result2 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), SW_NORMAL);
ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), SW_HIDE);
SetTimer(m_hDlg,1,1000,0);
// subclass the goto edit box
HWND editWnd = GetDlgItem(m_hDlg,IDC_ADDRESS);
DefGotoEditProc = (WNDPROC)GetWindowLongPtr(editWnd,GWLP_WNDPROC);
SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)GotoEditProc);
// init memory viewer
CtrlMemView *mem = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
mem->setDebugger(_cpu);
breakpointList = new CtrlBreakpointList();
breakpointList->setCpu(cpu);
breakpointList->setDisasm(ptr);
breakpointList->setDialogItem(GetDlgItem(m_hDlg,IDC_BREAKPOINTLIST));
breakpointList->update();
threadList = new CtrlThreadList();
threadList->setDialogItem(GetDlgItem(m_hDlg,IDC_THREADLIST));
threadList->reloadThreads();
// init memory/breakpoint "tab"
ShowWindow(GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST), SW_HIDE);
ShowWindow(GetDlgItem(m_hDlg, IDC_DEBUGMEMVIEW), SW_NORMAL);
ShowWindow(GetDlgItem(m_hDlg, IDC_THREADLIST), SW_HIDE);
// Actually resize the window to the proper size (after the above setup.)
if (w != -1 && h != -1)
{
// this will also call UpdateSize
SetWindowPos(m_hDlg, 0, x, y, w, h, 0);
}
SetDebugMode(true);
}
示例7: switch
LRESULT CALLBACK CtrlMemView::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CtrlMemView *ccp = CtrlMemView::getFrom(hwnd);
static bool lmbDown=false,rmbDown=false;
switch(msg)
{
case WM_NCCREATE:
// Allocate a new CustCtrl structure for this window.
ccp = new CtrlMemView(hwnd);
// Continue with window creation.
return ccp != NULL;
// Clean up when the window is destroyed.
case WM_NCDESTROY:
delete ccp;
break;
case WM_SETFONT:
break;
case WM_SIZE:
ccp->redraw();
break;
case WM_PAINT:
ccp->onPaint(wParam,lParam);
break;
case WM_VSCROLL:
ccp->onVScroll(wParam,lParam);
break;
case WM_ERASEBKGND:
return FALSE;
case WM_KEYDOWN:
ccp->onKeyDown(wParam,lParam);
break;
case WM_LBUTTONDOWN: SetFocus(hwnd); lmbDown=true; ccp->onMouseDown(wParam,lParam,1); break;
case WM_RBUTTONDOWN: rmbDown=true; ccp->onMouseDown(wParam,lParam,2); break;
case WM_MOUSEMOVE: ccp->onMouseMove(wParam,lParam,(lmbDown?1:0) | (rmbDown?2:0)); break;
case WM_LBUTTONUP: lmbDown=false; ccp->onMouseUp(wParam,lParam,1); break;
case WM_RBUTTONUP: rmbDown=false; ccp->onMouseUp(wParam,lParam,2); break;
case WM_SETFOCUS:
SetFocus(hwnd);
ccp->hasFocus=true;
ccp->redraw();
break;
case WM_KILLFOCUS:
ccp->hasFocus=false;
ccp->redraw();
break;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
示例8: switch
//.........这里部分代码省略.........
symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
break;
}
default:
return FALSE;
}
return TRUE;
}
case WM_DEB_MAPLOADED:
NotifyMapLoaded();
break;
case WM_DEB_GOTOWPARAM:
{
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->gotoAddr(wParam);
SetFocus(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
break;
}
case WM_DEB_GOTOADDRESSEDIT:
{
char szBuffer[256];
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
GetWindowText(GetDlgItem(m_hDlg,IDC_ADDRESS),szBuffer,256);
u32 addr;
if (parseExpression(szBuffer,cpu,addr) == false)
{
displayExpressionError(GetDlgItem(m_hDlg,IDC_ADDRESS));
} else {
ptr->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
UpdateDialog();
}
break;
case WM_DEB_SETDEBUGLPARAM:
SetDebugMode(lParam != 0);
return TRUE;
case WM_DEB_UPDATE:
Update();
return TRUE;
case WM_DEB_TABPRESSED:
changeSubWindow(SUBWIN_NEXT);
break;
case WM_DEB_SETSTATUSBARTEXT:
SendMessage(statusBarWnd,WM_SETTEXT,0,lParam);
break;
case WM_DEB_GOTOHEXEDIT:
{
CtrlMemView *memory = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
memory->gotoAddr(wParam);
// display the memory viewer too
HWND bp = GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST);
HWND mem = GetDlgItem(m_hDlg, IDC_DEBUGMEMVIEW);
HWND threads = GetDlgItem(m_hDlg, IDC_THREADLIST);
ShowWindow(bp,SW_HIDE);
ShowWindow(mem,SW_NORMAL);
ShowWindow(threads,SW_HIDE);
}
break;
case WM_SIZE:
{
UpdateSize(LOWORD(lParam), HIWORD(lParam));
SendMessage(statusBarWnd,WM_SIZE,0,10);
SavePosition();
return TRUE;
}
case WM_MOVE:
SavePosition();
break;
case WM_GETMINMAXINFO:
{
MINMAXINFO *m = (MINMAXINFO *)lParam;
// Reduce the minimum size slightly, so they can size it however they like.
m->ptMinTrackSize.x = defaultRect.right - defaultRect.left - 100;
//m->ptMaxTrackSize.x = m->ptMinTrackSize.x;
m->ptMinTrackSize.y = defaultRect.bottom - defaultRect.top - 200;
}
return TRUE;
case WM_CLOSE:
Show(false);
return TRUE;
case WM_ACTIVATE:
if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE)
{
g_debuggerActive = true;
} else {
g_debuggerActive = false;
}
break;
}
return FALSE;
}
示例9: switch
LRESULT CALLBACK CtrlMemView::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CtrlMemView *ccp = CtrlMemView::getFrom(hwnd);
static bool lmbDown=false,rmbDown=false;
switch(msg)
{
case WM_NCCREATE:
// Allocate a new CustCtrl structure for this window.
ccp = new CtrlMemView(hwnd);
// Continue with window creation.
return ccp != NULL;
// Clean up when the window is destroyed.
case WM_NCDESTROY:
delete ccp;
break;
case WM_SETFONT:
break;
case WM_SIZE:
ccp->redraw();
break;
case WM_PAINT:
ccp->onPaint(wParam,lParam);
break;
case WM_VSCROLL:
ccp->onVScroll(wParam,lParam);
break;
case WM_MOUSEWHEEL:
if (GET_WHEEL_DELTA_WPARAM(wParam) > 0)
{
ccp->scrollWindow(-3);
} else if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) {
ccp->scrollWindow(3);
}
break;
case WM_ERASEBKGND:
return FALSE;
case WM_KEYDOWN:
ccp->onKeyDown(wParam,lParam);
return 0;
case WM_CHAR:
ccp->onChar(wParam,lParam);
return 0;
case WM_KEYUP:
return 0;
case WM_LBUTTONDOWN: SetFocus(hwnd); lmbDown=true; ccp->onMouseDown(wParam,lParam,1); break;
case WM_RBUTTONDOWN: SetFocus(hwnd); rmbDown=true; ccp->onMouseDown(wParam,lParam,2); break;
case WM_MOUSEMOVE: ccp->onMouseMove(wParam,lParam,(lmbDown?1:0) | (rmbDown?2:0)); break;
case WM_LBUTTONUP: lmbDown=false; ccp->onMouseUp(wParam,lParam,1); break;
case WM_RBUTTONUP: rmbDown=false; ccp->onMouseUp(wParam,lParam,2); break;
case WM_SETFOCUS:
SetFocus(hwnd);
ccp->hasFocus=true;
ccp->redraw();
break;
case WM_KILLFOCUS:
ccp->hasFocus=false;
ccp->redraw();
break;
case WM_GETDLGCODE: // we want to process the arrow keys and all characters ourselves
return DLGC_WANTARROWS|DLGC_WANTCHARS|DLGC_WANTTAB;
break;
case WM_TIMER:
if (wParam == 1 && IsWindowVisible(ccp->wnd))
ccp->redraw();
break;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
示例10: switch
LRESULT CALLBACK CtrlMemView::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CtrlMemView *ccp = CtrlMemView::getFrom(hwnd);
static bool lmbDown=false,rmbDown=false;
switch(msg)
{
case WM_COMMAND:
/* switch(LOWORD(wParam))
{
case ID_MEMVIEW_DUMP:
MessageBox(hwnd,"This feature has not been implemented.","Sorry",0);
break;
case ID_MEMVIEW_GOTOINDISASM:
CDisasm::Goto(ccp->selection);
break;
case ID_MEMVIEW_ADDMEMORYBREAKPOINT:
{
#ifdef LOGGING
CMemChecksDlg::Show(true);
TMemCheck mc;
_u32 addr = ccp->getSelection();
int fun = Debugger_GetSymbolNum(addr);
int st,end;
if (fun!=-1)
{
st = Debugger_GetSymbolAddr(fun);
end = st + Debugger_GetSymbolSize(fun)-4;
if (end<st) end=st; //for smaller than 4 bytes symbols
}
else
{
st=addr;
end=addr;
}
mc.iStartAddress = st;
mc.iEndAddress = end;
mc.bRange=(end-st)>4;
mc.bBreak=true;
mc.bLog=true;
mc.bOnRead=true;
mc.bOnWrite=true;
CMemChecksDlg::AddNewCheck(mc);
#else
MessageBox(hwnd,"This build does not support this feature.","Speed build restrictions",0);
#endif
}
break;
case ID_MEMVIEW_COPYVALUE:
{
char temp[24];
sprintf(temp,"%08x",CMemory::ReadUnchecked_U32(ccp->selection));
CopyTextToClipboard(hwnd,temp);
}
break;
}*/
break;
case WM_NCCREATE:
// Allocate a new CustCtrl structure for this window.
ccp = new CtrlMemView(hwnd);
ccp->setDebugger(&di);
ccp->setMode(MV_NORMAL);
// Continue with window creation.
return ccp != NULL;
// Clean up when the window is destroyed.
case WM_NCDESTROY:
delete ccp;
break;
case WM_SETFONT:
break;
case WM_SIZE:
ccp->redraw();
break;
case WM_PAINT:
ccp->onPaint(wParam,lParam);
break;
case WM_VSCROLL:
ccp->onVScroll(wParam,lParam);
break;
case WM_ERASEBKGND:
return FALSE;
case WM_KEYDOWN:
ccp->onKeyDown(wParam,lParam);
break;
case WM_LBUTTONDOWN: SetFocus(hwnd); lmbDown=true; ccp->onMouseDown(wParam,lParam,1); break;
case WM_RBUTTONDOWN: rmbDown=true; ccp->onMouseDown(wParam,lParam,2); break;
case WM_MOUSEMOVE: ccp->onMouseMove(wParam,lParam,(lmbDown?1:0) | (rmbDown?2:0)); break;
case WM_LBUTTONUP: lmbDown=false; ccp->onMouseUp(wParam,lParam,1); break;
case WM_RBUTTONUP: rmbDown=false; ccp->onMouseUp(wParam,lParam,2); break;
case WM_SETFOCUS:
SetFocus(hwnd);
ccp->hasFocus=true;
ccp->redraw();
break;
case WM_KILLFOCUS:
ccp->hasFocus=false;
ccp->redraw();
//.........这里部分代码省略.........
示例11: Show
void CVFPUDlg::Goto(u32 addr)
{
Show(true);
CtrlMemView *mv = CtrlMemView::getFrom(GetDlgItem(CVFPUDlg::m_hDlg,IDC_MEMVIEW));
mv->gotoAddr(addr & ~3);
}