针对如何在Windows8.1Update2操作系统中使用PowerShell环境中的Win32APIFindWindow和来查找桌面窗口这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展AW
针对如何在Windows 8.1 Update 2操作系统中使用PowerShell环境中的Win32 API FindWindow和来查找桌面窗口这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展AWS is updating minimum requirements for AWS Tools for PowerShell to Windows PowerShell 3.0 and ....、FindWindow怎么find一个EnumChildWindows没有的窗口?、gdi – 在Windows 10中带有标题栏的模糊窗口? Windows Update后停止工作、Microsoft.SharePoint.PowerShellpipe理单元:不正确的Windows PowerShell版本3.0 当前控制台支持Window PowerShell 2.0版等相关知识,希望可以帮助到你。
本文目录一览:- 如何在Windows 8.1 Update 2操作系统中使用PowerShell环境中的Win32 API FindWindow()来查找桌面窗口(通过窗口名称)?
- AWS is updating minimum requirements for AWS Tools for PowerShell to Windows PowerShell 3.0 and ....
- FindWindow怎么find一个EnumChildWindows没有的窗口?
- gdi – 在Windows 10中带有标题栏的模糊窗口? Windows Update后停止工作
- Microsoft.SharePoint.PowerShellpipe理单元:不正确的Windows PowerShell版本3.0 当前控制台支持Window PowerShell 2.0版
如何在Windows 8.1 Update 2操作系统中使用PowerShell环境中的Win32 API FindWindow()来查找桌面窗口(通过窗口名称)?
我不记得在较老的Windows操作系统中find一个窗口有任何问题,但是,我没有在Windows 8.1 Update 2操作系统中使用PowerShell v4.0获得成功 。
这是我使用的PowerShell v4.0代码(非常简单):
$sig=@' [DllImport("user32.dll")] public static extern IntPtr FindWindow(String sClassName,String sAppName); '@ $fw = Add-Type -Namespace Win32 -Name Funcs -MemberDeFinition $sig -Passthru $wname='Form1' # any existing window name $fw::FindWindow($null -as [String],$wname) # returns 0,always!
最后一个命令总是返回0 。
将DllImport属性更改为
如何在PowerShell中下载整个DropBox目录?
Py2Exe:避免Windows请求执行.exe文件的权限
PowerShell Windows安装程序Com对象
PowerShell:导出用户权限分配
使用PowerShell来查找设置为唤醒计算机的计划任务
[DllImport("user32.dll",CharSet = CharSet.Unicode)]
不改变任何东西; 0以相同的方式返回。
有趣的是, C#中的等效代码返回正确的HWND值。
有谁知道什么是错的(以及如何解决)上面的PowerShell v4.0代码?
Azure自定义脚本扩展不断重新启动
networking延迟监视脚本窗口
1 Powershell脚本2 sql表
用于创build本地用户并将详细信息写入XML文件的Powershell脚本
Windows PowerShell在命令Enter-PSSession中input密码
第一 :不是一个答案,而是帮助其他人的工作,如果你使用良好的类,例如在这里我代码CalcFrame这是calc.exe主窗口的真正的类它的工作。
$fw::FindWindow("CalcFrame",$wname) # returns the right value for me if calc.exe is started.
第二 :以下对我有用; 按照Microsoft文档中的第一个参数应该为null,而在PInvok e站点中必须通过IntPtr.Zero作为第一个参数 。
$sig = @" [DllImport("user32.dll",CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(IntPtr sClassName,String sAppName); [DllImport("kernel32.dll")] public static extern uint GetLastError(); "@ $fw = Add-Type -Namespace Win32 -Name Funcs -MemberDeFinition $sig -Passthru $wname='Calculatrice' # any existing window name $fw::FindWindow([IntPtr]::Zero,$wname ) # returns the Window Handle $a = $fw::GetLastError() $a
似乎该方法不会失败,如果,并且只有当ClassName也被指定(不能为null )时才如下例所示:
$sig=@' [DllImport("user32.dll",CharSet = CharSet.Auto)] public static extern IntPtr FindWindow(string lpClassName,string lpWindowName); '@ $w32 = Add-Type -Namespace Win32 -Name Funcs -MemberDeFinition $sig -Passthru $w32::FindWindow('ConsoleWindowClass','Windows PowerShell') # Windows PowerShell Console
如果ClassName为null ,那么JPBlanc的方法就能正常工作,这为方法指定了一个不同的签名。
我看了一下这个问题的C#实现,发现了2个WNDCLASS结构:WNDCLASS_D和WNDCLASS_I。 前者是使用字符串作为类型的传统结构,遵循Win32 API。 但后者使用IntPtr.Zero值为那些采用空字符串值的WNDCLASS结构。 由于这个原因,指定空字符串值将导致发现,因为空字符串值不能隐式转换为IntPtr.Zero。
AWS is updating minimum requirements for AWS Tools for PowerShell to Windows PowerShell 3.0 and ....
https://amazonaws-china.com/blogs/developer/aws-is-updating-minimum-requirements-for-aws-tools-for-powershell-to-windows-powershell-3-0-and-net-framework-4-5/
On January 14th 2020 Microsoft ended extended support for Windows Server 2008 and Windows Server 2008 R2. The oldest supported Windows Server version, Windows Server 2012, comes with Windows PowerShell 3.0 and .NET Framework 4.5.
The legacy variant of AWS Tools for PowerShell (AWSPowerShell) is currently compatible with Windows PowerShell 2.0 and .NET Framework 3.5. Starting May 1st 2020, AWS will require Windows PowerShell 3.0+ and .NET Framework 4.5+ as prerequisite for all new releases of AWSPowerShell. The existing versions of AWSPowerShell that are compatible with Windows PowerShell 2 and .NET Framework 3.5 will continue to be available for download from PowerShell Gallery, but will not be updated or supported.
What do I need to do?
- If you are using modular or bundled variants of AWS Tools for PowerShell (AWS.Tools or AWSPowerShell.NetCore) , you are not impacted. No action is required.
- If you are running a legacy variant of AWS Tools for PowerShell (AWSPowerShell) on Windows Server 2012 or higher, that already come with Windows PowerShell 3.0, or higher, and .NET Framework 4.5, or higher, you are not impacted. No action is required.
- If you are running a legacy variant of AWS Tools for PowerShell (AWSPowerShell) on Windows Server 2008 or Windows Server 2008 R2 with Windows PowerShell 3.0, or higher, and .NET Framework 4.5, or higher, installed, you are not impacted, but please follow Microsoft guidelines on upgrading to the latest OS version
- If you are running a legacy variant of AWS Tools for PowerShell (AWSPowerShell) on Windows Server 2008 or Windows Server 2008 R2 with Windows PowerShell 2.0, or .NET Framework 4.0, or lower, please upgrade to Microsoft Windows 2012 or higher.
- If you choose not to upgrade your OS version, please upgrade Windows PowerShell to version 3.0, or higher and .NET Framework to version 4.5, higher.
- If you cannot upgrade from Windows PowerShell 2.0 and .NET Framework 3.5 without impacting other workloads, please install PowerShell Core 6.0 alongside the existing PowerShell 2.0 version and switch to the new PowerShell executable. Then follow these detailed instructions to install AWSPowerShell.NetCore on Windows.
FindWindow怎么find一个EnumChildWindows没有的窗口?
我正在寻找一个窗口,其类名是“CLIPBRDWNDCLASS”(它可以在办公室应用程序和其他应用程序中find)。
如果我使用FindWindow或findwindowex,我find了第一个有这个类的HWND,但是我想要所有带有这个类的窗口,所以我决定使用recursionEnumChildWindows枚举所有窗口并find我想要的窗口:
//------------------------------------------------------------------------------- BOOL CALLBACK enum_wnd_proc(HWND h,LParaM lp) { char cls[1024] = {0}; ::GetClassNameA(h,cls,1024); if(std::string(cls) == "CLIPBRDWNDCLASS") { // match! } ::EnumChildWindows(h,enum_wnd_proc,NULL); return TRUE; } //------------------------------------------------------------------------------- int _tmain(int argc,_TCHAR* argv[]) { ::EnumWindows(enum_wnd_proc,NULL); return 0; } //-------------------------------------------------------------------------------
这就是这个窗口不能被EnumWindows返回,只能通过FindWindow返回。
有没有人可以告诉它为什么不起作用?
如何使用Python 2.7创build一个希伯来文名称的文件?
是否有任何可视化工具来实现作为输出结果的SQL查询数据的分层样式?
如何loggingWindows窗体应用程序中的键,而不是集中在窗体上?
Windows:如何在新的命令窗口中运行某些东西,使窗口在进程完成或崩溃时closures?
Python Socket绑定在0.0.0.0上,不能通过127.0.0.1连接
ContactManager.RequestStoreAsync()抛出System.UnauthorizedAccessException
C ++崩溃转储,在Win32exception(使用catch(…)时)的堆栈展开 – VS 2003
分期环境与现场环境相等多less?
在Windows上使用Ruby读取PNG文件失败
Windows控制台中的C ++键input
EnumWindows不起作用的原因是您正在寻找的窗口是一个消息窗口 。
findwindowex可以在两种情况下找到它们:
如果hwndParent和hwndChildAfter都是NULL。
如果您指定“HWND_MESSAGE”作为您的父窗口。
此代码将为您找到所有相关的窗口( 这里是一个解决方案的修改版本):
HWND hWindow = findwindowexA(HWND_MESSAGE,NULL,"CLIPBRDWNDCLASS",NULL); while (hWindow ) { // Do something here with window... // Find next window hWindow = findwindowexA(HWND_MESSAGE,hWindow,NULL); }
还要注意的是,不同于上面的链接中写的,只有消息窗口的GetParent() 不返回HWND_MESSAGE (至少不是我的测试)。
我简单的方法来枚举所有消息窗口:
EnumChildWindows(GetAncestor(findwindowex(HWND_MESSAGE,0,0),GA_PARENT),addr EnumChildProc,0)
// GetAncestor(findwindowex(HWND_MESSAGE,0,0),GA_PARENT)=“GetMessageWindow”(“Message”类)
// GetAncestor(findwindowex(HWND_DESKTOP,0,0),GA_PARENT)= GetDesktopWindow(class“#32769”)
gdi – 在Windows 10中带有标题栏的模糊窗口? Windows Update后停止工作
我一直在做的是:
>绘制到目标DC,包括alpha通道.在普通GDI中执行此操作的一种方法是使用alpha通道构建图像,并使用SRCcopY将其用于DC.您还可以使用AlphaBlend函数.
>然后我使用SetWindowCompositionAttribute(或DwmExtendFrameIntoClientArea)在Windows 10(或更早版本)上启用模糊.
这工作到今天,并在更新后突然停止工作 – 窗口现在是不透明的.我使用了系统还原并且有一天回去了,它实际上又恢复了!任何想法我该如何解决这个问题?
Microsoft.SharePoint.PowerShellpipe理单元:不正确的Windows PowerShell版本3.0 当前控制台支持Window PowerShell 2.0版
我在我的机器上安装了SharePoint 2010,用于开发目的,而且我错误地升级到.Net 4.0和PowerShell 3.0。
解决这个问题,使用-version 2.0或-v 2 switch / arguement运行powershell并不完全正常。
所以,这个问题是如何在PowerShell中添加Microsoft.Sharepoint.PowerShellpipe理单元,在具有.Net 4.0框架的机器上?
尝试1:
Windows中的IP发现
在Windows中检测文件“copY”操作
HRESULT:0x80040154(REGDB_E_CLASSNOTREG))
对于Windows窗体,PostMessage等于自己的什么?
从C#中selectsql Server数据库中的特定logging
PS> Add-PSSnapin Microsoft.Sharepoint.Powershell The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered. PS> Get-SPSite('http://myServerName/') Get-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.18052 of the Microsoft .Net Runtime.
好的,所以我尝试2:
PS> powershell.exe -version 2.0 PS> Add-PSSnapin Microsoft.Sharepoint.Powershell Add-PSSnapin : Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console. At line:1 char:13 + Add-PSSnapin <<<< Microsoft.Sharepoint.PowerShell + CategoryInfo : InvalidArgument: (Microsoft.Sharepoint.PowerShell:String) [Add-PSSnapin],PSArgumentException + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
我也尝试设置快捷方式的目标。 并卸载以q结尾的Windows更新
所以,这是我的错误,我无法find任何信息: 不正确的Windows PowerShell版本3.0。 当前控制台支持Windows PowerShell版本2.0。
有什么想法吗?
在哪里写日志的Windows应用程序
如何测量C#中的系统空闲时间,不包括看电影等?
如何在Windows窗体上显示必填字段
.NET EXE和DLL之间的堆栈/堆区别
采用Windows媒体基础的H.264编码
如果我打电话,它似乎为我工作
powershell.exe -version 2.0
从命令提示符而不是从Powershell调用它。
最近SharePoint 2010更新后,我可以添加PowerShell管理单元,而在版本2.0中运行PowerShell
今天关于如何在Windows 8.1 Update 2操作系统中使用PowerShell环境中的Win32 API FindWindow和来查找桌面窗口的分享就到这里,希望大家有所收获,若想了解更多关于AWS is updating minimum requirements for AWS Tools for PowerShell to Windows PowerShell 3.0 and ....、FindWindow怎么find一个EnumChildWindows没有的窗口?、gdi – 在Windows 10中带有标题栏的模糊窗口? Windows Update后停止工作、Microsoft.SharePoint.PowerShellpipe理单元:不正确的Windows PowerShell版本3.0 当前控制台支持Window PowerShell 2.0版等相关知识,可以在本站进行查询。
本文标签: