问题, 怎么在主窗口中点击时判断, DLL中的MIDI窗口已存在?用 FindWIndow 判断不了, 用Screen.Forms[i]也找不到,  MDIChildren[i]这个也找不到 

解决方案 »

  1.   

     for iLoop := 0 to sys_main_f.MDIChildCount-1 do
      begin
        if UpperCase(主窗體.MDIChildren[iLoop].ClassName)=UpperCase(MIDI窗體名) then
        begin
          inc(iCount);
          aHandle := 主窗體.MDIChildren[iLoop].Handle;
          SendMessage(aHandle,WM_SYSCOMMAND,SC_MAXIMIZE,0);
          Break;
        end;
      end;
     if iCount=0 then
     begin
       沒找到
     end
     else
     begin
      找到了
     end
      

  2.   

    不行的, midi子窗口是在dll里面的, 在主窗口用 MDIChildren找不到,试过了. 我上面写着了, 那几种方面都找不到
      

  3.   

    这个是个老问题了,传参数的时候如果把scrren也传进去,让dll用app的scrren,
    MDIChildCount和MDIChildren[i]就可以使用了。但是会出现can not assign a tfont to a tfont的问题。
      

  4.   

    参考:http://hi.baidu.com/jangill/blog/item/7d269862e6d94adae6113abc.html原来记得曾有高手说修改tfont的assign,做深度拷贝……具体没弄过~~