Click here to Skip to main content
15,898,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBackground color of a property page Pin
Farhat Aisha27-Mar-07 0:56
Farhat Aisha27-Mar-07 0:56 
AnswerRe: Background color of a property page Pin
prasad_som27-Mar-07 2:20
prasad_som27-Mar-07 2:20 
QuestionUsing Excel from C++ Pin
BusyDeveloper27-Mar-07 0:44
BusyDeveloper27-Mar-07 0:44 
AnswerRe: Using Excel from C++ Pin
Roger Stoltz27-Mar-07 2:30
Roger Stoltz27-Mar-07 2:30 
GeneralRe: Using Excel from C++ Pin
BusyDeveloper27-Mar-07 20:12
BusyDeveloper27-Mar-07 20:12 
QuestionRe: Using Excel from C++ Pin
Roger Stoltz27-Mar-07 20:47
Roger Stoltz27-Mar-07 20:47 
AnswerRe: Using Excel from C++ Pin
BusyDeveloper27-Mar-07 22:09
BusyDeveloper27-Mar-07 22:09 
GeneralRe: Using Excel from C++ Pin
Roger Stoltz27-Mar-07 23:01
Roger Stoltz27-Mar-07 23:01 
GeneralRe: Using Excel from C++ Pin
BusyDeveloper28-Mar-07 22:46
BusyDeveloper28-Mar-07 22:46 
QuestionDestroyWindow & Focus Pin
baerten27-Mar-07 0:15
baerten27-Mar-07 0:15 
QuestionAbout storing file content Pin
siddharthsan26-Mar-07 23:37
siddharthsan26-Mar-07 23:37 
AnswerRe: About storing file content Pin
David Crow27-Mar-07 2:54
David Crow27-Mar-07 2:54 
Questionto call GlobalAlloc Pin
zon_cpp26-Mar-07 23:17
zon_cpp26-Mar-07 23:17 
AnswerRe: to call GlobalAlloc Pin
toxcct26-Mar-07 23:21
toxcct26-Mar-07 23:21 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 0:03
zon_cpp27-Mar-07 0:03 
GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 0:12
toxcct27-Mar-07 0:12 
QuestionRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 0:27
zon_cpp27-Mar-07 0:27 
AnswerRe: to call GlobalAlloc Pin
toxcct27-Mar-07 0:33
toxcct27-Mar-07 0:33 
GeneralRe: to call GlobalAlloc [modified] Pin
zon_cpp27-Mar-07 1:11
zon_cpp27-Mar-07 1:11 
GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 2:02
toxcct27-Mar-07 2:02 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 2:38
zon_cpp27-Mar-07 2:38 
For example: i call EnumProcesses function in endless loop (in thread),
first parameter of this function is a Pointer to an array that receives the list of process identifiers.

i call GlobalAlloc function to allocate memory with 1024 bytes or more for size (befor endless loop), then i send pointer to this memory (return value of GlobalAlloc) to EnumProcesses function :

__asm<br />
	{<br />
	mov		ecx, 4096	// = 1024*4<br />
	push		ecx<br />
	push		GMEM_FIXED<br />
	call		GlobalAlloc			// calling address of this function<br />
	mov		dword ptr[ebp + 0x48], eax	// ebp + 0x48 address of a dword in exe<br />
<br />
EndlessLoop:<br />
<br />
	lea		ecx,dword ptr[ebp + 0x49] 	// ebp + 0x48 address of a dword in exe<br />
	push		ecx<br />
	mov		ecx, 4096<br />
	push		ecx<br />
	mov		edx,[ebp + 0x48]<br />
	push		edx<br />
	call		EnumProcesses 			// calling address of this function<br />
<br />
	// and other code<br />
<br />
<br />
<br />
	jmp EndlessLoop<br />
<br />
	}<br />


i add a code section to an exe. this section creates thread white endless loop. all of this codes should be assembly language

Zo.Naderi-Iran

GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 2:42
toxcct27-Mar-07 2:42 
GeneralRe: to call GlobalAlloc Pin
zon_cpp27-Mar-07 2:46
zon_cpp27-Mar-07 2:46 
GeneralRe: to call GlobalAlloc Pin
_808627-Mar-07 3:28
_808627-Mar-07 3:28 
GeneralRe: to call GlobalAlloc Pin
toxcct27-Mar-07 3:44
toxcct27-Mar-07 3:44 

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.