FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to break WaitRun()
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
How to break WaitRun()
Posted: Tue Aug 27, 2013 09:40 AM

Hi,
How to break WaitRun() becouse if application is closed it is still active until started program with WaitRun() is active.
Best regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to break WaitRun()
Posted: Tue Aug 27, 2013 11:24 AM

WaitRun() tries to create the process and if it is not possible then it returns:

  if( ! CreateProcess( 0, ( LPSTR ) hb_parc( 1 ), 0, 0, FALSE,
                       CREATE_NEW_CONSOLE | NORMAL_PRIORITY_CLASS,
                       0, 0, &StartupInfo, &ProcessInfo ) )
    hb_retnl( -1 );
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: How to break WaitRun()
Posted: Tue Aug 27, 2013 02:23 PM

Antonio
Thanks for reply
And what if process is created (program i started with waitrun())
How to kill that proccess (end started program from FW application)
before closing fivewin application.

Best regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to break WaitRun()
Posted: Wed Aug 28, 2013 06:02 AM

SendMessage( FindWindow( 0, "Called app title" ), WM_CLOSE )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: How to break WaitRun()
Posted: Mon Sep 02, 2013 07:15 AM

Antonio
1.
I dont know the app title (main window title) becouse it is changing while executing ...
Need i use GetTasks() ?
GetTasks() for all 16bit apps return app title and for second parameter always C:\WINDOWS\System32\ntvdm.exe
2.
If WaitRun() is used is it possible to start another application with WaitRun() or WinExec() ... or first started app must be closed?

Best regards,

Continue the discussion