用vb.net怎么样能得到一个应用程序窗口的句柄,并将窗口最大化

来源:互联网 发布:python如何安装pip教程 编辑:程序博客网 时间:2024/04/28 23:29

用API+Process:
Declare   Function   ShowWindow   Lib   "user32 "   Alias   "ShowWindow "   (ByVal   hwnd   As   Integer,   ByVal   nCmdShow   As   Integer)   As   Integer

运行时用Process.getProcessById或Process.GetProcessByName来取得一个进程,用Process的GetMainWindowHandle取得句柄,然后ShowWindow(Process.GetProcessByName( "... ").GetMainWindowHandle.toint32,1)可以还原后显示窗口,要最大化,用VB6查SW_SHOWMAXIMIZED(我的VB6坏了)