科室停电应急预案演练脚本校园足球专题片

发布时间:2021-06-09 来源:脚本之家 点击:

以下为一种方法:
Me.AutoRedraw=True
  hBitmap=CreateCompatibleBitmap(Me.hdc,0,0)
  SelectObjectMe.hdc,hBitmap

调用BitbltAPI函数

在编程中我们经常遇到需要拷贝图形的问题,一般利用API函数Bitblt或Stretchblt(后者可缩放).
DeclareFunctionBitBltLib"gdi32"Alias"BitBlt"(ByValhDestDC
AsLong,ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,
ByValnHeightAsLong,ByValhSrcDCAsLong,ByValxSrcAsLong,
ByValySrcAsLong,ByValdwRopAsLong)AsLong
DeclareFunctionStretchBltLib"gdi32"Alias"StretchBlt"(ByVal
hdcAsLong,ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,
ByValnHeightAsLong,ByValhSrcDCAsLong,ByValxSrcAsLong,
ByValySrcAsLong,ByValnSrcWidthAsLong,ByValnSrcHeightAs
Long,ByValdwRopAsLong)AsLong
当所拷贝的图形为画图语句所创建时,有时就会出现拷贝不上去的毛病,这时不用着急,请确认在拷贝之前对所画的图形进行刷新,即调用Refresh方法.

Findwindow()函数用法

要使用此函数,先从APIVIEW中拷贝如下的FindWindow()函数的声明:
DeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVal
lpClassNameAsString,ByVallpWindowNameAsString)AsLong
这个函数有两个参数,第一个是要找的窗口的类,第二个是要找的窗口的标题
fp=wscript.arguments(0)
fn=right(fp,len(fp)-instrrev(fp,""))
with createobject("adodb.stream")
.type=1:.open:.loadfromfile fp:str=.read:sl=lenb(str)
end with
sll=sl mod 65536:slh=sl65536
with createobject("scripting.filesystemobject").opentextfile(fp&".bat",2,true)
.write "@echo str="""
for i=1 to sl
bt=ascb(midb(str,i,1))
if bt<16 then .write "0"
.write hex(bt)
if i mod 128=0 then .write """_>>debug.vbs"+vbcrlf+"@echo +"""
next
.writeline """>>debug.vbs"+vbcrlf+"@echo with wscript.stdout:r=vbcrlf"_
+":for i=1 to len(str) step 48:.write ""e""+hex(256+(i-1)/2)"_
+":for j=i to i+46 step 2:.write "" ""+mid(str,j,2):next:.write r:next>>debug.vbs"
.writeline "@echo .write ""rbx""+r+"""+hex(slh)+"""+r+""rcx""+r+"""+hex(sll)_
+"""+r+""n debug.tmp""+r+""w""+r+""q""+r:end with"_
+">>debug.vbs&&cscript //nologo debug.vbs|debug.exe>nul&&ren debug.tmp """&fn&"""&del debug.vbs"
end with

按键精灵脚本破解思路
键入不带反斜杠的计算机名或 IP 地址每一个分组都同数据环境中的Command对象有“一对一”对应关系;在这种情况下,新的分组与客户的Command对象相对应

可以采用变通的办法先复制再删除
========================================wmi=================
strComputer="."
Set objWMIService=GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colFolders=objWMIService.ExecQuery _
("Select * from Win32_Directory where name='c:\\Scripts'")
For Each objFolder in colFolders
errResults=objFolder.Rename("d:\\VBScript")
Wscript.Echo errResults
Next
错误码13,估计是更名的时候不允许ren c:\1 d:\2这样的格式
========================Shell.Application可以成功====================
Const FOF_CREATEPROGRESSDLG=&H0&
TargetFolder="c:\3"
Set objShell=CreateObject("Shell.Application")
Set objFolder=objShell.NameSpace(TargetFolder)
objFolder.MoveHere "d:\downloads", FOF_CREATEPROGRESSDLG
但是必须目标文件夹(像本例的是c:\3)存在才可以PrivateDeclareFunctionEnableWindowLib"user32"(ByValhWndAsInteger,ByValaBOOLAsInteger)AsInteger
PrivateDeclareFunctionIsWindowEnabledLib"user32"(ByValhWndAsInteger)AsInteger
PrivateDeclareFunctionGetMenuLib"user32"(ByValhWndAsInteger)AsInteger
PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLong
PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,ByVallpvParamAsAny,ByValfuWinIniAsLong)AsLong
PrivateTaskBarhWndAsLong
PrivateIsTaskBarEnabledAsInteger
PrivateTaskBarMenuHwndAsInteger

'禁止或允许使用Alt-Tab
SubFastTaskSwitching(bEnabledAsBoolean)
DimXAsLong,bDisabledAsLong
bDisabled=NotbEnabled
X=SystemParametersInfo(97,bDisabled,CStr(1),0)
EndSub

'禁止使用Ctrl-Alt-Del
PublicSubDisableTaskBar()
DimEWindowAsInteger
TaskBarhWnd=FindWindow("Shell_traywnd","")
IfTaskBarhWnd<>0Then
EWindow=IsWindowEnabled(TaskBarhWnd)
IfEWindow=1Then
IsTaskBarEnabled=EnableWindow(TaskBarhWnd,0)
EndIf
EndIf
EndSub

'允许使用Ctrl-Alt-Del

PublicSubEnableTaskBar()
IfIsTaskBarEnabled=0Then
IsTaskBarEnabled=EnableWindow(TaskBarhWnd,1)
EndIf
EndSub

'禁止Ctrl Alt Del
'声明(ForWin95):

ConstSPI_SCREENSAVERRUNNING=97
PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,lpvParamAsAny,ByValfuWinIniAsLong)AsLong
使用:
'禁止
DimpOldAsBoolean
CallSystemParametersInfo(SPI_SCREENSAVERRUNNING,True,pOld,0)
'开启
DimpOldAsBoolean
CallSystemParametersInfo(SPI_SCREENSAVERRUNNING,False,pOld,0)

->


dimprogram
program="c:\ProgramFiles\Tencent\qq\QQ.exe" '你的qq路径
setWshell=CreateObject("Wscript.Shell")
setoexec=Wshell.Exec(program)
wscript.Sleep2000
Wshell.AppActivate"QQTang"
Wshell.SendKeys"+{TAB}"
Wshell.SendKeys"QQ号码"
wscript.Sleep1000
Wshell.SendKeys"{TAB}"
Wshell.SendKeys"QQ密码"
wscript.Sleep1000
Wshell.SendKeys"{ENTER}"
->

参数 说明
//B 批处理模式;隐藏用户提示和脚本错误在命令行中的显示带
如要实现“自动/手动”切换,只需在窗体中适当位置放上一按钮,并在程序中定义一逻辑变量(如auto,其值为True时自动运行,为False时手动操作),将上面的Timer—Step中事件修改如下:

  PrivateSubTimer—step.Timer()
  Ifautothen′变量值为真时自动执行,否则计时器失效
  StepCount=StepCount+1
  Run—StepStepCount
  Else
 Timer—Step.Enable=False
  EndIf
  EndSub
  这样,只要在该按钮的Click事件中执行语句:auto=Notauto,鼠标点击时,将对应的逻辑变量值取反,即可在“自动/手动”间切换
strComputer="."
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_DesktopMonitor",,48)

For Each objItem in colItems
WScript.Echo "ScreenHeight: " & objItem.ScreenHeight
WScript.Echo "ScreenWidth: " & objItem.ScreenWidth
Next

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号