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

C / C++ / MFC

 
GeneralRe: Substring for char Pin
luisgrimaldo23-Aug-08 20:15
luisgrimaldo23-Aug-08 20:15 
GeneralRe: Substring for char Pin
David Crow24-Aug-08 16:42
David Crow24-Aug-08 16:42 
AnswerRe: Substring for char Pin
Green Fuze23-Aug-08 20:06
Green Fuze23-Aug-08 20:06 
GeneralRe: Substring for char Pin
Green Fuze23-Aug-08 20:07
Green Fuze23-Aug-08 20:07 
AnswerRe: Substring for char Pin
Jijo.Raj23-Aug-08 23:26
Jijo.Raj23-Aug-08 23:26 
Questiona weird problem with global hooking of messages. Pin
Green Fuze23-Aug-08 3:07
Green Fuze23-Aug-08 3:07 
AnswerRe: a weird problem with global hooking of messages. Pin
Naveen23-Aug-08 21:32
Naveen23-Aug-08 21:32 
GeneralRe: a weird problem with global hooking of messages. Pin
Green Fuze23-Aug-08 21:47
Green Fuze23-Aug-08 21:47 
First of all thanks a lot for your help!!! (really!)

Here is the code I'm using in the DLL:

The code to register the hook:
<br />
void _declspec(dllexport) __stdcall registerHook(void)<br />
{<br />
	hHook = SetWindowsHookEx(WH_CALLWNDPROC, MsgHookProc, hHookDLL, 0);<br />
}<br />


Here is the code of the MsgHookProc() callback function:
<br />
LRESULT CALLBACK MsgHookProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
	if(nCode >= 0)<br />
	{<br />
		LPMSG m = (LPMSG)lParam;<br />
<br />
		switch(m->message)<br />
		{<br />
		case WM_PASTE:<br />
		case WM_RENDERFORMAT:<br />
		case WM_RENDERALLFORMATS:<br />
			MessageBox(NULL, L"Oh Yeah!", L"Paste", 0);<br />
			break;<br />
<br />
		case WM_COPY:<br />
			OutputDebugString(L"Copy!");<br />
			break;<br />
<br />
		case WM_CUT:<br />
			OutputDebugString(L"Cut!");<br />
			break;<br />
		}<br />
	}<br />
<br />
	return CallNextHookEx(hHook,nCode,wParam,lParam);<br />
}<br />



For your question of why I want to hook paste operation, well I'm a computer science student and I want to get a job in C++ development, I usually wrote .Net, so I was looking for a project to get my hands dirty and a bit of a challenge.
So I'm writing (well... trying to write Smile | :) ) a global copy/paste encrypter/decrypter.


Thanks again for your help!
GeneralRe: a weird problem with global hooking of messages. Pin
Naveen23-Aug-08 22:20
Naveen23-Aug-08 22:20 
GeneralRe: a weird problem with global hooking of messages. Pin
Green Fuze24-Aug-08 0:35
Green Fuze24-Aug-08 0:35 
AnswerPassing the member function pointer to the AfxBeginThread and its problems. Pin
WindowsPistha23-Aug-08 3:01
WindowsPistha23-Aug-08 3:01 
GeneralRe: Passing the member function pointer to the AfxBeginThread and its problems. Pin
David Crow23-Aug-08 4:18
David Crow23-Aug-08 4:18 
GeneralRe: Passing the member function pointer to the AfxBeginThread and its problems. Pin
WindowsPistha24-Aug-08 19:11
WindowsPistha24-Aug-08 19:11 
GeneralRe: Passing the member function pointer to the AfxBeginThread and its problems. Pin
David Crow25-Aug-08 4:14
David Crow25-Aug-08 4:14 
GeneralRe: Passing the member function pointer to the AfxBeginThread and its problems. Pin
WindowsPistha26-Aug-08 4:22
WindowsPistha26-Aug-08 4:22 
QuestionDifference between 2 threads & 64 threads in VC++ Pin
lakshmiyv1723-Aug-08 2:14
lakshmiyv1723-Aug-08 2:14 
AnswerRe: Difference between 2 threads & 64 threads in VC++ [modified] Pin
SandipG 23-Aug-08 4:55
SandipG 23-Aug-08 4:55 
AnswerRe: Difference between 2 threads & 64 threads in VC++ Pin
bob1697223-Aug-08 8:22
bob1697223-Aug-08 8:22 
QuestionDebugging a Win32 dll loaded by LoadLibrary Pin
Klempie23-Aug-08 1:35
Klempie23-Aug-08 1:35 
AnswerRe: Debugging a Win32 dll loaded by LoadLibrary [modified] Pin
SandipG 23-Aug-08 4:52
SandipG 23-Aug-08 4:52 
GeneralRe: Debugging a Win32 dll loaded by LoadLibrary Pin
Klempie24-Aug-08 6:07
Klempie24-Aug-08 6:07 
AnswerRe: Debugging a Win32 dll loaded by LoadLibrary Pin
Hamid_RT23-Aug-08 6:50
Hamid_RT23-Aug-08 6:50 
QuestionHow to get a url if IP address is known Pin
Dhiraj kumar Saini23-Aug-08 1:04
Dhiraj kumar Saini23-Aug-08 1:04 
AnswerRe: How to get a url if IP address is known Pin
Perspx23-Aug-08 1:31
Perspx23-Aug-08 1:31 
AnswerRe: How to get a url if IP address is known Pin
enhzflep23-Aug-08 1:33
enhzflep23-Aug-08 1:33 

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.