extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CWaiGuaTestDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CWaiGuaTestDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (
WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CWaiGuaTestDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CWaiGuaTestDlg::OnBUTGetProc()
{
// TODO: Add your control notification handler code here
((CComboBox *)GetDlgItem(IDC_COM_Proc))->ResetContent();
for(int i=0 ; i < 100 ; i++)
szThreadId[i] = 0;
HANDLE hSnapShot;
PROCESSENTRY32 szEntry;
szEntry.dwSize = sizeof(PROCESSENTRY32);
hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS , 0);
if(hSnapShot == INVALID_HANDLE_VALUE)
{
MessageBox("CreateToolhelp32Snapshot Error!");
return;
}
if(Process32First(hSnapShot,&szEntry))
{
int i=1;
((CComboBox *)GetDlgItem(IDC_COM_Proc))->AddString(szEntry.szExeFile);
szThreadId[0] = szEntry.th32ProcessID;
while(Process32Next(hSnapShot,&szEntry))
{
((CComboBox *)GetDlgItem(IDC_COM_Proc))->AddString(szEntry.szExeFile);
szThreadId[i] = szEntry.th32ProcessID;
i++;
}
MessageBox("获取
系统进程列表成功");
((CComboBox *)GetDlgItem(IDC_COM_Proc))->SetCurSel(i-1);
return;
}
}
void CWaiGuaTestDlg::OnButExecution()
{
// TODO: Add your control notification handler code here
//*******跳过远程线程代码,执行本程序*******
goto REMOTE_THREAD_END;
//////////////////////////////////////////////////////////////////////////
//////*******远程线程代码*******
//////////////////////////////////////////////////////////////////////////
REMOTE_THREAD_BEGIN:
_asm
{
//*******给LoadLibrary函数地址占位*******
LoadLibraryAddr:
nop
nop
nop
nop
//*******给FreeLibrary函数地址占位*******
FreeLibraryAddr:
nop
nop
nop
nop
//*******给动态链接库名占位*******
Lib |