volta
Anmeldungsdatum: 04.05.2005 Beiträge: 1875 Wohnort: D59192
|
Verfasst am: 27.11.2010, 15:48 Titel: |
|
|
So etwa?
Code: | ' 4 Folgefenster, als modeless dialog
#Include "dialogs.bas"
'http://www.freebasic.net/forum/viewtopic.php?p=47539#47539
Dim Shared As HWND g_Dlg1, g_Dlg2, g_Dlg3, g_Dlg4
Dim Shared As Dword FStyle = WS_OVERLAPPED Or WS_SYSMENU Or WS_VISIBLE
Function FolgeDialogProc4( ByVal hDlg As HWND, _
ByVal uMsg As UINT, _
ByVal wParam As WPARAM, _
ByVal lParam As LPARAM ) As Integer
Select Case uMsg
Case WM_CLOSE
DestroyWindow( hDlg )
g_Dlg4 = 0
End Select
Return 0
End Function
Function FolgeDialogProc3( ByVal hDlg As HWND, _
ByVal uMsg As UINT, _
ByVal wParam As WPARAM, _
ByVal lParam As LPARAM ) As Integer
Select Case uMsg
Case WM_COMMAND
If LoWord(wParam) = 103 Then
If IsWindow( g_Dlg4 ) = 0 Then
Dim As LPDLGTEMPLATE lpdt
Dialog( 1, 120, -12, 110, 80, "Fenster 4", lpdt, FStyle )
LText( 110, 10, 10, 80, 10, "Dies ist eine Textzeile" )
g_Dlg4 = CreateModelessDialog( hDlg, @FolgeDialogProc4, 0, lpdt )
End If
End If
Case WM_CLOSE
DestroyWindow( hDlg )
g_Dlg3 = 0
End Select
Return 0
End Function
Function FolgeDialogProc2( ByVal hDlg As HWND, _
ByVal uMsg As UINT, _
ByVal wParam As WPARAM, _
ByVal lParam As LPARAM ) As Integer
Select Case uMsg
Case WM_COMMAND
If LoWord(wParam) = 102 Then
If IsWindow( g_Dlg3 ) = 0 Then
Dim As LPDLGTEMPLATE lpdt
Dialog( 1, -123, 75, 110, 80, "Fenster 3", lpdt, FStyle )
DefPushButton( 103, -1, 50, 40, 12, "Text ->" )
g_Dlg3 = CreateModelessDialog( hDlg, @FolgeDialogProc3, 0, lpdt )
End If
End If
Case WM_CLOSE
DestroyWindow( hDlg )
g_Dlg2 = 0
End Select
Return 0
End Function
Function FolgeDialogProc1( ByVal hDlg As HWND, _
ByVal uMsg As UINT, _
ByVal wParam As WPARAM, _
ByVal lParam As LPARAM ) As Integer
Select Case uMsg
Case WM_COMMAND
If LoWord(wParam) = 101 Then
If IsWindow( g_Dlg2 ) = 0 Then
Dim As LPDLGTEMPLATE lpdt
Dialog( 1, 120, -12, 110, 80, "Fenster 2", lpdt, FStyle )
DefPushButton( 102, -1, 50, 40, 12, "Fenster 3" )
g_Dlg2 = CreateModelessDialog( hDlg, @FolgeDialogProc2, 0, lpdt )
End If
End If
Case WM_CLOSE
DestroyWindow( hDlg )
g_Dlg1 = 0
End Select
Return 0
End Function
Function MainDialogProc( ByVal hDlg As HWND, _
ByVal uMsg As UINT, _
ByVal wParam As WPARAM, _
ByVal lParam As LPARAM ) As Integer
Select Case uMsg
Case WM_INITDIALOG
If IsWindow( g_Dlg1 ) = 0 Then
Dim As LPDLGTEMPLATE lpdt
Dialog( 1, 0, 0, 110, 80, "Fenster 1", lpdt, FStyle )
DefPushButton( 101, -1, 50, 40, 12, "Fenster 2" )
g_Dlg1 = CreateModelessDialog( hDlg, @FolgeDialogProc1, 0, lpdt )
End If
Case WM_CLOSE
DestroyWindow( hDlg )
Case WM_DESTROY
PostQuitMessage( NULL )
End Select
Return 0
End Function
'=Main=
Dim As LPDLGTEMPLATE lpdt
Dim As HWND hDlg
Dim As MSG wMsg
Dialog( 1, 0, 0, 240, 180, "Hauptfenster", lpdt, FStyle Or DS_CENTER )
LText( 100, 0, 0, 0, 0, "" )'Dummy
hDlg = CreateModelessDialog( 0, @MainDialogProc, 0, lpdt )
Do While GetMessage( @wMsg, NULL, 0, 0 ) <> 0
If IsDialogMessage( hDlg, @wMsg ) = 0 Then
If IsDialogMessage( g_Dlg1, @wMsg ) = 0 Then
If IsDialogMessage( g_Dlg2, @wMsg ) = 0 Then
If IsDialogMessage( g_Dlg3, @wMsg ) = 0 Then
If IsDialogMessage( g_Dlg4, @wMsg ) = 0 Then
TranslateMessage( @wMsg )
DispatchMessage( @wMsg )
End If
End If
End If
End If
End If
Loop
|
_________________ Warnung an Choleriker:
Dieser Beitrag kann Spuren von Ironie & Sarkasmus enthalten.
Zu Risiken & Nebenwirkungen fragen Sie Ihren Therapeuten oder Psychiater. |
|