关于怎么在本程序中屏蔽鼠标的有关问题,求解答

关于如何在本程序中屏蔽鼠标的问题,求解答
在程序的某个步骤中,需要等待一段时间进行读取与下载,在此期间,我想要令鼠标在该程序内的点击无效,从网上找到全局hook函数,但是使用之后,变成了全局的鼠标不响应,无法细分是否是在该程序内时进行屏蔽,该如何进行解决?
以下是hook的主要代码
C/C++ code

#pragma data_seg("MySec")
HWND g_hWnd = NULL;
#pragma data_seg()
#pragma comment(linker,"/section:MySec,RWS")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
HHOOK g_hMouse = NULL;
HHOOK g_hKeyboard = NULL;
LRESULT CALLBACK MouseProc(int nCode,
                           WPARAM wParam,
                           LPARAM lParam
                           )
{
    return 1;
}
LRESULT CALLBACK KeyboardProc(int code,
                              WPARAM wParam,
                              LPARAM lParam
                              )
{
    if (VK_F2 == wParam)
    {
        SendMessage(g_hWnd,WM_CLOSE,0,0);
        UnhookWindowsHookEx(g_hMouse);
        UnhookWindowsHookEx(g_hKeyboard);
    }
    return 1;
}
void SetHook(HWND hwnd)
{
    g_hWnd = hwnd;
    g_hMouse = SetWindowsHookEx(WH_MOUSE,MouseProc,GetModuleHandle("Hook"),0);
//    g_hKeyboard = SetWindowsHookEx(WH_KEYBOARD,KeyboardProc,GetModuleHandle("Hook"),0);
}
void    StopHook()
{
    if(g_hMouse != NULL)
        UnhookWindowsHookEx(g_hMouse);
    g_hMouse = NULL;
    if(g_hKeyboard!=NULL)
        UnhookWindowsHookEx(g_hKeyboard);
    g_hKeyboard = NULL;
}

然后我在cmainframe中的OnSetCursor中进行使用,同时还定义了一个bool变量用于关闭hook,后来添加了一个鼠标判断是否在区域内的判断函数,但是实际使用下来肯定不对,想问下,如何只屏蔽当前程序,当前区域内的鼠标消息呢。
C/C++ code
BOOL CMainFrame::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
    // TODO: Add your message handler code here and/or call default
    if (m_bBusy)
    {
        if(IsCursorIn())
        {
            SetHook(m_hWnd);
            ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); 
        return TRUE;
        }
        else
        {
            StopHook(); 
            return CMDIFrameWnd::OnSetCursor(pWnd, nHitTest, message);
        }
    }
    else
    {
        StopHook(); 
    }
    return CMDIFrameWnd::OnSetCursor(pWnd, nHitTest, message);
}
bool    CMainFrame::IsCursorIn()
{
    CRect    rect;
    GetWindowRect(rect);
    CPoint    pt;
    GetCursorPos(&pt);
    if (PtInRect(rect,pt))
    {
        return true;
    }
    else
        return false;
}

要实现想要的功能,我想应该还是要在sethook中进行修改吧,但具体该如何修改,传入参数如何使用,对此毫无概念

------解决方案--------------------
又见楼主啊。
BeginWaitCursor()
EndWaitCursor()
------解决方案--------------------
这个可以使屏蔽只在你的程序中起作用 :

HWND hWnd = FindWindow(NULL,L"xxxxx");//xxxx是你的程序窗口名字
DWORD dwT,dwP;
dwT = GetWindowThreadProcessId(hWnd,&dwP);

SetWindowsHookEx(WH_GETMESSAGE,MouseProc,GetModuleHandle("Hook"),dwT);
------解决方案--------------------
是的 ,外挂就是类似于这么做的
------解决方案--------------------
全局hook函数
---------------------
不要安装全局钩子啊,只针对本线程安装