📄 bcjq068.txt
字号:
C++ Builder开发者:程序员之家
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
首页
| 控件天堂 | 控件使用
| 编程技巧
| 源代码 | 编程工具 |
系统补丁 | 电子书籍 | 技术论坛
| 相关链接
if (ad==1) {document.write(''+'');}
if (ad==2) {document.write(''+'');}
if (ad==3) {document.write(''+'');}
var marqueecontents=''+scroll_text+''
if (document.all)
document.write(''+marqueecontents+'')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}
window.onload=regenerate2
当前位置
:
编程技巧
怎样启动一个程序而不显示它
为了启动程序而不显示它,你必须编辑WinMain函数来程序的主窗口和程序的任务条图标。
第一步:从C++Builder菜单中选择 View|Project Source然后开始编辑WinMain函数。调用ShowWindow函数,传递Application->Handle,可以隐藏程序的任务条图标。设置ShowMainForm为False可以让主窗口不在屏幕上显示。
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->ShowMainForm = false;
ShowWindow(Application->Handle, SW_HIDE);
Application->Run();
}
catch (Exception
&exception)
{
Application->ShowException(&exception);
}
return 0;
}
第二步:当你想显示程序时执行下面这两行代码。记住,如果代码定位在主窗口类的一个方法中,Application->MainForm->Visible=true可以用Visible=true
来代替。
ShowWindow(Application->Handle, SW_SHOW);
Application->MainForm->Visible = true;
if (ad==1) {document.write(''+'');}
if (ad==2) {document.write(''+'');}
if (ad==3) {document.write(''+'');}
C++ Builder开发者®
2000年06月01日 站长:唐朝