ShowWindow”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。
32位和64位的问题
'64
'Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'32
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Int32, ByVal nCmdShow As Int32) As Long
Private Const SW_SHOWNOACTIVATE = 4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ShowWindow(Me.Handle, SW_SHOWNOACTIVATE)
End Sub
暂时没有评论