Delphi窗体全屏(去掉任务栏)(50分)

  • 主题发起人 主题发起人 formiss
  • 开始时间 开始时间
F

formiss

Unregistered / Unconfirmed
GUEST, unregistred user!
Left := 0;<br>&nbsp; Top := 0;<br>&nbsp; Width := Screen.Width;<br>&nbsp; Height := Screen.Height;<br>self.BorderStyle := bsNone;<br>self.WindowState := wsMaximized;<br>&nbsp;可是这样的结果是: 任务栏依旧显示。
 
任务蓝是Windows的,必须隐蚕才行!<br>wnd1:=findwindow(nil,'programman'); // 类是<br>wnd1:=findwindowex(wnd1,0,nil,'shell'); // 类是<br>showwindow(wnd1,sw_hide);
 
{Left := 0;<br>&nbsp; Top := 0;<br>&nbsp; Width := Screen.Width;<br>&nbsp; Height := Screen.Height;}<br>self.BorderStyle := bsNone;<br>self.WindowState := wsMaximized;
 
Form1.Position:=poDesktopCenter;<br>&nbsp; Form1.WindowState:=wsMaximized;<br>&nbsp; Form1.Width:=screen.Width;<br>&nbsp; Form1.Height:=screen.Height;<br>&nbsp; Form1.BorderStyle := bsNone
 
去掉干啥?<br>挡在后面不就行了吗?<br>Self.FormStyle := fsStayontop;
 
普通的用FormStyle := fsStayontop;就OK了<br><br>嘿嘿....我再提供个方法....比较变态的全屏....自己再创建个桌面,把程序扔那个桌面上去运行,这样肯定不会出现任务栏或者其他乱七八糟的东西了<br><br>不过坏处是没办法切换到别的程序.....
 
试试这样:<br>Windows.SetBounds(0,0,Screen.Width,Screen.Height);//也可以按你自己的设置窗体大小<br>SetWindowPos(Self.Handle,HWND_TOPMOST,0,0,Screen.Width,Screen.Height,SWP_SHOWWINDOW);窗体置前
 
在FormCreate事件中写如下语句就可以了 &nbsp; <br>&nbsp; &nbsp; &nbsp;ShowWindow( &nbsp; Application.Handle, &nbsp; SW_HIDE &nbsp; ); &nbsp; <br>&nbsp; SetWindowLong( &nbsp; Application.Handle, &nbsp; GWL_EXSTYLE, &nbsp; GetWindowLong(Application.Handle, &nbsp; &nbsp; GWL_EXSTYLE) &nbsp; or &nbsp; &nbsp;WS_EX_TOOLWINDOW &nbsp; and &nbsp; not &nbsp; WS_EX_APPWINDOW); &nbsp; <br>&nbsp; ShowWindow( &nbsp; Application.Handle, &nbsp; SW_SHOW &nbsp; );
 
呃.....还有 补充下,delphi里设置BorderStyle := bsNone好像有点问题,似乎会重新创建窗口handle<br><br>普通的应用没什么问题,如果遇到一些特殊对象....比如从DLL里引出的OPENGL对象...就会出问题了,我就刚刚遇到这事....麻烦..最后还是用SetWindowLong解决的全屏
 
多人接受答案了。
 
后退
顶部