Code for an inverse filter:

	// inverse filter: defined messages will be filtered, all else just passes through
	// may be replaced with a lookup-table to improve perfomance
	// upon completion of the rules, i.e., when it is clear which messages are required,
	// this should be changed to a "normal" filter.
	switch(msg->message) {
		case WM_NULL:
		case WM_MOVE:
		case WM_SIZE:
		case WM_GETTEXT:
		case WM_GETTEXTLENGTH:
		case WM_PAINT:
		case WM_ERASEBKGND:
		case WM_SHOWWINDOW:
		case WM_CANCELMODE:
		case WM_SETCURSOR:
		case WM_GETMINMAXINFO:
		case WM_GETFONT:
		case WM_WINDOWPOSCHANGING:
		case WM_WINDOWPOSCHANGED:
		case WM_NOTIFY:
		case WM_STYLECHANGING:
		case WM_STYLECHANGED:
		case WM_GETICON:
		case WM_NCCREATE:
		case WM_NCDESTROY:
		case WM_NCCALCSIZE:
		case WM_NCHITTEST:
		case WM_NCPAINT:
		case WM_GETDLGCODE:
		case 0x0090: // WM_UAHDESTROYWINDOW
		case 0x0091: // WM_UAHDRAWMENU
		case 0x0092: // WM_UADRAWMENUITEM
		case 0x0093: // WM_UAHINITMENU
		case 0x0094: // WM_UAHMEASUREMENUITEM
		case 0x0095: // WM_UAHNCPAINTMENUPOPUP
		case WM_NCMOUSEMOVE:
		case WM_TIMER:
		case WM_ENTERIDLE:
		case WM_CTLCOLORMSGBOX:
		case WM_CTLCOLOREDIT:
		case WM_CTLCOLORLISTBOX:
		case WM_CTLCOLORBTN:
		case WM_CTLCOLORDLG:
		case WM_CTLCOLORSCROLLBAR:
		case WM_CTLCOLORSTATIC:
		case WM_MOUSEMOVE:
		case WM_PARENTNOTIFY:
		case WM_MDIGETACTIVE:
		case WM_IME_NOTIFY:
		case WM_IME_SETCONTEXT:
		case WM_AFXFIRST:
		case WM_AFXFIRST+1:
		case WM_AFXFIRST+2:
		case WM_AFXFIRST+3:
		case WM_AFXFIRST+4:
		case WM_AFXFIRST+5:
		case WM_AFXFIRST+6:
		case WM_AFXFIRST+7:
		case WM_AFXFIRST+8:
		case WM_AFXFIRST+9:
		case WM_AFXFIRST+10:
		case WM_AFXFIRST+11:
		case WM_AFXFIRST+12:
		case WM_AFXFIRST+13:
		case WM_AFXFIRST+14:
		case WM_AFXFIRST+15:
		case WM_AFXFIRST+16:
		case WM_AFXFIRST+17:
		case WM_AFXFIRST+18:
		case WM_AFXFIRST+19:
		case WM_AFXFIRST+20:
		case WM_AFXFIRST+21:
		case WM_AFXFIRST+22:
		case WM_AFXFIRST+23:
		case WM_AFXFIRST+24:
		case WM_AFXFIRST+25:
		case WM_AFXFIRST+26:
		case WM_AFXFIRST+27:
		case WM_AFXFIRST+28:
		case WM_AFXFIRST+29:
		case WM_AFXFIRST+30:
		case WM_AFXLAST:
		case 1025:
		case 1031:
		case 1142:
		case 2024:
		case 4100:
		case 4101:
		case 4103:
		case 4352:
		case 4362:
		case 4363:
		case 4364:
		case 4365:
		case 4372:
		case 4613:
			break;
		default:
			// exclude messages 0xC000-0xFFFF
			if( !(msg->message>=0xC000 && msg->message<=0xFFFF) ) {
				// CODE HERE!
			}
			break;
	}