Ejemplo n.º 1
0
 /// <summary>
 /// 初始化通知和内存共享文件
 /// </summary>
 private void Init(bool read)
 {
     memoryFile = MemoryMappedFileHelper.CreateMemoryMappedFileObj(processKey + MemoryMappedFileNameTag);
     eventWait  = EventWaitHandleHelper.CreateEventHande(processKey + EventWaitNameTag, false);
     if (read)
     {
         Task.Factory.StartNew(WaitForMessage);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 将当前主窗口 句柄写入到进程内存,方便激活
 /// </summary>
 /// <param name="processKey"></param>
 /// <param name="windowHandel"></param>
 public static void WriteHandel(string processKey, IntPtr windowHandel)
 {
     fileMapped = MemoryMappedFileHelper.CreateMemoryMappedFileObj(processKey + handelTag);
     fileMapped.WriteData(windowHandel.ToString());
 }