Focus changes while printing
Focus changes while printing
We have changed our application to take all printings to printer as backround process. Within the application we use a separate thread and calls the R&R dll-interface.____Every time, if the thread calls the execute function to start printing, the focus of the main program will be lost for some milliseconds and came back. This effect occurs without any dialog from R&R is displaying. ____Because the the main process lost the focus, the users cant work continuous in the main programm.____Therefor my question, is it possible to supress the focus changing, if no dialog from R&R runtime are displaying?____regards__Friedhelm
-
- Posts: 32
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Focus changes while printing
You did not say what your program is programed in! I program in a dBase programming language and the only way that I can keep the dialog box on top, is to force my program page to be the top modal or top page on the screen. Of course this may not make any since to you if you do not program in a dBase program. ____There must be some type of a function that requires your screen of the program to be the top screen.____It would be nice if the report writer screens had a top most function in it!____Tom Freitas
-
- Posts: 32
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Focus changes while printing
You did not say what program you are using to call the R&R ReportWriter! I use a database program and sometimes I have it call up the dialog of Screen/Print/Export or I might have it simply display or print the report. Displaying is the best since this allows the user to print one page or all pages or simple cancel the report.____Anyway, in order for the R&R screens to appear, you must make your program the top most screen. But even that, if someone click on the screen after starting the report, then the R&R screen might go to the background.____I agree, that forcing the R&R screens to be top most screens within the R&R main program would be ideal, if it can be done.____Good Luck,____Tom Freitas
==> RE: Focus changes while printing
Hi Tom, ____The applications are written in Xbase++ (Alaska Softare) and uses the dll-interface from R&R (Version 12). ____For each document we are send to the printer, we generate a PDF-file and have to log the state of the print process. ____To determin if a document are printed or any error occured, we control all print jobs with windows api calls in the windows printing queue. Is a job serviced by windows printing system, we write back the result into a database file.____To do this on a better way, we are changed our application to a and use a windows thread based system (also written in Xbase++). ____All this works very fine, but we have only one little problem:__Because all print routines are now serviced by a thread, normaly the user can continue the application. But every time if the thread are called the R&R runtime function "execute", the focus from the current application dialog are lost for some milliseconds. This occurs in the same timeframe, if the R&R icon are displaying in the windows taskbar.____My question was: Why does the R&R runtime needs a windows focus, while no R&R dialog are visible (only the icon in the taskbar)? And further, can I supress this focus changing?______regards __Friedhelm ______________e timeframe.________But just in the moment if the thread called the R&R-runtime, the focus are from the main application window are changed for a little time frame and came back. ____Now if the thread are called the R&R runtime ______ and call windows api function to control the windows print queues (after finished each print job we have to . For this we use the amyuni PDF printer driver (newest version). Because the users of this application are generated many documents, we are switched the print routines to a windows thread based system.
-
- Posts: 13
- Joined: Tue Oct 10, 2017 12:44 pm
===> RE: Focus changes while printing
Have you tried to use the lbackground parameter of runshell in Xbase++. I have not tried this so I don^t know if it has any effect.____Cliff.
===> RE: Focus changes while printing
I get away from as much external files as possible, so what I do is the following;____I created a file called permatrs.dbf This file has all the fields that I want for calling up various things. You might have a field called year or one called month or product_number or anything else that you can think of. This table has only one record in it. ____I then have a table where I store all the users names along with other information about that user.____Whenever a user logs on, the system looks for the user in the user file. I then have a variable called temp_dbf which is the letter U for user and the record number of that user in the user file. If the system can not file a user, such as a guest, then it automatically assigns U0 to the temp_dbf variable.____Then when a report is ran, the system copies the file permatrs.dbf to the users variable with a p_ in front so that I know it stands for Permaters.dbf____All my reports are in the rrwrunin.dbf file. I can then change one of the ri_alias fields to read __replace all ri_alias1 with "permatrs="+test && where test = "p_"+temp_dbf+".dbf"____In the report screen I link to the permatrs.dbf as a record link. Now I have full control over my reports by using the unique copy of the permatrs.dbf without having to use an outside source.____Tom Freitas__