就像windows的信使服务那种,不管你在干什么,他都会弹到最前台,哪位大侠指教

解决方案 »

  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);
    就会在最前面了
      

  2.   

    是不是要在uses里加点东西?而且你这个返回的是一个整数呀,不能不返回值么?
      

  3.   

    form1必需是Show出来的
    设置以下属性就可以了
    form1.formstyte := fsStayOntop;
      

  4.   

    begin
     BringWindowToTop(YourMainForm.handle);
     SetForegroundWindow(YourMainForm.handle);
    end;
      

  5.   

    可以设置
    MainForm的FormStyle:=fsStayOnTop呀