📄 bcjq070.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
当前位置
:
编程技巧
怎样用代码来最小化或恢复程序
你能够用下面三种方法之一来实现它。
方法一:发送一条Windows消息到主窗口的Handle属性或
Application->Handle。这条消息就是 WM_SYSCOMMAND,将 wParam
设为 SC_MINIMIZE 或 SC_RESTORE。你可以调用SendMessage API函数来发送消息。
// 设置WPARAM为SC_MINIMIZE来最小化窗口
SendMessage(Application->Handle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
// 设置WPARAM为SC_RESTROE来恢复窗口
SendMessage(Application->Handle, WM_SYSCOMMAND, SC_RESTORE, 0);
方法二:调用 ShowWindow API 函数。
你必须传送Application对象句柄到ShowWindow函数。如果你传送给ShowWindow函数的句柄是主窗口,那么主窗口将最小化到桌面(desktop)而不是任务条(taskbar)。
// 最小化:传送 SW_MINIMIZE 到 ShowWindow
ShowWindow(Application->Handle, SW_MINIMIZE);
// 恢复:传送SW_RESTORE 到 ShowWindow
ShowWindow(Application->Handle, SW_RESTORE);
方法三:调用Application对象的Minimize或Restore函数。 //
调用Minimize最小化应用程序
Application->Minimize();
// 调用Restore恢复应用程序
Application->Restore();
调用Application的方法较易用,但发送WM_SYSCOMMAND消息功能更强。
另外,WM_SYSCOMMAND消息允许你最大化程序,改变光标为帮助光标,滚动程序,移动一个窗口,改变窗口大小,甚至模拟Alt-TAB切换到另一窗口。紧记,实现这些功能用API函数更好。
尽管调用ShowWindow也能工作,你大概也不想用它来最小化或恢复程序。当隐藏的窗口被最小化时ShowWindow会引起最小化动画出现。这看上去稍微有点傻,因为动画是从程序主窗口的位置远离中心。
if (ad==1) {document.write(''+'');}
if (ad==2) {document.write(''+'');}
if (ad==3) {document.write(''+'');}
C++ Builder开发者®
2000年06月01日 站长:唐朝