要实现在DLL中定时发送消息给其他进程,应该如何做呢?

解决方案 »

  1.   

    使用SetTimer的回调函数:::SetTimer(NULL, nID, 1000, YourFunction);
    static YourFunction(UINT nID)
    {
        PostThreadMessage(......);
    }
      

  2.   

    To Carapee(山豆根) :
    好象有点不对哟。。//出错信息
    error C2664: 'SetTimer' : cannot convert parameter 4 from 'int (unsigned int)' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
            None of the functions with this name in scope match the target type//程序
    ::SetTimer(NULL, 100, 3000, teReportStatus);static teReportStatus(UINT nID)
    {
      ::SendMessage(glhWnd, WM_COPYDATA, NULL, (LPARAM)&teMsg);
    }