程序最小化时收到请求,如何把自己最大化并提到前边。

解决方案 »

  1.   

    Application.xxxx
    自己看看吧,什么Restore,Maximize,BringToFront,等等。
      

  2.   

    PostMessage(Application.Handle,WM_SYSCOMMAND,SC_MAXIMIZE,0);
        frmMain.SetFocus;
        PostMessage(frmMain.Handle,WM_SYSCOMMAND,SC_MAXIMIZE,0);
        Application.BringToFront;我做了这样的操作,还是不行!
      

  3.   

    sendmessage(application.handle,WM_restore)
      

  4.   

    sendmessage(application.handle,SW_restore)
      

  5.   

    SHOWWINDOW(APPLICATION.Handle,SW_RESTORE);
      

  6.   

    function ForceForegroundWindow(HWND: THandle): BOOL;
    var
      hCurWnd: THandle;
    begin
      hCurWnd := GetForeGroundWindow;
      AttachThreadInput(
        GetWindowThreadProcessID(hCurWnd, nil),
        GetCurrentThreadID,
        True);
      Result := SetForegroundWindow(HWND);
      AttachThreadInput(
        GetWindowThreadProcessID(hCurWnd, nil),
        GetCurrentThreadID,
        False);
    end;procedure BringSelfToFront;
    begin
      if IsIconic(Application.handle) then
        Application.Restore
      else
        ForceForegroundWindow(Application.handle);
    end;