Click here to Skip to main content
15,888,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: GetWindowRgn API returns ERROR Pin
Richard MacCutchan11-Mar-14 22:53
mveRichard MacCutchan11-Mar-14 22:53 
AnswerRe: GetWindowRgn API returns ERROR Pin
atm.menon12-Mar-14 15:54
atm.menon12-Mar-14 15:54 
GeneralRe: GetWindowRgn API returns ERROR Pin
Richard MacCutchan12-Mar-14 22:10
mveRichard MacCutchan12-Mar-14 22:10 
QuestionMFC class wizard comment delimiters [Solved] Pin
Theo Buys11-Mar-14 2:12
Theo Buys11-Mar-14 2:12 
AnswerRe: MFC class wizard comment delimiters Pin
Jochen Arndt11-Mar-14 2:33
professionalJochen Arndt11-Mar-14 2:33 
AnswerRe: MFC class wizard comment delimiters Pin
a ray of sunshine14-Mar-14 17:03
a ray of sunshine14-Mar-14 17:03 
QuestionBoost::Log DB backend? Pin
Marco Bertschi10-Mar-14 23:56
protectorMarco Bertschi10-Mar-14 23:56 
QuestionHow to detect touch input globally instead of mouse clicking? Pin
cedricvictor9-Mar-14 16:26
cedricvictor9-Mar-14 16:26 
C++

Dear all:

I try to use hook to detect touch input globally. I using WH_CALLWNDPROC of hook to detect and write in dll. I use hook like this

C++
g_hInstance = AfxGetInstanceHandle();

g_hPreviousHook = SetWindowsHookEx(WH_CALLWNDPROC, &CallWndProc,g_hInstance, 0);


and in my CallWndProc process

C++
LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
{
    if(0 > nCode)
        return CallNextHookEx(g_hPreviousHook, nCode,  
        wParam, lParam);

    PMSG msg = (PMSG) lParam;
    UINT32 pointerId = GET_POINTERID_WPARAM(wParam);  
    POINTER_INPUT_TYPE pointerType;  
    //GetPointerType(pointerId, &pointerType);
    return CallNextHookEx(g_hPreviousHook, nCode, wParam,
    lParam);
}


when I add the GetPointerType(pointerId, &pointerType) into the code and debug, it will load the dll failed and occur debug assert failed, and jump into appmodul.cpp.Jump into


C++
extern int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, int nCmdShow);

extern "C" int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,_In_ LPTSTR lpCmdLine, int nCmdShow)
#pragma warning(suppress: 4985)
{
    // call shared/exported WinMain
    return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}


when I disable GetPointerType(pointerId, &pointerType)
, the application work fine. I don't know what happen,
Does anybody try to use this or know why?


Thank for your help, Victor

modified 10-Mar-14 21:54pm.

AnswerRe: How to detect touch input globally instead of mouse clicking? Pin
«_Superman_»9-Mar-14 20:13
professional«_Superman_»9-Mar-14 20:13 
QuestionHow do I access / use base class method declared private? Pin
Vaclav_9-Mar-14 13:28
Vaclav_9-Mar-14 13:28 
AnswerRe: How do I access / use base class method declared private? Pin
Richard Andrew x649-Mar-14 17:17
professionalRichard Andrew x649-Mar-14 17:17 
GeneralRe: How do I access / use base class method declared private? Pin
Vaclav_10-Mar-14 1:30
Vaclav_10-Mar-14 1:30 
GeneralRe: How do I access / use base class method declared private? Pin
Freak3010-Mar-14 2:21
Freak3010-Mar-14 2:21 
GeneralRe: How do I access / use base class method declared private? SOLVED Pin
Vaclav_10-Mar-14 10:26
Vaclav_10-Mar-14 10:26 
AnswerRe: How do I access / use base class method declared private? Pin
«_Superman_»10-Mar-14 5:21
professional«_Superman_»10-Mar-14 5:21 
QuestionMDI frame "Window" menu / submenu dynamics - where to start? Pin
Vaclav_9-Mar-14 5:07
Vaclav_9-Mar-14 5:07 
AnswerRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Richard MacCutchan9-Mar-14 8:11
mveRichard MacCutchan9-Mar-14 8:11 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Vaclav_9-Mar-14 13:20
Vaclav_9-Mar-14 13:20 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Richard MacCutchan9-Mar-14 22:16
mveRichard MacCutchan9-Mar-14 22:16 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Vaclav_10-Mar-14 1:35
Vaclav_10-Mar-14 1:35 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Richard MacCutchan10-Mar-14 1:53
mveRichard MacCutchan10-Mar-14 1:53 
QuestionCMap efficiency Pin
econy7-Mar-14 5:20
econy7-Mar-14 5:20 
AnswerRe: CMap efficiency Pin
jeron17-Mar-14 5:48
jeron17-Mar-14 5:48 
QuestionRe: CMap efficiency Pin
CPallini9-Mar-14 4:57
mveCPallini9-Mar-14 4:57 
AnswerRe: CMap efficiency Pin
Stefan_Lang12-Mar-14 1:29
Stefan_Lang12-Mar-14 1:29 

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.