我想让另一个project包含相应的resource.h。
用GetWindowLong获取地址输出到文件中,在另一个project中读文件再用SetWindowLong设置地址
不知道这两个函数处理的地址是绝对地址还是相对地址?

解决方案 »

  1.   

    都是相对地址,你必须用WriteProcessMemory写过去。The WriteProcessMemory function writes data to an area of memory in a specified process. The entire area to be written to must be accessible, or the operation fails. 
    BOOL WriteProcessMemory(
      HANDLE hProcess,                // handle to process
      LPVOID lpBaseAddress,           // base of memory area
      LPCVOID lpBuffer,               // data buffer
      SIZE_T nSize,                   // count of bytes to write
      SIZE_T * lpNumberOfBytesWritten // count of bytes written
    );
      

  2.   

    用SendMessage发一个自定义的消息和数据过去也是一个办法嘿嘿.
      

  3.   

    这个和工作区没有关系,关键看是不是不同的进程,还是DLL和其宿主进程
      

  4.   

    谢谢大家!
    其中一个是dll工程
    我想把界面工程下的控件handle传给dll用