Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Windows子类回调后的僵尸进程_Windows_Api_Process_Quit_Zombie Process - Fatal编程技术网

使用Windows子类回调后的僵尸进程

使用Windows子类回调后的僵尸进程,windows,api,process,quit,zombie-process,Windows,Api,Process,Quit,Zombie Process,我正在使用Windows API的SetWindowsSubClass(…)方法来将某种“钩子”消息传输到超出我的应用程序范围的WinProc 我的应用程序由内核和DLL中的插件组成 我已经在我的一个插件DLL中实现了这样一个子类 我这样设置子类: class MyPlugin { private: static HWND s_OgrehWnd; UINT_PTR m_uIdSubclass; //The ID of the Subclass WinPr

我正在使用Windows API的SetWindowsSubClass(…)方法来将某种“钩子”消息传输到超出我的应用程序范围的WinProc

我的应用程序由内核和DLL中的插件组成

我已经在我的一个插件DLL中实现了这样一个子类

我这样设置子类:

class MyPlugin 
{
    private:
        static HWND s_OgrehWnd;
        UINT_PTR m_uIdSubclass; //The ID of the Subclass WinProc
        DWORD_PTR m_pdwRefData; 
        //....

    public:
        void MyPlugin::init();
        LRESULT CALLBACK MyPlugin::windowProcSubclass(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,    UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
        void MyPlugin::shutdown();
        //....
};


//Set the subclass
void MyPlugin::init()
{
//...
bool resultsc = SetWindowSubclass(
    s_hWnd,
    MultitouchPlugin::windowProcSubclass,
    m_uIdSubclass,
    m_pdwRefData
    );        
//...
}

//The subclass
LRESULT CALLBACK MyPlugin::windowProcSubclass(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,    UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{ 
    switch(message)
    {
    case WM_GESTURE:
        return MultitouchPlugin::g_cGestureEngine.WndProc(hWnd,wParam,lParam);
        break;
    }
    return DefWindowProc(hWnd, message, wParam, lParam);
}

//Remove the subclass
void MyPlugin::shutdown()
{
    //shutdown called - unregister stuff here
    bool isSublcassed = GetWindowSubclass(s_hWnd, MultitouchPlugin::windowProcSubclass, m_uIdSubclass, &m_pdwRefData);

    if(isSublcassed)
    {
        RemoveWindowSubclass(s_OgrehWnd, MultitouchPlugin::windowProcSubclass, m_uIdSubclass);
    }
}
我的问题是,当我退出应用程序时,我可以在“Windows任务管理器”工具中看到持续运行的进程。 在调试模式下,我检查了它是否调用RemoveWindowsSubClass(),并执行了该操作。 如果我用这段代码删除我的插件,就不会有僵尸进程

有人对这个问题的解决办法有想法吗

谢谢你的帮助