11 个解决方案
#1
这个应该用api了,搜索一下吧
#2
对,先FindWindow,再ShowWindow
#3
如果用 windowstate可以么?
#4
DDE工程间数据通信http://download.csdn.net/source/1740629
#5
"如果用 windowstate可以么?"
这只是VB6自己的Form的属性吧,而你要跨进程操作:看这两个API的帮助和示例吧,很容易的
http://allapi.mentalis.org/apilist/FindWindow.shtml
http://allapi.mentalis.org/apilist/ShowWindow.shtml
这只是VB6自己的Form的属性吧,而你要跨进程操作:看这两个API的帮助和示例吧,很容易的
http://allapi.mentalis.org/apilist/FindWindow.shtml
http://allapi.mentalis.org/apilist/ShowWindow.shtml
#6
Option Explicit
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOWMINIMIZED As Long = 2&
Private Const SW_SHOWMAXIMIZED As Long = 3&
Private Const SW_SHOWNORMAL As Long = 1&
'最大化
Private Sub Command1_Click()
Call ShowWindow(Form1.hwnd, SW_SHOWMAXIMIZED)
End Sub
'最小化
Private Sub Command2_Click()
Call ShowWindow(Form1.hwnd, SW_SHOWMINIMIZED)
End Sub
'恢复窗口原来大小
Private Sub Command3_Click()
Call ShowWindow(Form1.hwnd, SW_SHOWNORMAL)
End Sub
#7
恩 如果我把这两个软件合在一个工程里是否就可以了呢? 因为vb接触的不多 API更是少 呵呵 所以想能不能简单解决下
#8
恩 如果我把这两个软件合在一个工程里是否就可以了呢? 因为vb接触的不多 API更是少 呵呵 所以想能不能简单解决下
#9
如果在同一个程序里,就不用api了,用窗体的show hide就可以了
#10
Option Explicit
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOWMINIMIZED As Long = 2&
Private Const SW_SHOWMAXIMIZED As Long = 3&
Private Const SW_SHOWNORMAL As Long = 1&
Dim lngProcessID As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'恢复原始大小
Private Sub Command1_Click()
Dim lngP As Long
lngP = ShowWindow(lngP, SW_SHOWNORMAL)
End Sub
'最大化
Private Sub Command2_Click()
Dim lngP As Long
lngP = ShowWindow(lngP, SW_SHOWMAXIMIZED)
End Sub
'最小化
Private Sub Command3_Click()
Dim lngP As Long
lngP = ShowWindow(lngP, SW_SHOWMINIMIZED)
End Sub
Private Sub Form_Load()
Command1.Caption = "恢复原始大小"
Command2.Caption = "最大化"
Command3.Caption = "最小化"
lngProcessID = FindWindow(vbNullString, "显示的窗体的标题")
End Sub
#11
可以,用两个form(再加一个,分别写你的东西)
'form1 code
Private Sub Command1_Click()
Form2.WindowState = 2
Form1.WindowState = 1
End Sub
Private Sub Form_Load()
Form2.Show
Form2.WindowState = 1
End Sub
'form2 code
Private Sub Command1_Click()
Form2.WindowState = 1
Form1.WindowState = 2
End Sub
#1
这个应该用api了,搜索一下吧
#2
对,先FindWindow,再ShowWindow
#3
如果用 windowstate可以么?
#4
DDE工程间数据通信http://download.csdn.net/source/1740629
#5
"如果用 windowstate可以么?"
这只是VB6自己的Form的属性吧,而你要跨进程操作:看这两个API的帮助和示例吧,很容易的
http://allapi.mentalis.org/apilist/FindWindow.shtml
http://allapi.mentalis.org/apilist/ShowWindow.shtml
这只是VB6自己的Form的属性吧,而你要跨进程操作:看这两个API的帮助和示例吧,很容易的
http://allapi.mentalis.org/apilist/FindWindow.shtml
http://allapi.mentalis.org/apilist/ShowWindow.shtml
#6
Option Explicit
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOWMINIMIZED As Long = 2&
Private Const SW_SHOWMAXIMIZED As Long = 3&
Private Const SW_SHOWNORMAL As Long = 1&
'最大化
Private Sub Command1_Click()
Call ShowWindow(Form1.hwnd, SW_SHOWMAXIMIZED)
End Sub
'最小化
Private Sub Command2_Click()
Call ShowWindow(Form1.hwnd, SW_SHOWMINIMIZED)
End Sub
'恢复窗口原来大小
Private Sub Command3_Click()
Call ShowWindow(Form1.hwnd, SW_SHOWNORMAL)
End Sub
#7
恩 如果我把这两个软件合在一个工程里是否就可以了呢? 因为vb接触的不多 API更是少 呵呵 所以想能不能简单解决下
#8
恩 如果我把这两个软件合在一个工程里是否就可以了呢? 因为vb接触的不多 API更是少 呵呵 所以想能不能简单解决下
#9
如果在同一个程序里,就不用api了,用窗体的show hide就可以了
#10
Option Explicit
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOWMINIMIZED As Long = 2&
Private Const SW_SHOWMAXIMIZED As Long = 3&
Private Const SW_SHOWNORMAL As Long = 1&
Dim lngProcessID As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'恢复原始大小
Private Sub Command1_Click()
Dim lngP As Long
lngP = ShowWindow(lngP, SW_SHOWNORMAL)
End Sub
'最大化
Private Sub Command2_Click()
Dim lngP As Long
lngP = ShowWindow(lngP, SW_SHOWMAXIMIZED)
End Sub
'最小化
Private Sub Command3_Click()
Dim lngP As Long
lngP = ShowWindow(lngP, SW_SHOWMINIMIZED)
End Sub
Private Sub Form_Load()
Command1.Caption = "恢复原始大小"
Command2.Caption = "最大化"
Command3.Caption = "最小化"
lngProcessID = FindWindow(vbNullString, "显示的窗体的标题")
End Sub
#11
可以,用两个form(再加一个,分别写你的东西)
'form1 code
Private Sub Command1_Click()
Form2.WindowState = 2
Form1.WindowState = 1
End Sub
Private Sub Form_Load()
Form2.Show
Form2.WindowState = 1
End Sub
'form2 code
Private Sub Command1_Click()
Form2.WindowState = 1
Form1.WindowState = 2
End Sub