Click here to Skip to main content
15,925,723 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help to get list of files in a directory... Pin
Thilek9-Jan-09 4:25
Thilek9-Jan-09 4:25 
GeneralRe: Need help to get list of files in a directory... Pin
David Crow9-Jan-09 4:28
David Crow9-Jan-09 4:28 
GeneralRe: Need help to get list of files in a directory... Pin
Thilek9-Jan-09 4:31
Thilek9-Jan-09 4:31 
AnswerRe: Need help to get list of files in a directory... Pin
vinvino20019-Jan-09 4:02
vinvino20019-Jan-09 4:02 
GeneralRe: Need help to get list of files in a directory... Pin
Thilek9-Jan-09 4:12
Thilek9-Jan-09 4:12 
GeneralRe: Need help to get list of files in a directory... Pin
Hamid_RT9-Jan-09 5:08
Hamid_RT9-Jan-09 5:08 
AnswerRe: Need help to get list of files in a directory... Pin
vinvino20019-Jan-09 6:18
vinvino20019-Jan-09 6:18 
QuestionIntercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 0:13
kcynic9-Jan-09 0:13 
I want to hook a mouse events of a specified window. So, i install a WH_MOUSE hook callback procedure for that thread.
If i didn't hook that message, the thread would show a pop menu when it received a right button message.
After i hooked that thread, windows would call my callback procedure when such event occurred, but the original window's message handler would be called, too. But i want to hold such message to make the original window will not receive such message. I use global hooks but check the process id like:
LRESULT CALLBACK MouseHookProcedure(int nCode, WPARAM wParam, LPARAM lParam)
{
	if(0 > nCode)
		return CallNextHookEx(g_hPreviousMouseHook, nCode, wParam, lParam);

	//OutputDebugString(_T("Mouse Hooked Event...\n"));
	MOUSEHOOKSTRUCT *pMouseHooksStruct = (MOUSEHOOKSTRUCT *) lParam;
	DWORD process_id;
	GetWindowThreadProcessId(pMouseHooksStruct->hwnd,&process_id);
	if(process_id==target_process_id){//is that process to be hooked
		.... my process
		return 1;//or return 0
	}
       return CallNextHookEx(g_hPreviousMouseHook, nCode, wParam, lParam);
}


that, target_process_id is stored in the shared segment block, im sure its ok.
How to fix such a problem?

Regards.
AnswerRe: Intercept all mouse event for a specified hwnd Pin
Garth J Lancaster9-Jan-09 0:45
professionalGarth J Lancaster9-Jan-09 0:45 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 1:10
kcynic9-Jan-09 1:10 
AnswerRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 0:51
Code-o-mat9-Jan-09 0:51 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 1:08
kcynic9-Jan-09 1:08 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 1:16
Code-o-mat9-Jan-09 1:16 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 3:09
kcynic9-Jan-09 3:09 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 3:34
Code-o-mat9-Jan-09 3:34 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 4:48
kcynic9-Jan-09 4:48 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 5:01
Code-o-mat9-Jan-09 5:01 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 5:05
kcynic9-Jan-09 5:05 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 5:12
Code-o-mat9-Jan-09 5:12 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 15:32
kcynic9-Jan-09 15:32 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 23:31
Code-o-mat9-Jan-09 23:31 
AnswerRe: Intercept all mouse event for a specified hwnd Pin
Malli_S9-Jan-09 1:09
Malli_S9-Jan-09 1:09 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Code-o-mat9-Jan-09 1:15
Code-o-mat9-Jan-09 1:15 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
Malli_S9-Jan-09 1:17
Malli_S9-Jan-09 1:17 
GeneralRe: Intercept all mouse event for a specified hwnd Pin
kcynic9-Jan-09 3:27
kcynic9-Jan-09 3:27 

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.