Click here to Skip to main content
15,917,321 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: You Ever Wonder Why? Pin
Larry J. Siddens3-Oct-03 3:16
Larry J. Siddens3-Oct-03 3:16 
QuestionHow To OutPut To A Sound Card Pin
Cowwey30-Sep-03 4:19
Cowwey30-Sep-03 4:19 
GeneralRAM project Pin
IndrekSnt30-Sep-03 4:14
IndrekSnt30-Sep-03 4:14 
GeneralRe: RAM project Pin
David Crow30-Sep-03 4:49
David Crow30-Sep-03 4:49 
GeneralRe: RAM project Pin
IndrekSnt30-Sep-03 5:01
IndrekSnt30-Sep-03 5:01 
GeneralRe: RAM project Pin
IndrekSnt30-Sep-03 5:08
IndrekSnt30-Sep-03 5:08 
GeneralRe: RAM project Pin
David Crow30-Sep-03 5:25
David Crow30-Sep-03 5:25 
GeneralRe: RAM project Pin
IndrekSnt30-Sep-03 5:51
IndrekSnt30-Sep-03 5:51 
HANDLE proc;<br />
PROCESSENTRY32* info;<br />
	POSITION p;<br />
	int sel=0;<br />
	BOOL result;<br />
	char *name2;<br />
	int length=0;<br />
	proc=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
<br />
	info=new PROCESSENTRY32;<br />
	info->dwSize=sizeof(PROCESSENTRY32);<br />
	int id=0;<br />
<br />
	Process32First(proc,info);<br />
<br />
	p=m_list1.GetFirstSelectedItemPosition();<br />
	sel=m_list1.GetNextSelectedItem(p);<br />
<br />
	do{<br />
	Process32Next(proc,info);<br />
	}while(!strstr(info->szExeFile,"NOTEPAD"));<br />
<br />
<br />
    proc=OpenProcess(/*PROCESS_ALL_ACCESS*/SYNCHRONIZE|PROCESS_TERMINATE,TRUE,info->th32ProcessID);<br />
<br />
	m_name.Format("%s",info->szExeFile);<br />
	SetDlgItemText(IDC_NAME,m_name.GetBuffer(0));<br />
<br />
<br />
	if(WaitForSingleObject(proc,5000)!=WAIT_OBJECT_0){<br />
	result=TerminateProcess(proc,0);<br />
	MessageBox("Terminated","OK");<br />
	}else{<br />
		result=TRUE;<br />
		cw=FindWindow(info->szExeFile,NULL);<br />
		cw->PostMessage(WM_CLOSE);<br />
		MessageBox("TRUE","VIGA");<br />
	}<br />
	<br />
	CloseHandle(proc);<br />
        delete info;

Well, this should work, but how to use m_mylist.GetItemText(int nItem,intnSubItem,LPTSTR lpszText,innLen) with my code? Confused | :confused:
GeneralRe: RAM project Pin
David Crow30-Sep-03 6:37
David Crow30-Sep-03 6:37 
GeneralRe: RAM project Pin
IndrekSnt1-Oct-03 4:26
IndrekSnt1-Oct-03 4:26 
GeneralRe: RAM project Pin
David Crow1-Oct-03 4:33
David Crow1-Oct-03 4:33 
GeneralRe: RAM project Pin
IndrekSnt2-Oct-03 4:43
IndrekSnt2-Oct-03 4:43 
QuestionHow to restore minimized window? Pin
vgrigor30-Sep-03 3:28
vgrigor30-Sep-03 3:28 
AnswerRe: How to restore minimized window? Pin
David Crow30-Sep-03 3:37
David Crow30-Sep-03 3:37 
GeneralRe: How to restore minimized window? Pin
vgrigor30-Sep-03 3:48
vgrigor30-Sep-03 3:48 
GeneralCSocket - CSocketFile - CArchive Problem Pin
Brian Cox30-Sep-03 3:04
Brian Cox30-Sep-03 3:04 
GeneralRe: CSocket - CSocketFile - CArchive Problem Pin
DougW4830-Sep-03 7:01
DougW4830-Sep-03 7:01 
GeneralRe: CSocket - CSocketFile - CArchive Problem Pin
Brian Cox30-Sep-03 7:09
Brian Cox30-Sep-03 7:09 
GeneralSpy++ Pin
hph30-Sep-03 1:59
hph30-Sep-03 1:59 
GeneralMFC ShellExecuteEx structure Pin
Uke30-Sep-03 1:53
Uke30-Sep-03 1:53 
GeneralRe: MFC ShellExecuteEx structure Pin
David Crow30-Sep-03 2:28
David Crow30-Sep-03 2:28 
GeneralRe: MFC ShellExecuteEx structure Pin
Uke30-Sep-03 2:47
Uke30-Sep-03 2:47 
GeneralRe: MFC ShellExecuteEx structure Pin
Uke30-Sep-03 2:55
Uke30-Sep-03 2:55 
GeneralRe: MFC ShellExecuteEx structure Pin
David Crow30-Sep-03 2:56
David Crow30-Sep-03 2:56 
GeneralDebug Assertion Failure Pin
Saurabh_Delhi30-Sep-03 1:50
Saurabh_Delhi30-Sep-03 1:50 

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.