Click here to Skip to main content
15,849,182 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: GetWindowRgn API returns ERROR Pin
Richard MacCutchan11-Mar-14 23:53
mveRichard MacCutchan11-Mar-14 23:53 
AnswerRe: GetWindowRgn API returns ERROR Pin
atm.menon12-Mar-14 16:54
atm.menon12-Mar-14 16:54 
GeneralRe: GetWindowRgn API returns ERROR Pin
Richard MacCutchan12-Mar-14 23:10
mveRichard MacCutchan12-Mar-14 23:10 
QuestionMFC class wizard comment delimiters [Solved] Pin
Theo Buys11-Mar-14 3:12
Theo Buys11-Mar-14 3:12 
AnswerRe: MFC class wizard comment delimiters Pin
Jochen Arndt11-Mar-14 3:33
professionalJochen Arndt11-Mar-14 3:33 
AnswerRe: MFC class wizard comment delimiters Pin
a ray of sunshine14-Mar-14 18:03
a ray of sunshine14-Mar-14 18:03 
QuestionBoost::Log DB backend? Pin
Marco Bertschi11-Mar-14 0:56
protectorMarco Bertschi11-Mar-14 0:56 
QuestionHow to detect touch input globally instead of mouse clicking? Pin
cedricvictor9-Mar-14 17:26
cedricvictor9-Mar-14 17: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 21:13
professional«_Superman_»9-Mar-14 21:13 
QuestionHow do I access / use base class method declared private? Pin
Vaclav_9-Mar-14 14:28
Vaclav_9-Mar-14 14:28 
AnswerRe: How do I access / use base class method declared private? Pin
Richard Andrew x649-Mar-14 18:17
professionalRichard Andrew x649-Mar-14 18:17 
GeneralRe: How do I access / use base class method declared private? Pin
Vaclav_10-Mar-14 2:30
Vaclav_10-Mar-14 2:30 
GeneralRe: How do I access / use base class method declared private? Pin
Freak3010-Mar-14 3:21
Freak3010-Mar-14 3:21 
GeneralRe: How do I access / use base class method declared private? SOLVED Pin
Vaclav_10-Mar-14 11:26
Vaclav_10-Mar-14 11:26 
AnswerRe: How do I access / use base class method declared private? Pin
«_Superman_»10-Mar-14 6:21
professional«_Superman_»10-Mar-14 6:21 
QuestionMDI frame "Window" menu / submenu dynamics - where to start? Pin
Vaclav_9-Mar-14 6:07
Vaclav_9-Mar-14 6:07 
AnswerRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Richard MacCutchan9-Mar-14 9:11
mveRichard MacCutchan9-Mar-14 9:11 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Vaclav_9-Mar-14 14:20
Vaclav_9-Mar-14 14:20 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Richard MacCutchan9-Mar-14 23:16
mveRichard MacCutchan9-Mar-14 23:16 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Vaclav_10-Mar-14 2:35
Vaclav_10-Mar-14 2:35 
GeneralRe: MDI frame "Window" menu / submenu dynamics - where to start? Pin
Richard MacCutchan10-Mar-14 2:53
mveRichard MacCutchan10-Mar-14 2:53 
QuestionCMap efficiency Pin
econy7-Mar-14 6:20
econy7-Mar-14 6:20 
AnswerRe: CMap efficiency Pin
jeron17-Mar-14 6:48
jeron17-Mar-14 6:48 
QuestionRe: CMap efficiency Pin
CPallini9-Mar-14 5:57
mveCPallini9-Mar-14 5:57 
AnswerRe: CMap efficiency Pin
Stefan_Lang12-Mar-14 2:29
Stefan_Lang12-Mar-14 2: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.