CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Aug 2003
    Posts
    938
    Hey.
    Code:
    if (nCode == HC_ACTION)
    	{
    		KBDLLHOOKSTRUCT* kbh=(KBDLLHOOKSTRUCT*)lParam;
    		switch(kbh->vkCode)
    		{
    			case 0x41:
    				{
    					INPUT bKey;
    					bKey.type=INPUT_KEYBOARD;
    					KEYBDINPUT kbinp;
    					kbinp.dwExtraInfo=0;
    					kbinp.dwFlags=0;
    					kbinp.time=0;
    					kbinp.wScan=0;
    					kbinp.wVk=0x42;
    					bKey.ki=kbinp;
    					SendInput(1,&bKey,sizeof(INPUT));
    					return 0;
    				}
    		};
    	}
        return CallNextHookEx(NULL, nCode, wParam, lParam);
    Now the Hook proc gets called alrite and all, however i want to modify the input once it was hooked.
    The above code definetly does not work, so i was wondering how can i modify the input that i hook? basically what happens if i press 'a' is i get 'bab' as output.
    Thx
    Last edited by Quell; February 18th, 2007 at 01:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured