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

C / C++ / MFC

 
GeneralRe: size of a compiled exe Pin
kfaday24-May-04 15:39
kfaday24-May-04 15:39 
GeneralRe: size of a compiled exe Pin
temp1@vasr.net24-May-04 16:12
susstemp1@vasr.net24-May-04 16:12 
GeneralRe: size of a compiled exe Pin
Maxwell Chen24-May-04 17:58
Maxwell Chen24-May-04 17:58 
GeneralRe: size of a compiled exe Pin
Michael Dunn24-May-04 18:01
sitebuilderMichael Dunn24-May-04 18:01 
GeneralRe: size of a compiled exe Pin
Michael Dunn24-May-04 18:00
sitebuilderMichael Dunn24-May-04 18:00 
GeneralRe: size of a compiled exe Pin
locoone25-May-04 6:42
locoone25-May-04 6:42 
GeneralRe: size of a compiled exe Pin
David Crow25-May-04 2:24
David Crow25-May-04 2:24 
GeneralHooks and Message Blocking Pin
User 1278224-May-04 15:09
User 1278224-May-04 15:09 
Hi, sorry for asking so many hook related questions, I'm new to them, and the people here have been very helpful, and I'm grateful for that. Basically I want to recieve all mouse and keyboard events, and selectively process and block them. I have a WH_GETMESSAGE hook, which looks something like the following:

LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
	if(HC_ACTION==nCode)<br />
	{<br />
		MSG *pMsg=(MSG*)lParam;<br />
<br />
...<br />
<br />
//if some condition is true and this is a message I want to block<br />
		pMsg->message=WM_NULL;<br />
		lParam=(LPARAM)pMsg;<br />
	}<br />
<br />
	return CallNextHookEx(g_hHookMouse,nCode,wParam,lParam);<br />
}


This works fairly well, except some messages get through. The user can click to change windows, "restore" the window by clicking on the title bar, and I think just generally change the focus. I'm checking for and blocking these messages:

WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK
WM_MBUTTONDOWN
WM_MBUTTONUP
WM_MBUTTONDBLCLK
WM_RBUTTONDOWN
WM_RBUTTONUP
WM_RBUTTONDBLCLK
WM_NCLBUTTONUP
WM_NCLBUTTONDOWN


Are there additional messages I should consider? Or should I take a different approach?

Thanks a lot!

modified 12-Jul-20 21:01pm.

GeneralRe: Hooks and Message Blocking Pin
Ryan Binns24-May-04 18:22
Ryan Binns24-May-04 18:22 
GeneralRe: Hooks and Message Blocking Pin
User 1278224-May-04 18:47
User 1278224-May-04 18:47 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller25-May-04 14:53
Blake Miller25-May-04 14:53 
GeneralRe: Hooks and Message Blocking Pin
User 1278225-May-04 15:24
User 1278225-May-04 15:24 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller25-May-04 15:31
Blake Miller25-May-04 15:31 
GeneralRe: Hooks and Message Blocking Pin
User 1278225-May-04 15:42
User 1278225-May-04 15:42 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller25-May-04 16:01
Blake Miller25-May-04 16:01 
GeneralRe: Hooks and Message Blocking Pin
User 1278225-May-04 16:36
User 1278225-May-04 16:36 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller26-May-04 7:09
Blake Miller26-May-04 7:09 
GeneralRe: Hooks and Message Blocking Pin
User 1278226-May-04 10:30
User 1278226-May-04 10:30 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller26-May-04 10:37
Blake Miller26-May-04 10:37 
GeneralRe: Hooks and Message Blocking Pin
User 1278226-May-04 10:40
User 1278226-May-04 10:40 
GeneralRe: Hooks and Message Blocking Pin
Anonymous14-Jul-04 10:03
Anonymous14-Jul-04 10:03 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller14-Jul-04 10:41
Blake Miller14-Jul-04 10:41 
GeneralRe: Hooks and Message Blocking Pin
Blake Miller14-Jul-04 10:25
Blake Miller14-Jul-04 10:25 
GeneralMFC IO Pin
ANDYFA24-May-04 14:30
ANDYFA24-May-04 14:30 
GeneralRe: MFC IO Pin
valikac24-May-04 14:38
valikac24-May-04 14:38 

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.