Eh, did ever anyone realize that the flash tool is not PS compatible?

Fixed this with a nice dll invoke function by Joel Bennett aka jaykul from #powershell

svn path=/trunk/tools/RosBE/; revision=1119
This commit is contained in:
Daniel Reimer 2009-10-21 01:58:19 +00:00
parent 93b8c42b21
commit 59d90f6fa2
2 changed files with 21 additions and 1 deletions

View File

@ -71,5 +71,5 @@ if ($_ROSBE_SHOWTIME -eq 1) {
}
# Highlight the fact that building has ended.
"$_ROSBE_BASEDIR\Tools\flash.exe"
FlashWindow (ps -id $pid).MainWIndowHandle $true
$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"

View File

@ -60,6 +60,26 @@ $ENV:C_INCLUDE_PATH = $null
$ENV:CPLUS_INCLUDE_PATH = $null
$ENV:LIBRARY_PATH = $null
# Flash Tool in a Function.
function New-PInvoke {
param(
$Library,
$Signature
)
$local:ErrorActionPreference = "SilentlyContinue"
$name = $($signature -replace "^.*?\s(\w+)\(.*$",'$1')
$MemberDefinition = "[DllImport(`"$Library`")]`n$Signature"
$type = Add-Type -PassThru -Name "PInvoke$(Get-Random)" -MemberDefinition $MemberDefinition
$null = iex "New-Item Function:Global:$name -Value { [$($type.FullName)]::$name.Invoke( `$args ) }"
$local:ErrorActionPreference = "Continue"
}
New-PInvoke user32.dll "public static extern void FlashWindow(IntPtr hwnd, bool bInvert);"
# Web Downloader in a function.
function global:Get-WebFile {
param(
$url = $null,