https://www.ohjelmointiputka.net/koodivinkit/
Kuinkas tuota käyttäen voisi laittaa halutessa ohjelmia esille? Esimerkiksi jos siinä on nappula show ja siellä on vaikka form2 ja form1:ssä lista.
Lähetät käskyjä PostMessage apilla halutulle ohjelmalle. Hausta löytynee jokin vanhempi keskustelu samasta aiheesta.
AppActivate(mitä otsikkopalkissa lukee)
Koitappa vaikka näin
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetNextWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const SW_SHOW = 5
Const GW_HWNDFIRST = 0
Const GW_HWNDNEXT = 2
Private Sub Form_Click()
Dim uwnd As Long, onimi As String * 256
Dim s1 As String, s2 As String
Dim num As Long, yht As Integer
uwnd = FindWindow(s1, s2)
uwnd = GetWindow(uwnd, GW_HWNDFIRST)
Do While uwnd <> 0
num = GetWindowText(uwnd, onimi, 256)
If num > 0 Then
List1.AddItem onimi
yht = yht + 1
End If
uwnd = GetNextWindow(uwnd, GW_HWNDNEXT)
Loop
Caption = "Yhteensä: " & yht
End Sub
Private Sub Command1_Click()
Dim hwnd As Long
hwnd = FindWindow(vbNullString, List1.List(List1.ListIndex))
X = ShowWindow(hwnd, SW_SHOW)
End SubAihe on jo aika vanha, joten et voi enää vastata siihen.