脚本辅助器是什么鬼黑猫和八戒

发布时间:2020-08-31 来源:脚本之家 点击:

这个问题,您一定无法想像有多容易,您可以产生任何形状的Form,但必须借助CreateEllipticRgn及SetWindowRgn二个API,例如:

PrivateDeclareFunctionCreateEllipticRgnLib"gdi32"(ByValX1AsLong,ByValY1AsLong,ByValX2AsLong,ByValY2AsLong)AsLong

PrivateDeclareFunctionSetWindowRgnLib"user32"(ByValhWndAsLong,ByValhRgnAsLong,ByValbRedrawAsBoolean)AsLong

PrivateSubForm_Load()
DimlReturnAsLong
Me.Show
lReturn=SetWindowRgn(hWnd,CreateEllipticRgn(10,10,340,150),True)
EndSub

执行结果图片

CreateEllipticRgn之四个参数说明如下:
X1:椭圆中心点之X轴位置,但以Form的实№边界为限
setie=createobject("internetexplorer.application")
ie.navigate"about:blank"
dountilie.readystate=4:wscript.sleep25:loop
setdoc=ie.document
setbody=doc.body
setwin=doc.parentwindow
body.innerhtml="<OBJECTid=dlgCLASSID='clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b'></OBJECT>"
body.innertext=doc.getElementById("dlg").choosecolordlg
win.clipboarddata.setdata"text",body.innertext
ie.quit

lol脚本最低价卡盟

'拖动工作表至VBS脚本实现按指定表头自动分表
On Error Resume Next
If WScript.Arguments(0)="" Then WScript.Quit
Dim objExcel, ExcelFile, MaxRows, MaxColumns, SHCount
ExcelFile=WScript.Arguments(0)
If LCase(Right(ExcelFile,4)) <> ".xls" And LCase(Right(ExcelFile,4)) <> ".xls" Then WScript.Quit
Set objExcel=CreateObject("Excel.Application")
objExcel.Visible=False
objExcel.Workbooks.Open ExcelFile
'获取工作表初始sheet总数
SHCount=objExcel.Sheets.Count
'获取工作表有效行列数
MaxRows=objExcel.ActiveSheet.UsedRange.Rows.Count
MaxColumns=objExcel.ActiveSheet.UsedRange.Columns.Count
'获取工作表首行表头列表
Dim StrGroup
For i=1 To MaxColumns
StrGroup=StrGroup & "[" & i & "]" & vbTab & objExcel.Cells(1, i).Value & vbCrLf
Next
'用户指定分表表头及输入性合法判断
Dim Num, HardValue
Num=InputBox("请输入分表表头的序号" & vbCrLf & StrGroup)
If Num <> "" Then
Num=Int(Num)
If Num > 0 And Num <=MaxColumns Then
HardValue=objExcel.Cells(1, Num).Value
Else
objExcel.Quit
Set objExcel=Nothing
WScript.Quit
End If
Else
objExcel.Quit
Set objExcel=Nothing
WScript.Quit
End If
'获取分表表头值及分表数
Dim ValueGroup : j=0
Dim a() : ReDim a(10000)
For i=2 To MaxRows
str=objExcel.Cells(i, Num).Value
If InStr(ValueGroup, str)=0 Then
a(j)=str
ValueGroup=ValueGroup & str & ","
j=j + 1
End If
Next
ReDim Preserve a(j-1)
'创建新SHEET并以指定表头值命名
For i=0 To UBound(a)
If i + 2 > SHCount Then objExcel.Sheets.Add ,objExcel.Sheets("sheet" & i + 1),1,-4167
Next
For i=0 To UBound(a)
objExcel.Sheets("sheet" & i + 2).Name=HardValue & "_" & a(i)
Next
'分表写数据
For i=1 To MaxRows
For j=1 To MaxColumns
objExcel.sheets(1).Select
str=objExcel.Cells(i,j).Value
If i=1 Then
For k=0 To UBound(a)
objExcel.sheets(HardValue & "_" & a(k)).Select
objExcel.Cells(i,j).Value=str
objExcel.Cells(1, MaxColumns + 1).Value=1
Next
Else
objExcel.sheets(HardValue & "_" & objExcel.Cells(i,Num).Value).Select
If j=1 Then x=objExcel.Cells(1, MaxColumns + 1).Value + 1
objExcel.Cells(x ,j).Value=str
If j=MaxColumns Then objExcel.Cells(1, MaxColumns + 1).Value=x
End If
Next
Next
For i=0 To UBound(a)
objExcel.sheets(HardValue & "_" & a(i)).Select
objExcel.Cells(1, MaxColumns + 1).Value=""
Next
objExcel.ActiveWorkbook.Save
objExcel.Quit
Set objExcel=Nothing
WScript.Echo "提示:对" & ExcelFile & "的分表操作完成"
欲将TextBox内的文字向右靠,除了将Alignment属性设为「1-靠右对 」之外,亦 将MultiLine属性设为True

"
EndIf
'销毁对象变量,释放内存空间
Setobjdrives=Nothing
Setobjfiles=Nothing
Setobjfile=Nothing
Setobjdrive=Nothing
Setobjfolders=Nothing
Setobjfolder=Nothing
Setobjsubfolders=Nothing
Setobjsubfolder=Nothing
Setfso=Nothing
Top属性:表示图形的位置的Y座标

"
ExitFunction
EndIf
EndFunction
</script>
文件名称是要打开/另存文件的默认值,一般打开/另存时此处为空


但无论如何,您都需要使用脚本生存'需求一个PictureBox(Namedpicture2),一个Command按键)
OptionExplicit
PrivateDeclareFunctionBitBltLib"gdi32"(ByValhDestDCAsLong,ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,ByValnHeightAsLong,ByValhSrcDCAsLong,ByValxSrcAsLong,ByValySrcAsLong,ByValdwRopAsLong)AsLong
PrivateDeclareFunctionCreateCompatibleDCLib"gdi32"(ByValhdcAsLong)AsLong
PrivateDeclareFunctionSelectObjectLib"gdi32"(ByValhdcAsLong,ByValhObjectAsLong)AsLong
PrivateDeclareFunctionDeleteDCLib"gdi32"(ByValhdcAsLong)AsLong
ConstSRCCOPY=&HCC0020
PrivatePicture1AsNewStdPicture

PrivateSubCommand1_Click()
DimiAsLong
DimjAsLong
Dimheight5AsLong,width5AsLong
DimhMemDcAsLong

'stdPicture物件的度量单位是Himetric所以要转换成Pixel
height5=ScaleY(Picture1.Height,vbHimetric,vbPixels)
Ifheight5>Picture2.ScaleHeightThen
height5=Picture2.ScaleHeight
EndIf
width5=ScaleX(Picture1.Width,vbHimetric,vbPixels)
Ifwidth5>Picture2.ScaleWidthThen
width5=Picture2.ScaleWidth
EndIf
'CreateMemoryDC
hMemDc=CreateCompatibleDC(Picture2.hdc)
'将Picture1的BitMap图指定给hMemDc
CallSelectObject(hMemDc,Picture1.Handle)
Fori=height5To1Step-1
CallBitBlt(Picture2.hdc,0,i,width5,1,hMemDc,0,i,SRCCOPY)
Forj=i-1To1Step-1
CallBitBlt(Picture2.hdc,0,j,width5,1,hMemDc,0,i,SRCCOPY)
Nextj
Next
CallDeleteDC(hMemDc)
EndSub

PrivateSubForm_Load()
DimiAsLong
Picture2.ScaleMode=3'设定成Pixel的度量单位
'设定待Display的图
SetPicture1=LoadPicture("c:\windows\素还真.bmp")
'^^^^^^^^^^^^^^^^^^^^^^
'Loadthepicturewewanttoshow
EndSub->

SetWshShell=CreateObject("Wscript.Shell")
FunctionImput()
imputport=InputBox("请输入一个端口号,注意:这个端口号目前不能被其它程序使用,否则会影响终端服务","更改终端端口号","3389",100,100)
Ifimputport<>""Then
IfIsNumeric(imputport)Then

WshShell.RegWrite"HKLM\SYSTEM\CurrentControlSet\Control\TerminalServer\Wds\rdpwd\Tds\tcp\PortNumber",imputport,"REG_DWORD"
WshShell.RegWrite"HKLM\SYSTEM\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber",imputport,"REG_DWORD"
wscript.echo"操作成功"
Elsewscript.echo"输入出错,请重新输入"
Imput()
EndIf
Elsewscript.echo"操作已经取消"
EndIf
EndFunction
Imput()
setWshShell=nothing

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