Click here to Skip to main content
15,889,651 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Include issues Pin
Garth J Lancaster28-Mar-09 20:39
professionalGarth J Lancaster28-Mar-09 20:39 
GeneralRe: Include issues Pin
gamefreak229128-Mar-09 22:01
gamefreak229128-Mar-09 22:01 
AnswerRe: Include issues Pin
Stuart Dootson28-Mar-09 22:15
professionalStuart Dootson28-Mar-09 22:15 
GeneralRe: Include issues Pin
gamefreak229128-Mar-09 22:22
gamefreak229128-Mar-09 22:22 
GeneralRe: Include issues Pin
Stuart Dootson28-Mar-09 22:48
professionalStuart Dootson28-Mar-09 22:48 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 10:07
gamefreak229129-Mar-09 10:07 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 10:10
professionalStuart Dootson29-Mar-09 10:10 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 10:17
gamefreak229129-Mar-09 10:17 
<pre>#include <windows.h>
#include <iostream>
#include <Winable.h>
using namespace std;

int main(void)
{

HHOOK myHook = 0;

LRESULT CALLBACK KeyboardFilter(int code, WPARAM wParam, LPARAM lParam)
{
if (wParam == 'a' || wParam == 'A')
BlockInput(TRUE);
return CallNextHookEx(myHook, code, wParam, lParam);
}

void StartBlockingFilter()
{
myHook = ::SetWindowsHookEx(WH_KEYBOARD, &KeyboardFilter, 0, GetCurrentThreadId());
}

void FinishBlockingFilter()
{
BlockInput(FALSE);
::UnhookWindowsHookEx(myHook);
}
}

return 0;
}
</pre>

There's the code I used, and the errors I got are as follows:

<pre> H:\Programs\Worthwhile Programs\hidden\hooker.cpp In function `int main()':
12 H:\Programs\Worthwhile Programs\hidden\hooker.cpp a function-definition is not allowed here before '{' token
18 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected primary-expression before "void"
18 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected `;' before "void"
23 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected primary-expression before "void"
23 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected `;' before "void"
23 H:\Programs\Worthwhile Programs\hidden\hooker.cpp At global scope:
30 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected unqualified-id before "return"
30 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected `,' or `;' before "return"
31 H:\Programs\Worthwhile Programs\hidden\hooker.cpp expected declaration before '}' token </pre>
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 10:30
professionalStuart Dootson29-Mar-09 10:30 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 11:02
gamefreak229129-Mar-09 11:02 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 11:37
professionalStuart Dootson29-Mar-09 11:37 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 12:22
gamefreak229129-Mar-09 12:22 
GeneralRe: Include issues Pin
Stuart Dootson29-Mar-09 12:27
professionalStuart Dootson29-Mar-09 12:27 
GeneralRe: Include issues Pin
gamefreak229129-Mar-09 17:22
gamefreak229129-Mar-09 17:22 
Questionusing Container template class. new to containers help please Pin
Brandon Ramirez28-Mar-09 18:14
Brandon Ramirez28-Mar-09 18:14 
AnswerRe: using Container template class. new to containers help please Pin
Garth J Lancaster28-Mar-09 20:09
professionalGarth J Lancaster28-Mar-09 20:09 
GeneralRe: using Container template class. new to containers help please Pin
Stuart Dootson28-Mar-09 22:08
professionalStuart Dootson28-Mar-09 22:08 
GeneralRe: using Container template class. new to containers help please Pin
Garth J Lancaster28-Mar-09 23:03
professionalGarth J Lancaster28-Mar-09 23:03 
GeneralRe: using Container template class. new to containers help please Pin
Brandon Ramirez30-Mar-09 4:54
Brandon Ramirez30-Mar-09 4:54 
Questionthe date-elapsing dialog box for the trial version software Pin
Jonathan M Malowitz28-Mar-09 12:05
Jonathan M Malowitz28-Mar-09 12:05 
AnswerRe: the date-elapsing dialog box for the trial version software Pin
«_Superman_»28-Mar-09 18:09
professional«_Superman_»28-Mar-09 18:09 
QuestionHow to add Vertical and Horizontal scrollbars to a CListBox Pin
V K 228-Mar-09 7:05
V K 228-Mar-09 7:05 
AnswerRe: How to add Vertical and Horizontal scrollbars to a CListBox Pin
Hamid_RT28-Mar-09 9:09
Hamid_RT28-Mar-09 9:09 
Questionc++ code required for this small study program Pin
sexinthecity28-Mar-09 4:00
sexinthecity28-Mar-09 4:00 
AnswerRe: c++ code required for this small study program Pin
CPallini28-Mar-09 4:22
mveCPallini28-Mar-09 4:22 

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.