1 回答
TA贡献1829条经验 获得超7个赞
private static Rectangle winRectangle = new Rectangle();
public static bool SetFullScreen(bool fullscreen)
{
int Hwnd = 0;
Hwnd = CEBase.CommonApi.FindWindow("HHTaskBar", null);
if (Hwnd == 0) return false;
if (fullscreen)
{
CommonApi.ShowWindow(Hwnd, CommonApi.SW_HIDE);
Rectangle rectFull = Screen.PrimaryScreen.Bounds;
CommonApi.SystemParametersInfo(CommonApi.SPI_GETWORKAREA, 0, ref winRectangle, CommonApi.SPIF_UPDATEINIFILE);//get
CommonApi.SystemParametersInfo(CommonApi.SPI_SETWORKAREA, 0, ref rectFull, CommonApi.SPIF_UPDATEINIFILE);//set
}
else
{
CommonApi.ShowWindow(Hwnd, CommonApi.SW_SHOW);
CommonApi.SystemParametersInfo(CommonApi.SPI_SETWORKAREA, 0, ref winRectangle, CommonApi.SPIF_UPDATEINIFILE);
}
return true;
}
- 1 回答
- 0 关注
- 727 浏览
添加回答
举报