Home > Software engineering > How to use the DLL API will MATLAB generated form embedded in VB form??
How to use the DLL API will MATLAB generated form embedded in VB form??
Time:10-17
How to use the DLL API will MATLAB generated form embedded in VB form??
CodePudding user response:
Thinking: 1, use FindWindow lookup Matlab generated form 2, use SetParent set the form to the VB program forms of form,
For example, if: Windows's own calculator window is Matlab generated form, according to the following code processing:
Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click () Dim lngChildHwnd As Long Dim lngP As Long LngChildHwnd=FindWindow (vbNullString, "????? Present ") LngP=SetParent (lngChildHwnd, Me. HWnd) End Sub
Private Sub Form_Load () The Shell "c: \ Windows \ system32 \ calc exe", vbNormalFocus Me. WindowState=2 End Sub