Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Provera aktivnosti aplikacija iz Access-a

[es] :: Access :: Provera aktivnosti aplikacija iz Access-a

[ Pregleda: 2230 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

mustur
Mustur Gojko
Beograd

Član broj: 32122
Poruke: 48
*.dynamic.sbb.co.yu.



+1 Profil

icon Provera aktivnosti aplikacija iz Access-a25.03.2008. u 14:47 - pre 195 meseci
Kako da iz Access-a proverim da li je neki program uključen (aktivan), te da ga uključim ako isti nije.
Unapred zahvalan
 
Odgovor na temu

Getsbi

Moderator
Član broj: 124608
Poruke: 2831



+45 Profil

icon Re: Provera aktivnosti aplikacija iz Access-a25.03.2008. u 17:27 - pre 195 meseci
Pokretanje programa ide ovako:
Shell "C:\putanja do programa\program.Exe", vbNormalFocus ' Pokrece program
Kako da se ispita da li je već aktivan to ne znam. Možda neko ima ideju ako je to iz Access-a moguće.
 
Odgovor na temu

domaci_a_nas
PHP developer

Član broj: 42333
Poruke: 524
*.dynamic.sbb.co.yu.



+8 Profil

icon Re: Provera aktivnosti aplikacija iz Access-a25.03.2008. u 22:19 - pre 195 meseci
Na adresi http://www.freevbcode.com/ShowCode.asp?ID=701 se nalazi kod za prikaz svih programa u listboxu. U modulu ćeš naći funkcije koje pune taj listbox, njih možeš otvoriti u notepadu ako nemaš vb6.
Ozbiljan i odgovoran mladić
 
Odgovor na temu

mustur
Mustur Gojko
Beograd

Član broj: 32122
Poruke: 48
*.dynamic.sbb.co.yu.



+1 Profil

icon Re: Provera aktivnosti aplikacija iz Access-a26.03.2008. u 12:20 - pre 195 meseci
Treba da se pre izvršenja jedne procedure proveri aktivnost jedne male aplikacije.
Ako je aplikacija aktivna procedura se izvršava, ako nije prvo se ona aktivira pa se ista procedura izvršava. Sve bi trebalo da bude u pozadini tj neprimetno za korisnika Access-a.
Hvala
 
Odgovor na temu

Trtko
Koprivnica

Član broj: 69494
Poruke: 695
*.bilokalnik.hr.



+8 Profil

icon Re: Provera aktivnosti aplikacija iz Access-a28.03.2008. u 08:45 - pre 195 meseci
Našao ali nisam isprobao, ali mislim da bi ovo pomoglo

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Const GW_HWNDNEXT = 2
Dim mWnd As Long

Function InstanceToWnd(ByVal target_pid As Long) As Long
Dim test_hwnd As Long, test_pid As Long, test_thread_id As Long
'Find the first window
test_hwnd = FindWindow(ByVal 0&, ByVal 0&)
Do While test_hwnd <> 0
'Check if the window isn't a child
If GetParent(test_hwnd) = 0 Then
'Get the window's thread
test_thread_id = GetWindowThreadProcessId(test_hwnd, test_pid)
If test_pid = target_pid Then
InstanceToWnd = test_hwnd
Exit Do
End If
End If
'retrieve the next window
test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
Loop
End Function

Private Sub Form_Load()

Dim Pid As Long
'Lock the window update
LockWindowUpdate GetDesktopWindow
'Execute notepad.Exe
Pid = Shell("c:\windows\notepad.exe", vbNormalFocus)
If Pid = 0 Then MsgBox "Error starting the app"
'retrieve the handle of the window
mWnd = InstanceToWnd(Pid)
'Set the notepad's parent
SetParent mWnd, Me.hwnd
'Put the focus on notepad
Putfocus mWnd
'Unlock windowupdate
LockWindowUpdate False
End Sub


Private Sub Form_Unload(Cancel As Integer)
'Unload notepad
DestroyWindow mWnd
'End this program
TerminateProcess GetCurrentProcess, 0
End Sub
 
Odgovor na temu

[es] :: Access :: Provera aktivnosti aplikacija iz Access-a

[ Pregleda: 2230 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.