如题,谢谢

解决方案 »

  1.   

    if assigned(form1) then showmessage('窗体是在内存中');
      

  2.   

    if (form1=nil) and (not assigned(form1)) then showmessage('窗体是不在内存中');
      

  3.   

    if FindWindow('窗体名')<>0 then showmessage('窗体在内存中');
      

  4.   

    if FindWindow('窗体标题名','')<>0 then showmessage('窗体在内存中');
      

  5.   

    窗体不在内存中的时候,用assigned(form1) 函数,提示没有定义 form1用这两种方法
    //----------------------------------------------------------
    if FindWindow('窗体名')<>0 then showmessage('窗体在内存中');if FindWindow('窗体标题名','')<>0 then showmessage('窗体在内存中');//-------------------------------------------------------
    编译都提示出错:
    Character constant too long(or empty)
      

  6.   

    if FindWindow('窗体标题名','')<>0 then showmessage('窗体在内存中');
    D7下编译通过啊
      

  7.   

    if FindWindow('YourFormClass','YourFormTitle')<>0 then showmessage('窗体在内存中');
      

  8.   

    FindWindow在windows 单元中,是自动添加引用的。