ScrollWindow函数的作用是什么?

c_word 2003-06-25 03:19:25
想知道ScrollWindow函数的具体作用是什么?其中5个参数里int XAmount, int YAmount CONST RECT *lpRect, CONST RECT *lpClipRect 这4个参数的具体作用是什么?MSDN里的解释不太看的懂~~请高手指教!最好也能随便解释一下ScrollWindowEx
...全文
163 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
c_word 2003-06-25
  • 打赏
  • 举报
回复
也就是说XAmount ,YAmount ,lpRect RECT指定的滚动范围是在lpClipRect RECT里了?
xufeiyunwindows 2003-06-25
  • 打赏
  • 举报
回复
查MSDN吧
feiniaoliang 2003-06-25
  • 打赏
  • 举报
回复 1
ScrollWindow函数的具体作用:滚动窗口客户区的全部或一部分
hWnd ,待滚动窗口的句柄
XAmount ,水平滚动的距离。正值向右滚动,负值向左滚动
YAmount ,垂直滚动的距离。正值向下滚动,负值向上滚动
lpRect RECT,用客户区坐标表示的一个矩形,它定义了客户区要滚动的一个部分。如设
为NULL,则滚动整个客户区。在NULL的情况下,子窗口和控件的位置也会随同任何无效区
域移动。否则,子窗口和无效区域不会一起移动。因此,在滚动之前,如指定了lpRect,
一个明智的做法是先调用UpdateWindow函数
lpClipRect RECT,指定剪切区域。只有这个矩形的区域才可能滚动。该矩形优先于
lpRect。可设为NULL

ScrollWindowEx :根据附加的选项,滚动窗口客户区的全部或部分

hwnd Long,欲滚动的窗口的句柄
dx ,水平滚动的距离。正值向右滚动,负值向左滚动
dy ,垂直滚动的距离。正值向下滚动,负值向上滚动
lprcScroll RECT,用客户区坐标表示的一个矩形,它定义了客户区要滚动的一个部分。
如设为零,则滚动整个客户区
lprcClip RECT,指定一个剪切矩形。只有这个矩形的内容才可能滚动。该矩形优先于
lpRect。可能为零,表示不进行剪切处理(原文:Clipping rectangle. Only the area
within this rectangle may be scrolled. This rectangle takes priority over
lpRect. May be zero, in which case no clipping takes place.)
hrgnUpdate Long,滚动过程中随同无效区域载入的一个“区”。可能是零
lprcUpdate RECT,随同一个矩形载入的矩形结构,该矩形定义了滚动过程中无效的区域
。可能是零
fuScroll Long,对滚动进行控制的旗标。可以是下述任何常数的组合
SW_ERASE 清除新无效区域的背景
SW_INVALDATE 使滚动时未覆盖的区域无效
SW_SCROLLCHILDREN 滚动区域内的子窗口进行等量移动。为避免得到无效的结果,在使用
这个函数的时候,请确定子窗口或控件要么完全在滚动区域中,要么完全在滚动区域外

API之网络函数1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnection 结束一个网络连接 WNetCancelConnection2 结束一个网络连接 WNetCloseEnum 结束一次枚举操作 WNetConnectionDialog 启动一个标准对话框,以便建立同网络资源的连接 WNetDisconnectDialog 启动一个标准对话框,以便断开同网络资源的连接 WNetEnumResource 枚举网络资源 WNetGetConnection 获取本地或已连接的一个资源的网络名称 WNetGetLastError 获取网络错误的扩展错误信息 WNetGetUniversalName 获取网络中一个文件的远程名称以及/或者UNC(统一命名规范)名称 WNetGetUser 获取一个网络资源用以连接的名字 WNetOpenEnum 启动对网络资源进行枚举的过程 2. API之消息函数 BroadcastSystemMessage 将一条系统消息广播给系统中所有的顶级窗口 GetMessagePos 取得消息队列中上一条消息处理完毕时的鼠标指针屏幕位置 GetMessageTime 取得消息队列中上一条消息处理完毕时的时间 PostMessage 将一条消息投递到指定窗口的消息队列 PostThreadMessage 将一条消息投递给应用程序 RegisterWindowMessage 获取分配给一个字串标识符的消息编号 ReplyMessage 答复一个消息 SendMessage 调用一个窗口的窗口函数,将一条消息发给那个窗口 SendMessageCallback 将一条消息发给窗口 SendMessageTimeout 向窗口发送一条消息 SendNotifyMessage 向窗口发送一条消息 3. API之文件处理函数 CloseHandle 关闭一个内核对象。其中包括文件、文件映射、进程、线程、安全和同步对象等 CompareFileTime 对比两个文件的时间 CopyFile 复制文件 CreateDirectory 创建一个新目录 CreateFile 打开和创建文件、管道、邮槽、通信服务、设备以及控制台 CreateFileMapping 创建一个新的文件映射对象 DeleteFile 删除指定文件 DeviceIoControl 对设备执行指定的操作 DosDateTimeToFileTime 将DOS日期和时间值转换成一个 win32 FILETIME 值 FileTimeToDosDateTime 将一个 win32 FILETIME 值转换成DOS日期和时间值 FileTimeToLocalFileTime 将一个FILETIME结构转换成本地时间 FileTimeToSystemTime 根据一个FILETIME结构的内容,装载一个SYSTEMTIME结构 FindClose 关闭由FindFirstFile函数创建的一个搜索句柄 FindFirstFile 根据文件名查找文件 FindNextFile 根据调用FindFirstFile函数时指定的一个文件名查找下一个文件 FlushFileBuffers 针对指定的文件句柄,刷新内部文件缓冲区 FlushViewOfFile 将写入文件映射缓冲区的所有数据都刷新到磁盘 GetBinaryType 判断文件是否可以执行 GetCompressedFileSize 判断一个压缩文件在磁盘上实际占据的字节数 GetCurrentDirectory 在一个缓冲区中装载当前目录 GetDiskFreeSpace 获取与一个磁盘的组织有关的信息,以及了解剩余空间的容量 GetDiskFreeSpaceEx 获取与一个磁盘的组织以及剩余空间容量有关的信息 GetDriveType 判断一个磁盘驱动器的类型 GetExpandedName 取得一个压缩文件的全名 GetFileAttributes 判断指定文件的属性 GetFileInformationByHandle 这个函数提供了获取文件信息的一种机制 GetFileSize 判断文件长度 GetFileTime 取得指定文件的时间信息 GetFileType 在给出文件句柄的前提下,判断文件类型 GetFileVersionInfo 从支持版本标记的一个模块里获取文件版本信息
WINAPI,WinAPI手册,最全的WINAPI函数手册,WINAPI开发必备 目录 1 内容简介 14 前言 14 第一章 Win32 API概论 14 为什么使用 Wiu32 API 14 Win32 API 简介 15 第二章 窗口管理函数 16 第一节 易用特性函数(Accessibility Features) 20 SoundSentryProc 20 SystemParametersinfo 21 第二节 按钮函数(Button) 34 CheckDlgButton 34 CheckRadioButton 34 IsDlgButtonChecked 35 第三节 插入标记(^)函数(Caret) 36 CreateCaret 36 DestroyCaret 37 GetCaretBlinkTime 37 GetCaretPos 38 HideCaret 38 SetCaretBlinkTime 39 SetCaretPos 39 ShowCaret 40 第四节 组合框函数(Combo box) 40 CCHookProc 40 CFHookProc 42 ChooseColor 43 ChooseFont 44 CommDlgExtendedEorror 45 DlgDirListComboBox 47 DlgDirSelectEx 49 DlgDirSelectComboBoxEx 50 FindText 50 FRHookProc 51 GetFileTitle 52 GetOpenFileName 53 GetSaveFileName 54 OFNGookProc 54 OFNHookProcOldStyle 56 PagePaintHook 57 PageSetupDlg 58 pageSetupHook 58 PrintDlg 59 PrintdlgEx 60 PrintHookProc 61 ReplaceText 62 SetupHookProc 63 第五节 标函数(Cursor) 64 ClipCursor 64 CopyCursor 65 CreateCursor 65 DestroyCursor 66 GetClipCursor 67 GetCursor 67 GetCursorpos 67 LoadCursorFromFile 68 SetCursor 68 SetCursorPos 69 SetSystemCursor 69 ShowCursor 70 LoadCursor 71 第六节 对话框函数(Dialog Box) 72 CreateDialog 72 CreateDialoglndirect 73 CreateDialoglndirectParam 74 CreateDialogParam 76 DefDlgProc 77 DialogBox 78 DialogBoxlndirect 79 DialogBoxlndirectParam 80 DialogBoxParam 81 DialogProc 82 EndDialog 83 GetDialogBaseUnits 83 GetDigCtrllD 84 GetDigltem 85 GetDlgltemlnt 85 GetDlgltemText 86 GetNextDlgGroupltem 87 GetNexTDlgTabltem 88 IsDialogMessage 88 MapDialogRect 89 MessageBox 90 MessageBoxEx 93 SendDlgltemMessage 94 SetDlgltemlnt 95 SetDlgltemText 95 MessageBoxlndirect 96 第七节 编辑控制函数(Edit Control) 97 EditWordBreakproc 97 第八节 图标函数(Icon) 98 Copylcon 98 Createlcon 99 CreatelconFromResource 100 CreatelconFromResourceEx 101 Destroylcon 102 Create_cpm_mdorect_ZIWe 102 Drawlcon 103 DrawlconEx 104 ExtractAssociatedlcon 105 Extractlcon 106 ExtractlconEx 106 Getlconlnfo 107 LookuplconldFromDirectory 108 LookuplconldFrom 109 Loadlcon 110 第九节 键盘加速器函数(Keyboard Accelerator) 110 CopyAcceleratorTable 111 CreateAcceleratorTable 111 DestroyAcceleratorTable 112 LoadAccelerators 112 TranslateAccelerator 113 第十节 键盘输入函数(Keyboard Input) 114 ActivateKeyboadLayout 114 EnableWindow 115 GetActiveWindows 116 GetAsyncKeyState 116 GetFocus 117 GetKBCodePage 118 GetKeyboardLayout 118 GetKeyboardLayoutList 118 GetKeyboardLayoutName 119 GetKeyboardState 119 GetKeyNameText 120 GetKeyState 121 IsWindowEnabled 122 keybd_event 122 LoadKeyboardLayout 123 MapVirtualKey 124 MapVlrtualKeyEx 126 OemKeyScan 126 RegisterHotKey 127 SetActiveWindow 128 SetFocus 129 SetKeyboardState 130 ToAscii 130 ToAsciiCxToAsciiCx 131 ToUnicode 132 ToUnicodeEx 133 UnloadKeyboardL 134 UnreglsterHotKey 134 VkKeyScan 135 vkKeyScanEx 136 第十一节 列表框函数(List boX) 136 DlgDirList 136 DlgDirSelectEx(2) 137 第十二节 菜单函数(Menu) 138 CheckMenuRadlol 138 CreateMenu 139 CreatePopupMenu 140 DeleteMenu 140 DestroyMenu 141 DrawMenuBar 141 EnableMenultem 142 GetMenu 143 GetMenuDefaultltem 143 GetMenultemlD 144 GetMenultemlnfo 144 GetMenultemRect 145 getSubMenu 145 GetSystemMenu 146 HlllteMenultem 147 InsertMenultem 147 IsMenu 148 LoadMenu 149 LoadMenulndirect 149 MenultemFromPo 150 RemoveMenu 150 SetMenu 151 SetMenuDefaultltem 151 SetMenultemBitm 152 SetMenultemlnfo 153 TrackPopupMenu 154 TrackPopupMenuEx 155 AppendMenu 156 CheckMenultem 159 GetMenuCheckMarkDimensions 159 GetMenuState 160 GetMenuString 161 InsertMenu 161 ModifyMenu 163 第十三节 消息和消息总队列函数(Message and Message Queue) 165 BroadcastSystemMessage 165 DispatchMessage 166 GetlnputState 167 GetMessage 167 GetMessageExtralnfo 168 GetMessagePos 168 GetMessageTime 169 GetQueueStatus 170 InSendMessage 171 InSendMessageEx 171 PeekMessage 172 PostMessage 173 PostQuitMessage 174 PostThreadMessage 175 RegisterWindowsMessage 176 ReplyMessage 176 SendAsyncProc 177 SendMessage 178 SendMessageCallback 178 SendMessageTImeout 179 SendNotifyMessage 181 SendMessageExtralnfo 181 TranslateMessage 182 WaltMessage 183 PostAppMessage 183 SetMessageQueue 183 第十四节 鼠标输入函数(Mouse Input) 183 DragDetect 183 GetCapture 184 GetDoubleCllckTime 184 GetMouseMovePoints 185 mouse_event 186 ReleaseCapture 188 SetCapture 188 SetDoubleCllckTime 189 SwapMouseButton 189 TrackMouseEvent 190 第十五节 多文档接口函数(Multiple Document Interface) 191 CreateMDIWindow 191 DefFrameProc 192 DefMDIChildProc 193 TranslateMdISysAccel 194 第十六节 资源函数(Resource) 195 BeginUpdateResource 195 CopyImage 195 EndUpdateResource 197 EnumResLangProc 197 EnumResNameProc 198 EnumResourceLanguages 199 EnumResourceNames 200 EnumResourceTypes 200 EnumResTypeProc 201 FlndResource 202 FindResourceEx 203 LoadImage 204 LoadResource 206 LockResource 207 SlzeofResource 207 UpdateResource 208 FreeResource 209 UnlockResource 209 第十七节 滚动条函数Scroll Bar) 209 EnableScrollBar 209 GetScrolllnfo 210 ScrollDC 211 ScrollWindowEx 212 SetScrolllnfo 214 ShowScrollBar 215 GetScrollPos 215 GetScrollRange 216 ScrollWindow 217 SetScrollPos 218 SetScrollRange 219 第十八节 窗口函数Window) 220 AdlustWindowRect 220 AdjustWindowRectEx 221 AnImateWindow 222 ArrangelconlcWindows 223 BeginDeferWindowPos 223 BromgWindowToTop 224 CascadeWindows 225 ChildWindowFromaPoint 225 ChildWindowFromaPointEx 226 CloseWindow 227 Create Window 227 CreateWindowEx 233 DeferWindowPos 235 DestroyWindow 238 EnableWindow 238 EndDeferWindowPos 239 EnumChildProc 240 EnumTreadWindows 240 EnumThreadWndProc 241 EnumWindows 241 EnumWindowsProc 242 FindWindow 243 FlndWindowEx 243 GetClientRect 244 GetDesktopWindow 244 GetForegroundWindow 245 GetLastActivePopup 245 GetNextWindow 246 GetParent 246 GetTopWindow 247 GetWindow 247 GetWindowPlacement 248 GetWindowRect 249 GetWindowText 249 IsChild 250 GetWindowTextLength 251 GetWlndowThreadprocessld 251 IsIconic 252 IsWindow 252 IsWindowUnicode 253 IsWindowVlslble 253 IsZoomed 254 MoveWindow 254 Openlcon 255 SetForegroundWindow 255 SetParent 256 SetWindowLong 256 SetWindowPlacement 259 SetWindowPos 260 SetWindowText 263 ShowOwnedPopups 263 ShowWindow 264 ShowWindowAsync 265 TileWindows 266 WindowFromPoint 267 WinMain 267 AnyPopup 269 EnumTaskWindows 269 GetSysModalWindow 269 GetWindowTask 269 SetSysModalWindow 269 第十九节 窗口类函数Window Class) 270 GetClasslnfoEx 270 GetClassLong 270 GetClassName 271 GetWindowLong 272 RegisterClassEx 273 SetClassLong 274 SetWindowLong 275 GetClasslnfoEx 278 GetClassWord 279 GetWindowWord 279 RegisterClass 279 SetClassWord 280 SetWindowWord 281 第二十节 窗口过程函数Window Procedure) 281 CallWindowProc 281 DefWindowProc 282 WindowProc 283 第二十一节 窗口属性函数Window Property) 284 EnumProps 284 EnumPropsEx 284 GetProp 285 PropEnumProcEx 285 RemoveProp 286 SetProp 287
Javascript小技巧一箩筐 事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture(); event.srcElement.releaseCapture(); 事件按键 event.keyCode event.shiftKey event.altKey event.ctrlKey 事件返回值 event.returnValue 鼠标位置 event.x event.y 窗体活动元素 document.activeElement 绑定事件 document.captureEvents(Event.KEYDOWN); 访问窗体元素 document.all("txt").focus(); document.all("txt").select(); 窗体命令 document.execCommand 窗体COOKIE document.cookie 菜单事件 document.oncontextmenu 创建元素 document.createElement("SPAN"); 根据鼠标获得元素: document.elementFromPoint(event.x,event.y).tagName=="TD document.elementFromPoint(event.x,event.y).appendChild(ms) 窗体图片 document.images[索引] 窗体事件绑定 document.onmousedown=scrollwindow; 元素 document.窗体.elements[索引] 对象绑定事件 document.all.xxx.detachEvent("onclick",a); 插件数目 navigator.plugins 取变量类型 typeof($js_libpath) == "undefined" 下拉框 下拉框.options[索引] 下拉框.options.length 查找对象 document.getElementsByName("r1"); document.getElementById(id); 定时 timer=setInterval("scrollwindow()",delay); clearInterval(timer); UNCODE编码 escape() ,unescape 父对象 obj.parentElement(dhtml) obj.parentNode(dom) 交换表的行 TableID.moveRow(2,1) 替换CSS document.all.csss.href = "a.css"; 并排显示 display:inline 隐藏焦点 hidefocus=true 根据宽度换行 style="word-break:break-all" 自动刷新 简单邮件 快速转到位置 obj.scrollIntoView(true) 锚 anchors 网页传递参数 location.search(); 可编辑 obj.contenteditable=true 执行菜单命令 obj.execCommand 双字节字符 /[^x00-xff]/ 汉字 /[u4e00-u9fa5]/ 让英文字符串超出表格宽度自动换行 word-wrap: break-word; word-break: break-all; 透明背景 获得style内容 obj.style.cssText HTML标签 document.documentElement.innerHTML 第一个style标签 document.styleSheets[0] style标签里的第一个样式 document.styleSheets[0].rules[0] 防止点击空链接时,页面往往重置到页首端。 word 上一网页源 asp: request.servervariables("HTTP_REFERER") javascript: document.referrer 释放内存 CollectGarbage(); 禁止右键 document.oncontextmenu = function() { return false;} 禁止保存 地址栏图标 favicon.ico 名字最好不变16*16的16色,放虚拟目录根目录下 收藏栏图标 查看源码 关闭输入法 自动全选 ENTER键可以让光标移到下一个输入框 文本框的默认值 title换行 obj.title = "123 sdfs " 获得时间所代表的微秒 var n1 = new Date("2004-10-10".replace(/-/g, "/")).getTime() 窗口是否关闭 win.closed checkbox扁平
获取选中内容 document.selection.createRange().duplicate().text 自动完成功能 打开该功能 关闭该功能 窗口最大化 无关闭按钮IE window.open("aa.htm", "meizz", "fullscreen=7"); 统一编码/解码 alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= hehe"))) encodeURIComponent对":"、"/"、";" 和 "?"也编码 表格行指示 //各种尺寸 s += " 网页可见区域宽:"+ document.body.clientWidth; s += " 网页可见区域高:"+ document.body.clientHeight; s += " 网页可见区域高:"+ document.body.offsetWeight +" (包括边线的宽)"; s += " 网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽)"; s += " 网页正文全文宽:"+ document.body.scrollWidth; s += " 网页正文全文高:"+ document.body.scrollHeight; s += " 网页被卷去的高:"+ document.body.scrollTop; s += " 网页被卷去的左:"+ document.body.scrollLeft; s += " 网页正文部分上:"+ window.screenTop; s += " 网页正文部分左:"+ window.screenLeft; s += " 屏幕分辨率的高:"+ window.screen.height; s += " 屏幕分辨率的宽:"+ window.screen.width; s += " 屏幕可用工作区高度:"+ window.screen.availHeight; s += " 屏幕可用工作区宽度:"+ window.screen.availWidth; //过滤数字 //特殊用途 //不缓存 //正则匹配匹配中文字符的正则表达式: [u4e00-u9fa5] 匹配双字节字符(包括汉字在内):[^x00-xff] 匹配空行的正则表达式: [s| ]* 匹配HTML标记的正则表达式:/<(.*)>.*|<(.*) />/ 匹配首尾空格的正则表达式:(^s*)|(s*$)(像vbscript那样的trim函数) 匹配Email地址的正则表达式:w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)* 匹配网址URL的正则表达式:http://([w-]+.)+[w-]+(/[w- ./?%&=]*)? 以下是例子: 利用正则表达式限制网页表单里的文本框输入内容: 用正则表达式限制只能输入中文:onkeyup="value=value.replace(/[^u4E00-u9FA5]/g,"")" onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^u4E00-u9FA5]/g,""))" 1.用正则表达式限制只能输入全角字符: onkeyup="value=value.replace(/[^uFF00-uFFFF]/g,"")" onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^uFF00-uFFFF]/g,""))" 2.用正则表达式限制只能输入数字:onkeyup="value=value.replace(/[^d]/g,"") "onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^d]/g,""))" 3.用正则表达式限制只能输入数字和英文:onkeyup="value=value.replace(/[W]/g,"") "onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^d]/g,""))" //消除图像工具栏 or //无提示关闭 function Close() { var ua=navigator.userAgent var ie=navigator.appName=="Microsoft Internet Explorer"?true:false if(ie) { var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE ")))) if(IEversion< 5.5) { var str = "" str += ""; document.body.insertAdjacentHTML("beforeEnd", str); document.all.noTipClose.Click(); } else { window.opener =null; window.close(); } } else { window.close() } } //取得控件得绝对位置(1) <script language="javascript"> function getoffset(e) { var t=e.offsetTop; var l=e.offsetLeft; while(e=e.offsetParent) { t+=e.offsetTop; l+=e.offsetLeft; } var rec = new Array(1); rec[0] = t; rec[1] = l; return rec } //光标停在文字最后 <script language="javascript"> function cc() { var e = event.srcElement; var r =e.createTextRange(); r.moveStart("character",e.value.length); r.collapse(true); r.select(); } //页面进入和退出的特效 进入页面 推出页面 这个是页面被载入和调出时的一些特效。duration表示特效的持续时间,以秒为单位。transition表示使 用哪种特效,取值为1-23:   0 矩形缩小   1 矩形扩大   2 圆形缩小   3 圆形扩大   4 下到上刷新   5 上到下刷新   6 左到右刷新   7 右到左刷新   8 竖百叶窗   9 横百叶窗   10 错位横百叶窗   11 错位竖百叶窗   12 点扩散   13 左右到中间刷新   14 中间到左右刷新   15 中间到上下   16 上下到中间   17 右下到左上   18 右上到左下   19 左上到右下   20 左下到右上   21 横条   22 竖条   23 //网页是否被检索   其中属性值有以下一些:   属性值为"all": 文件将被检索,且页上链接可被查询;   属性值为"none": 文件不被检索,而且不查询页上的链接;   属性值为"index": 文件将被检索;   属性值为"follow": 查询页上的链接;   属性值为"noindex": 文件不检索,但可被查询链接;   属性值为"nofollow": //打印分页

page1

page2

//设置打印 <script language=javascript> function window.onload() { // -- advanced features factory.printing.SetMarginMeasure(2) // measure margins in inches factory.printing.SetPageRange(false, 1, 3) // need pages from 1 to 3 factory.printing.printer = "HP DeskJet 870C" factory.printing.copies = 2 factory.printing.collate = true factory.printing.paperSize = "A4" factory.printing.paperSource = "Manual feed" // -- basic features factory.printing.header = "居左显示&b居中显示&b居右显示页码,第&p页/共&P页" factory.printing.footer = "(自定义页脚)" factory.printing.portrait = false factory.printing.leftMargin = 0.75 factory.printing.topMargin = 1.5 factory.printing.rightMargin = 0.75 factory.printing.bottomMargin = 1.5 } function Print(frame) { factory.printing.Print(true, frame) // print with prompt }
具体使用手册,更多信息,点这里 //自带的打印预览 WebBrowser.ExecWB(1,1) 打开 Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口 Web.ExecWB(4,1) 保存网页 Web.ExecWB(6,1) 打印 Web.ExecWB(7,1) 打印预览 Web.ExecWB(8,1) 打印页面设置 Web.ExecWB(10,1) 查看页面属性 Web.ExecWB(15,1) 好像是撤销,有待确认 Web.ExecWB(17,1) 全选 Web.ExecWB(22,1) 刷新 Web.ExecWB(45,1) 关闭窗体无提示

//去掉打印时的页眉页脚 <script language="JavaScript"> var HKEY_Root,HKEY_Path,HKEY_Key; HKEY_Root="HKEY_CURRENT_USER"; HKEY_Path="\Software\Microsoft\Internet Explorer\PageSetup\"; //设置网页打印的页眉页脚为空 function PageSetup_Null() { try { var Wsh=new ActiveXObject("WScript.Shell"); HKEY_Key="header"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,""); HKEY_Key="footer"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,""); } catch(e){} } //设置网页打印的页眉页脚为默认值 function PageSetup_Default() { try { var Wsh=new ActiveXObject("WScript.Shell"); HKEY_Key="header"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P"); HKEY_Key="footer"; Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d"); } catch(e){} } //浏览器验证 function checkBrowser() { this.ver=navigator.appVersion this.dom=document.getElementById?1:0 this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0; this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; this.ie4=(document.all && !this.dom)?1:0; this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.mac=(this.ver.indexOf("Mac") > -1) ?1:0; this.ope=(navigator.userAgent.indexOf("Opera")>-1); this.ie=(this.ie6 || this.ie5 || this.ie4) this.ns=(this.ns4 || this.ns5) this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope) this.nbw=(!this.bw) return this; } //计算内容宽和高 //无模式的提示框 function modelessAlert(Msg) { window.showModelessDialog("javascript:alert(""+escape(Msg)+"");window.close();","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;"); } //屏蔽按键 屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键 <script language="Javascript"> //可编辑SELECT //设置光标位置 function getCaret(textbox) { var control = document.activeElement; textbox.focus(); var rang = document.selection.createRange(); rang.setEndPoint("StartToStart",textbox.createTextRange()) control.focus(); return rang.text.length; } function setCaret(textbox,pos) { try { var r =textbox.createTextRange(); r.moveStart("character",pos); r.collapse(true); r.select(); } catch(e) {} } function selectLength(textbox,start,len) { try { var r =textbox.createTextRange(); r.moveEnd("character",len-(textbox.value.length-start)); r.moveStart("character",start); r.select(); } catch(e) {//alert(e.description)} } function insertAtCaret(textbox,text) { textbox.focus(); document.selection.createRange().text = text; } //页内查找 function findInPage(str) { var txt, i, found,n = 0; if (str == "") { return false; } txt = document.body.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else { alert(str + "... 您要找的文字不存在。 请试着输入页面中的关键字再次查找!"); } } return false; } //书 http://www.itpub.net/attachment.php?s=&postid=1894598 http://www.wrclub.net/down/listdown.aspx?id=1341//操作EXECL <script language="javascript"> function jStartExcel() { var xls = new ActiveXObject ( "Excel.Application" ); xls.visible = true; var newBook = xls.Workbooks.Add; newBook.Worksheets.Add; newBook.Worksheets(1).Activate; xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation = 2; xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize = 5; newBook.Worksheets(1).Columns("A").columnwidth=50; newBook.Worksheets(1).Columns("A").WrapText = true; newBook.Worksheets(1).Columns("B").columnwidth=50; newBook.Worksheets(1).Columns("B").WrapText = true; newBook.Worksheets(1).Range("A1:B1000").NumberFormat = "0"; newBook.Worksheets(1).Range("A1:B1000").HorizontalAlignment = -4131; newBook.Worksheets(1).Cells(1,1).Interior.ColorIndex="15"; newBook.Worksheets(1).Cells(1,1).value="First Column, First Cell"; newBook.Worksheets(1).Cells(2,1).value="First Column, Second Cell"; newBook.Worksheets(1).Cells(1,2).value="Second Column, First Cell"; newBook.Worksheets(1).Cells(2,2).value="Second Column, Second Cell"; newBook.Worksheets(1).Name="My First WorkSheet"; } tip <script Language="JavaScript"> //***********默认设置定义.********************* tPopWait=50;//停留tWait豪秒后显示提示。 tPopShow=5000;//显示tShow豪秒后关闭提示 showPopStep=20; popOpacity=99; //***************内部变量定义***************** sPop=null; curShow=null; tFadeOut=null; tFadeIn=null; tFadeWaiting=null; document.write(""); document.write("
"); function showPopupText(){ var o=event.srcElement; MouseX=event.x; MouseY=event.y; if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""}; if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""}; if(o.dypop!=sPop) { sPop=o.dypop; clearTimeout(curShow); clearTimeout(tFadeOut); clearTimeout(tFadeIn); clearTimeout(tFadeWaiting); if(sPop==null || sPop=="") { dypopLayer.innerHTML=""; dypopLayer.style.filter="Alpha()"; dypopLayer.filters.Alpha.opacity=0; } else { if(o.dyclass!=null) popStyle=o.dyclass else popStyle="cPopText"; curShow=setTimeout("showIt()",tPopWait); } } } function showIt(){ dypopLayer.className=popStyle; dypopLayer.innerHTML=sPop; popWidth=dypopLayer.clientWidth; popHeight=dypopLayer.clientHeight; if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24 else popLeftAdjust=0; if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24 else popTopAdjust=0; dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust; dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust; dypopLayer.style.filter="Alpha(Opacity=0)"; fadeOut(); } function fadeOut(){ if(dypopLayer.filters.Alpha.opacity0) { dypopLayer.filters.Alpha.opacity-=1; tFadeIn=setTimeout("fadeIn()",1); } } document.onmouseover=showPopupText; window.event.srcElement; if(oSource.tagName!="DIV") return false; var sel = document.selection; if (sel!=null) { var rng = sel.createRange(); if (rng!=null) rng.pasteHTML("插入文字"); } } //netscapte下操作xml doc = new ActiveXObject("Msxml2.DOMDocument"); doc = new ActiveXObject("Microsoft.XMLDOM") ->> doc = (new DOMParser()).parseFromString(sXML,"text/xml") //判断键值 <script language="javascript"> var ie =navigator.appName=="Microsoft Internet Explorer"?true:false; function keyDown(e) { if(!ie) { var nkey=e.which; var iekey="现在是ns浏览器"; var realkey=String.fromCharCode(e.which); } if(ie) { var iekey=event.keyCode; var nkey="现在是ie浏览器"; var realkey=String.fromCharCode(event.keyCode); if(event.keyCode==32){realkey="" 空格""} if(event.keyCode==13){realkey="" 回车""} if(event.keyCode==27){realkey="" Esc""} if(event.keyCode==16){realkey="" Shift""} if(event.keyCode==17){realkey="" Ctrl""} if(event.keyCode==18){realkey="" Alt""} } alert("ns浏览器中键值:"+nkey+" "+"ie浏览器中键值:"+iekey+" "+"实际键为"+realkey); } document.onkeydown = keyDown; //Javascript Document.

请按任意一个键。。。。

//禁止FSO 1.注销组件 regsvr32 /u scrrun.dll 2.修改PROGID HKEY_CLASSES_ROOTScripting.FileSystemObject Scripting.FileSystemObject 3.对于使用object的用户,修改HKEY_CLASSES_ROOTScripting. //省略号
就是比如有一行文字,很长,表格内一行显示不下.
//检测media play版本 //图象按比例 <script language="JavaScript"> //细线SELECT function getComputerName() { var objWMIService = GetObject("Winmgmts:rootcimv2"); for(e = new Enumerator(objWMIService) ; !e.atEnd() ; e.moveNext()) { var getComputer = e.item(); return getComputer.Name; } } //条件编译 <script language=javascript> /*@cc_on @*/ /*@if (@_win32 && @_jscript_version>5) function window.confirm(str) { execScript("n = msgbox(""+ str +"", 257)", "vbscript"); return(n == 1); } @end @*/ //mergeAttributes 复制所有读/写标签属性到指定元素。
This is a sample DIV element.
This is another sample DIV element.
以上内容可以随意转载,转载后请注名来源和出处! 原文链接:http://ttyp.cnblogs.com/archive/2004/11/15/63900.aspx //Import function Import() { for( var i=0; i"); else document.write(""); } }; //js枚举 function getComputerName() { var objWMIService = GetObject("Winmgmts:rootcimv2"); for(e = new Enumerator(objWMIService) ; !e.atEnd() ; e.moveNext()) { var getComputer = e.item(); return getComputer.Name; } } //条件编译 <script language=javascript> /*@cc_on @*/ /*@if (@_win32 && @_jscript_version>5) function window.confirm(str) { execScript("n = msgbox(""+ str +"", 257)", "vbscript"); return(n == 1); } @end @*/ //mergeAttributes 复制所有读/写标签属性到指定元素。
This is a sample DIV element.
This is another sample DIV element.
电子书制作:源码爱好者

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧