Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 05 JAN 1998 08:38:21PM Michèle wrote:

Background:

The application I am working on needs to get some data from a portable barcode reader, so I have to run another program - in modal mode - from within the OpenInsight application to collect the data and place it in a file, then the OpenInsight application processes the contents of that file. I use the "ReturnValue=Utility('RUNWIN',cmd,-1)" code to run the external program (where cmd contains the command line call of the application to be launched)

The Hickup:

The external application runs OK, the only problem is that when the external application is called, and just before it is displayed, the OpenInsight window loses focus and system focus changes briefly to the previous window used (let's call it WindowX), then, when the upload is completed and the external program is terminated, focus is set to WindowX and the OpenInsight window does not regain focus unless the mouse is moved. As soon as the mouse is moved, the OpenInsight application regains focus and processing resumes OK.

Does anyone have any suggestions as to how I can avoid letting the OpenInsight application lose focus?


At 06 JAN 1998 07:30AM Mike Ruane wrote:

Michele-

Have you tried setting the 'FOCUS' property of 'SYSTEM' to your OI application just after the Utility command? That may work.

Hope it helps-

Mike Ruane

WinWin Solutions Inc.


At 08 JAN 1998 06:09PM Michèle wrote:

Mike,

Thanks for your response, I have tried using Set_Property FOCUS just after the RUNWIN command, I also tried sending it through the RUNWIN callback function to no avail. I have to physically return control to the OI application for the processing to proceed.


At 09 JAN 1998 07:26AM Cameron Revelation wrote:

Michèle,

Can you post the code you are using to run the application? What application are you running? Is it a 16-bit or 32-bit app?

Cameron Purdy

Revelation Software


At 09 JAN 1998 09:37AM Aaron Kaplan wrote:

Could you set the focus through a timer event or use block events?

When the upload is happening, is the engine processing or idle?

[email protected]

Sprezzatura Ltd

www.sprezzatura.com_zz.jpg


At 10 JAN 1998 01:54AM Michèle wrote:

Cameron,

The communication application is a 32-bit application written in Visual basic version 5.

The following is the code I am using to run the communication application:

Declare Function Utility, Message_Box, RowExists, Start_MDIChild
Declare Subroutine Msg, Send_Info
Open 'DATABASE_SETTINGS' to DSFile Else
	ErrVal=Message_Box(@Window,'Unable to open the Database table!','Table Access Error',16)
	Return 0
End
MDIFrame=Get_Property(@Window, 'MDIFRAME')
DBCtrl=MDIFrame:'.DISPLAYED_AREA'
DBId=Get_Property(DBCtrl,'TEXT')
Read DSRec from DSFile, DBId Else DSRec='
If DSRec  '' Then
	CommDir=DSRec
	CommApp=CommDirlen(CommDir),'B\'
	CommDir=CommDir1,len(CommDir)-len(CommApp)
	n=len(CommDir)
	If CommDirn,1=\" then CommDir=CommDir1,n-1
	StoreFile=CommDir:'\Storage\allocate.txt'
  • cmd=CommDir:'\COMTOOL.EXE /U /F=:StoreFile
	cmd=CommDir:"\":CommApp:' /U /F=:StoreFile
	If DSRec  '' Then cmd=cmd:' /c=:DSRec
	HWnd=Get_Property(@Window,'TEXT')
	cmd=cmd:' /x=:hwnd
	ReturnValue=Utility('RUNWIN',cmd,-1)
  • Process uploaded data
	retval=Utility('CURSOR','H')

…..

from here onwards, the code processes the uploaded data. It continues automatically after the focus is reset to the OI application.

Note that the" cmd=cmd:'/x=hwnd" line was added to get the VB application to return focus to the OI application when it is finished, but that would only work if I launch it modelessly (which isn't the case).


At 10 JAN 1998 02:24AM Michèle wrote:

Aoron,

As long as the communications application is running, OEngine has the following status "Engine Status:PROCESSING", which is normal since I am running the communication application in a modeless mode.

I guess I could use BLOCK_EVENTS if I can't get the modeless mode to run properly, the problem I'm having is that I can't tell when the communication application finishes. I tried to use EXITCODE, from what I read in the help file it is supposed to return the exit code of the last application launched, which I presumed should be this one, but the EXITCODE=Get_Property('SYSTEM', "EXITCODE") is returning either 0 or -1 straight away. Is there another way of knowing if another application is open in Windows?

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/4f0a5616d922991d852565840009013e.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1