1,451
社区成员
发帖
与我相关
我的任务
分享
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4260
ClientLeft = 60
ClientTop = 450
ClientWidth = 6600
LinkTopic = "Form1"
ScaleHeight = 4260
ScaleWidth = 6600
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
Height = 3615
Left = 0
ScaleHeight = 3555
ScaleWidth = 6315
TabIndex = 2
Top = 600
Width = 6375
End
Begin VB.TextBox Text1
Height = 495
Left = 240
TabIndex = 1
Text = "Text1"
Top = 0
Width = 3135
End
Begin VB.CommandButton Command1
Caption = "挂起30秒,模拟打开网页时卡住"
Height = 375
Left = 3480
TabIndex = 0
Top = 120
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Text1.Text = "看看主程序中的文本框能否输入文字"
DoEvents
Sleep 1000 * 30
End Sub
Private Sub Form_Load()
Dim apath As String
apath = App.Path
If Right(apath, 1) <> "\" Then apath = apath & "\"
If Len(Command$) = 0 Then
Me.Show
Command1.Visible = False
Shell apath & App.EXEName & ".exe " & Picture1.hWnd
Else
SetParent Me.hWnd, Val(Command$)
Me.Caption = "这是另一进程的窗口"
Me.Show
Me.WindowState = 2
End If
End Sub
MSG msg;
if (GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}