How to maximize a window in background?

前端 未结 3 617
天命终不由人
天命终不由人 2021-01-26 11:05

I need to maximize a window in background, meaning without activating (focusing) it. SetWindowPlacement function doesn\'t offer this.. Any ideas?

        WINDOWP         


        
3条回答
  •  忘了有多久
    2021-01-26 11:59

    The best way I could find to do this was (VB sorry!);

    longForeHWnd = GetForegroundWindow
    Call ShowWindow(longBackHWnd, SW_SHOWMAXIMIZED)
    SetForegroundWindow (longForeHWnd)
    

    This is only a work-around because the Background Window is (briefly) activated and so gets promoted up the Z-Order

提交回复
热议问题