ShowWindow SW_SHOW不会显示隐藏的窗口

时间:2015-05-12 19:09:38

标签: .net vb.net

进口:

Imports System.Runtime.InteropServices

我的pInvoke:

<DllImport("User32")>
 Private Shared Function ShowWindow(ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
End Function

我正在使用

Dim window As Integer = otherProcess.MainWindowHandle.ToInt32()
ShowWindow(window , 0)

隐藏与我工作的进程不同的进程。 这完全正常,但当我尝试使用

再次显示它
Dim window As Integer = otherProcess.MainWindowHandle.ToInt32()
ShowWindow(window , 1)

然后它将不再显示。我使用了多达11的数字来尝试让其他进程恢复,但它无法正常工作。

我的程序是用VB.NET编写的

1 个答案:

答案 0 :(得分:0)

试试这个

1   contenttypes    0001_initial    2015-04-16 10:09:38

然后

Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As IntPtr, _
ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, _
ByVal cy As Integer, ByVal wFlags As Integer) As Integer
Public Const SWP_SHOWWINDOW = &H40
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1