トップページ > Windows > 2010年07月06日 > kPA7wvIt

書き込み順位&時間帯一覧

14 位/372 ID中時間01234567891011121314151617181920212223Total
書き込み数3000000000000000000000003



使用した名前一覧書き込んだスレッド一覧
名無し~3.EXE
Windows PowerShell 2.0 Part2
今、クリップボードにある文字をペーストするスレ14

書き込みレス一覧

Windows PowerShell 2.0 Part2
255 :名無し~3.EXE[]:2010/07/06(火) 00:31:42 ID:kPA7wvIt
暇なんで、作ってみますた
[void][Reflection.Assembly]::LoadWithPartialName("System.windows.forms")
[void][Reflection.Assembly]::LoadWithPartialName("System.Runtime.InteropServices")
function New-PType() {
$assembly_name = New-Object Reflection.AssemblyName 'PInvokeAssembly'
$dd_assembly = [AppDomain]::CurrentDomain.DefineDynamicAssembly($assembly_name, 'Run')
$dd_module = $dd_assembly.DefineDynamicModule('PInvokeModule')
return $dd_module.DefineType('PInvokeType', "Public,BeforeFieldInit")
}
function New-PMethod([string]$dllName, [Type]$returnType, [string]$methodName, [Type[]]$parameterTypes){
$ptype = New-PType
$d_method = $ptype.DefineMethod($methodName, 'Public,HideBySig,Static,PinvokeImpl', $returnType, $parameterTypes)
$constructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor([string])
$attrbute = New-Object Reflection.Emit.CustomAttributeBuilder $constructor, $dllName
$d_method.SetCustomAttribute($attrbute)
$type = $ptype.CreateType()
$type = Add-Member -InputObject $type -MemberType NoteProperty -Name MethodName -Value $methodname -passthru
$invoke = {return $this.InvokeMember($this.MethodName, 'Public,Static,InvokeMethod', $null, $null, $args[0])}
Add-Member -InputObject $type -MemberType ScriptMethod -Name Invoke -Value $invoke
return $type
}
$ptc = @'
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int x;
public int y;
}
'@
Windows PowerShell 2.0 Part2
256 :名無し~3.EXE[]:2010/07/06(火) 00:32:35 ID:kPA7wvIt
続き
Add-Type -TypeDefinition $ptc
$WindowFromPoint = New-PMethod "user32.dll" ([Int32]) "WindowFromPoint" @([POINT])
$PostMessage = New-PMethod "user32.dll" ([Int32]) "PostMessage" @([Int32],[Int32],[Int32],[Int32])
$GetAncestor = New-PMethod "user32.dll" ([Int32]) "GetAncestor" @([Int32],[Int32])
$pt = New-Object POINT; $ptb = New-Object POINT

while($true){
$pt.x= [System.Windows.Forms.Cursor]::Position.x
$pt.y= [System.Windows.Forms.Cursor]::Position.y
start-sleep -m 50
if(($pt.x -ne $ptb.x) -or ($pt.y -ne $ptb.y )){
$ptb.x=$pt.x; $ptb.y=$pt.y
$hwd = $WindowFromPoint.Invoke([POINT]$ptb)
$ohwd = $GetAncestor.Invoke(@([int32]$hwd ,[int32]3))
$t = Get-Process | ? { $_.MainWindowHandle -eq $ohwd}
"x="+$ptb.x+":y="+$ptb.y+" ハンドル"+$hwd+" 親ハンドル"+$ohwd+": "+$t.MainWindowTitle
#コントロールをクリック
#$PostMessage.Invoke(@([int32]$hwd ,[int32]0x201,[int32]0,[int32]0)) | out-null
#$PostMessage.Invoke(@([int32]$hwd ,[int32]0x202,[int32]0,[int32]0)) | out-null
}
}
今、クリップボードにある文字をペーストするスレ14
684 :名無し~3.EXE[]:2010/07/06(火) 00:54:09 ID:kPA7wvIt
あつあつ弁当


※このページは、『2ちゃんねる』の書き込みを基に自動生成したものです。オリジナルはリンク先の2ちゃんねるの書き込みです。
※このサイトでオリジナルの書き込みについては対応できません。
※何か問題のある場合はメールをしてください。対応します。