mirror of
https://github.com/reactos/RosBE.git
synced 2024-11-23 11:29:44 +00:00
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:
parent
93b8c42b21
commit
59d90f6fa2
@ -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"
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user