在dpr文件里的

解决方案 »

  1.   

    自己写代码
    function SetSysFocus(hwnd: integer): integer;
    var
      hOtherWin,OtherTHreadID,hFocusWin:integer;
    begin
      hOtherWin:=GetForegroundWindow;
      OtherThreadID:=GetWindowThreadProcessID(hOtherWin,nil);
      if AttachThreadInput(GetcurrentThreadID,OtherThreadID,True) then
      begin
        hFocusWin:=GetFocus;
        windows.SetFocus(hwnd);
        //SendMessage(hwnd,WM_COPY,0,0);
        if hFocusWin<>0 then
        try
          //SendMessage(GetFocus,WM_COPY,0,0);
        finally
          AttachThreadInput(GetCurrentTHreadID,OtherTHreadID,False);
        end;
      end
      else result:=Windows.SetFocus(hwnd);
    end;
    这样用SetSysFocus(Application.Handle);
    然后再messageBox就会在最前面了
      

  2.   

    自已再畫一個From不就行了,用From來做對話框....
      

  3.   

    From的FromStyle屬性設為fsStayOnTop
      

  4.   

    Messagebox(handle,'hello world','test',MB_OK or MB_TOPMOST);
      

  5.   

    哥们用application.messagebox就可以了
      

  6.   

    有时候是这样,我认为是windows的bug
      

  7.   

    这要是你用的是那个窗体的句柄,handle是那个窗体的,messagebox就在那个窗体的上面
      

  8.   

    用Screen.AcitveForm.Handle做句柄就可以了。
      

  9.   

    Application.Messagebox用法和Messagebox一样,但却不是API函数,可以保持在最前面的。