Click here to Skip to main content
15,902,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to use ::* Pin
Robert A. T. Káldy26-Oct-04 0:15
Robert A. T. Káldy26-Oct-04 0:15 
GeneralRe: how to use ::* Pin
Anonymous26-Oct-04 20:34
Anonymous26-Oct-04 20:34 
GeneralInputting Keyboard events into a dialog box Pin
Member 134303625-Oct-04 22:27
Member 134303625-Oct-04 22:27 
GeneralRe: Inputting Keyboard events into a dialog box Pin
P_JAYAPRAKASH25-Oct-04 22:41
P_JAYAPRAKASH25-Oct-04 22:41 
GeneralRe: Inputting Keyboard events into a dialog box Pin
Blake Miller26-Oct-04 6:20
Blake Miller26-Oct-04 6:20 
Generalsuspend process Pin
uttit25-Oct-04 22:21
uttit25-Oct-04 22:21 
GeneralRe: suspend process Pin
Mike Beckerleg25-Oct-04 23:42
Mike Beckerleg25-Oct-04 23:42 
GeneralRe: suspend process Pin
yanping wang26-Oct-04 1:33
yanping wang26-Oct-04 1:33 
here are some code used to suspend a process. since I do not known the exact problem you meet, I only show it for you:


BOOL WINAPI SuspendProcess(DWORD dwProcessID, BOOL bSuspend)
{
// 取得OpenThread函数的地址
typedef HANDLE (__stdcall *PFNOPENTHREAD)(DWORD, BOOL, DWORD);
HMODULE hModule = ::GetModuleHandle("kernel32.dll");
PFNOPENTHREAD OpenThread = (PFNOPENTHREAD)::GetProcAddress(hModule, "OpenThread");
if(OpenThread == NULL)
return FALSE;

// 取得指定进程内的线程列表
HANDLE hSnap;
hSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, dwProcessID);
if(hSnap != INVALID_HANDLE_VALUE)
{
// 遍历线程列表
THREADENTRY32 te = { 0 };
te.dwSize = sizeof(te);
BOOL bOK = ::Thread32First(hSnap, &te);
while(bOK)
{
if(te.th32OwnerProcessID == dwProcessID)
{
DWORD dwID = te.th32ThreadID;
// 试图打开这个线程
HANDLE hThread = OpenThread(THREAD_SUSPEND_RESUME, FALSE, dwID);
if(hThread != NULL)
{
// 暂停或者唤醒这个线程
if(bSuspend)
::SuspendThread(hThread);
else
::ResumeThread(hThread);
::CloseHandle(hThread);
}
}
bOK = ::Thread32Next(hSnap, &te);
}
::CloseHandle(hSnap);
}

return TRUE;
}


I am a Chinese man, so the commentary is in Chinese.


Regards
Generalhelp me Pin
Wiltein25-Oct-04 21:17
Wiltein25-Oct-04 21:17 
GeneralRe: help me Pin
Maximilien26-Oct-04 1:00
Maximilien26-Oct-04 1:00 
GeneralRe: help me Pin
jan larsen26-Oct-04 3:30
jan larsen26-Oct-04 3:30 
GeneralRetain MFC Controls values for Next Open VC++6.0 Pin
Sumit Kapoor25-Oct-04 21:01
Sumit Kapoor25-Oct-04 21:01 
GeneralRe: Retain MFC Controls values for Next Open VC++6.0 Pin
Maximilien26-Oct-04 0:54
Maximilien26-Oct-04 0:54 
GeneralRe: Retain MFC Controls values for Next Open VC++6.0 Pin
BlackDice26-Oct-04 3:51
BlackDice26-Oct-04 3:51 
GeneralThanks you both, Check what I used Pin
Sumit Kapoor26-Oct-04 19:11
Sumit Kapoor26-Oct-04 19:11 
Generalit fails to retrieve newly intruduced data by the user Pin
Natural_Demon25-Oct-04 20:45
Natural_Demon25-Oct-04 20:45 
GeneralRe: it fails to retrieve newly intruduced data by the user Pin
ThatsAlok25-Oct-04 23:00
ThatsAlok25-Oct-04 23:00 
GeneralRe: it fails to retrieve newly intruduced data by the user Pin
Natural_Demon26-Oct-04 3:39
Natural_Demon26-Oct-04 3:39 
GeneralOpenProcess() issue in win XP Pin
P_JAYAPRAKASH25-Oct-04 19:08
P_JAYAPRAKASH25-Oct-04 19:08 
GeneralRe: OpenProcess() issue in win XP Pin
bryce25-Oct-04 19:48
bryce25-Oct-04 19:48 
GeneralError Link in VC++ Pin
TrungHuynh25-Oct-04 18:25
TrungHuynh25-Oct-04 18:25 
GeneralRe: Error Link in VC++ Pin
bryce25-Oct-04 19:44
bryce25-Oct-04 19:44 
GeneralRe: Error Link in VC++ Pin
Robert A. T. Káldy26-Oct-04 0:28
Robert A. T. Káldy26-Oct-04 0:28 
GeneralRe: Error Link in VC++ Pin
dharani26-Oct-04 21:24
dharani26-Oct-04 21:24 
GeneralRe: Error Link in VC++ Pin
Robert A. T. Káldy28-Oct-04 23:43
Robert A. T. Káldy28-Oct-04 23:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.