I've been created an app presented on the picture below:
https://drive.google.com/open?id=1NVTG4 ... JxUjH5zG5j
Pressing 1. button shows the window with chart. This window appears thanks to the Procedure:
Code: Select all
Sub Balistic_Curve(Wy As Double, Voy As Double, Cd As Double, p As Double, S As Double, m As Double)
'' Make new dialog screen
Screen 20 ' Here is the new window accelerator
' The code of procedure is hidden
End Sub
Only closing the parent (main app) window by pressing 3. button has effect: both windows are closed.
My question is what kind of WM_... should I use to pass the code below:
Code: Select all
Function DlgProc(ByVal hWin As HWND,ByVal uMsg As UINT,ByVal wParam As WPARAM,ByVal lParam As LPARAM) As Integer
Dim As Long id, Event
Dim hChildWin As HWND ' Handler to the child window
Static As Double Wy, Uyo, Voy, k, Cd, p, S, m, t
Static As String*13 WyS, UyoS, VoyS, kS, CdS, pS, SS, mS, tS
Select Case uMsg
Case WM_INITDIALOG
'
Case WM_CLOSE
EndDialog(hWin, 0)
'
Case WM_DESTROY ' What kind of WM_... should I Use ???
CloseWindow(hChildWin) ' Closing the child window, right ???
'
Case WM_COMMAND
id=LoWord(wParam)
Event=HiWord(wParam)
Select Case id
Case IDC_BTN1
GetDlgItemText(hWin, IDC_EDT3, WyS, Sizeof(WyS))
GetDlgItemText(hWin, IDC_EDT7, CdS, Sizeof(CdS))
GetDlgItemText(hWin, IDC_EDT6, pS, Sizeof(pS))
GetDlgItemText(hWin, IDC_EDT5, SS, Sizeof(SS))
GetDlgItemText(hWin, IDC_EDT4, mS, Sizeof(mS))
Wy = Val(WyS)
Voy = Val(VoyS)
Cd = Val(CdS)
p = Val(pS)
S = Val(SS)
m = Val(mS)
Balistic_Curve(Wy, Voy, Cd, p, S, m) ' The child window appears.
hChildWin = GetWindow(hWin, 5) ' Getting Handler to the child window, right ???
'
Case IDC_BTN2
'
'
End Select
Case WM_SIZE
'
Case Else
Return FALSE
'
End Select
Return TRUE
End Function