Page 1 of 1
Start and Kill a 3rd party aplication
Posted: Fri May 29, 2020 1:14 am
by salamandra
Hi to all,
Hope you all and you families are well and safe
I need a help regarding how to start and to "kill" a 3rd party application.
I need to start a 3rd party application after my system starts (easy, using
EXECUTE) and need to "Kill" this application
before shutdown my system.
Any ideia ??
[]´s Salamandra.
Re: Start and Kill a 3rd party aplication
Posted: Fri May 29, 2020 2:01 am
by AUGE_OHR
hi,
the "easy" Way, to use EXECUTE -> _execute -> ShellExecute did not give you a handle of App which have start.
in this Case you have to "find" Windows to terminate it
Code: Select all
HB_FUNC( FINDWINDOW )
{
hb_retnl( ( LONG_PTR ) FindWindow( hb_parc( 1 ),
hb_parc( 2 ) ) ) ;
}
Code: Select all
LOCAL nHandle := FINDWINDOW("Title_Of_Window")
IF !EMPTY(nHandle)
SendMessage( nHandle, WM_CLOSE, 0, 0 )
ENDIF
---
better Way i to use CreateProcess() like WAITRUN in c:\hmg.3.4.4\SOURCE\c_winapimisc.c
as i have not made it under harbour (only Xbase++) i can´t tell you hole Way, only Direction.
Re: Start and Kill a 3rd party aplication
Posted: Fri May 29, 2020 3:37 am
by bpd2000
salamandra wrote: ↑Fri May 29, 2020 1:14 am
Hi to all,
Hope you all and you families are well and safe
I need a help regarding how to start and to "kill" a 3rd party application.
I need to start a 3rd party application after my system starts (easy, using
EXECUTE) and need to "Kill" this application
before shutdown my system.
Any ideia ??
[]´s Salamandra.
Visit
https://www.hmgforum.com/viewtopic.php? ... ill#p39513
Re: Start and Kill a 3rd party aplication
Posted: Fri May 29, 2020 3:58 pm
by salamandra
Hi AUGE_OHR & bpd2000,
Thank you very much for your help.
I´ll try
[]´s Salamandra.