Any suggestions on how i can recognise the screens being dsplayed currently, based on which i can take decisions as to what i should do next.
So what do you mean by “screens being displayed currently”? Do you mean where in the Photon space your display is looking? Or do you mean which windows are visible? You might want to check out the “phin” program.
Sorry for the Delayed response.
Assume I have a Popup which can display different Messages.
How can i recognise what Msg is being displayed at a given instant?
You need to give a little bit more context to your question.
Are you talking about a person making a decision or a computer?
Are you talking about trying to read a graphic on the screen and figure out what the words are and what they mean?
correct… reading the graphic from a screen, beased on which a computer will be taking decisions.
You didn’t say which version of QNX you are using. Interestingly I’ve been dealing with a change from 6.3.2 where the documentation describes how to do this correctly, and 6.4/6.5 where it doesn’t. I just received the source code to snapshot to figure this out. You could use the delivered snapshot to grab the graphic on the screen.
How does one interpret the graphic? This is a question outside of QNX. Once a graphic is rendered on the screen, unless you have a way to extract the original ASCII information from a program you are probably SOL.
One might ask how one gets to this question in the first place. Did someone else write the program, and you somehow able to read the graphic screen, but not talk more intimately with the program?
I’m working with QNX 6.2…
How do i get this snapshot of the graphic being displayed?
I was thinking if i could create a Region(sensitive to draw events) in the Photon Event space and tap the draw events sent from my GUI Appln to the Graphic driver. Is it possible?
I think you misunderstand what a draw event is. The draw event of graphic text consists of a blit to the screen of a graphic that was created with the font manager. There’s no text at that point. I don’t know if 6.2 supports snapshot. In 6.3 it is a utility you can find on the shelf menu.
I do understand the draw events do not contain the actual text.
I decided to get some state info from my application under test rather than recognising the screen being displayed.
Also in QNX 6.2.0 the snapshot utility has fewer options, it requires human intervention to choose the area that is to be captured. I wont be able to script it.
The photon routine to read the screen FOr QNX 6.3 is PgReadScreen(). I think it was the same in QNX 6.2 but you will need to check the documentation. It has limitations, for example you can only read a part of the screen
that is actually showing. I don’t know what good this will do you as you will have to interpret graphical information, which is
at best hard.