主窗口showModa了A窗口,A窗口showModa了B窗口,B窗口showModa了C窗口,C窗口showModa了D窗口
其中C和D设置了fsOnStayup,
现在出了个问题,D窗口中,showMessage跑到D窗口的后面去了,看不到了

解决方案 »

  1.   

    用MessageBox,他的第一个参数,是窗口句柄,设置成窗口D的句柄就可以了
      

  2.   


    用windows单元的MessageBox,原型如下
    int MessageBox(    HWND hWnd, // handle of owner window
        LPCTSTR lpText, // address of text in message box
        LPCTSTR lpCaption, // address of title of message box  
        UINT uType  // style of message box
       );hWnd:所属窗体句柄 
      

  3.   

    别用ShowMessage,换成MessageBox,显示还好看!
    如:MessageBox(HANDLE, '显示D信息!', '信息提示', MB_ICONINFORMATION + MB_OK);
      

  4.   

    谢谢,我研究一下。那Application.MessageBox,为什么没有handle参数呢?
      

  5.   

    而且D窗口如果showmodal一个没有设置成fsStayOnTop的窗口,这个窗口也跑后面去了
      

  6.   

    他是有handle的,只不过指定了Application,因此也就指定了Handle
    看看源码你就知道怎么回事了。
      

  7.   

    把所有窗体都设置成normal的,不要fsStayOnTop,然后提示框用MessageBox
      

  8.   

    建议用MessageBox(HANDLE, '信息!', '提示', MB_ICONINFORMATION + MB_OK);可以直接使用句柄!
      

  9.   

    MessageBox(Handle, '提示信息', '标题', $40);
      

  10.   

    Form8.showModal,这个Form8.showModal,是否有办法传窗口句柄呢?
    现在Form7设置为nomal,fsStayOnTop,Form8.showModal后,这个Form8跑后面去了。是否有一个像MessegeBox那样的窗口句柄参数呢?这样就可以不跑后面去了