How to send event to another window process ?

Hello ,

As the subject name pointed out, in brief I want to know how to send event ( like Ph_WM_HIDE ) to another window process not thread.

I made simple applicaiton using PhAB. The scenario is very simple.

  1. Show Simple Window Application
  2. Fork ‘voyager’
  3. want to send Ph_WM_HIDE event in Simplw Window Application to voyager for hiding voyager.

As you know, I have tried to use the PtForwardWindowTaskEvent(…,…) to send event to voyager , but for using it I have to acquire the connection ID. And I don’t know how to get it.

If someone experienced this similar problem and found out the solution or know the solution, please describe how to do it.

I did it based on the site
qnx.com/developer/docs/momen … indowState

As before, I don’t use the sleep() between fork() and PtForwardWindowTaskEvent(). But when I use sleep(10), it is working well.

But still there is a question.
When certain application wants to call the PtForwardWindowTaskEvent() to another Photon window process, is it also photon application ?

I answered this via email.

sorry but I didn’t get your mail.

My e-mail address is wcjung94@hanmail.net .
Thanks.

You need to use PhQueryRids() and the PhQuerySystemInfo(). The first gives you a list of all the regions, the second will allow you to query each region to see who owns it. Based on the pid you get back from spawn() you can find the voyager window.

Thanks, but I wonder how to get the PID from PhQuerySystemInfo(). Or am I misunderstand your words ?

The PID is in the structure. So as you query the system info for each RID you check to see if the PID contained in the structure matches the pid of the process you created. If it does, you have found it’s region. It could have more then one though, so you have to figure out it’s runtime behavior.

If you just want to have a webpage rendered, why not use the PtWebClient widget and make your own browser? It is pretty easy.

Instead of PhQuerySystemInfo(), I use PhRegionQuery() and PhGetConnectInfo(). It was working as I expected.

Thanks for your help. and any comment will be appreciated.

Still I have a question.

When I initiate the Voyager program and after that, I can see two process “voyager” and “vserver” using ‘pidin ar’ command.

And when I initiate one more Voyager , there is still two process “voyager” and “vserver” .

I wonder the voyager or vserver control all Voyager Photon window in QNX. That means that unlike the Mozilla, the all voyager photon windows are thread and live in one process. My guess is right ?
If so, how does another process send event , like HIDE , to each Voyager program respectively ?

Thanks in advance.

No - there are multiple processes. vserver is the backend rendering engine. Using Voyager you can use vserver, opera or mozserver as a rendering engine. You should really look into using the PtWebClient widget and just embed it into your application. I think it will be easier then what you are trying to accomplish.

I am currently trying to get mozilla embedded, but this doesn’t work. Simply my website doesn’t get displayed. Are there any tricks concerning mozserver? vserver and opera (which I have to start in advance to get it work) work fine.

Oh yeah, there are HUGE tricks to make mozserver work properly. ;)

You have to set the cwd to the directory mozserver lives in.
You have to set MOZILLA_FIVE_HOME.

I think that might be it.

CDM would you tell me how exctly did you get mozserver running with PtWebWidget
I’m trying to usePtSetResource( ABW_br1, Pt_ARG_WEB_SERVER, “moziserver”, 0);and always i see
that mozzserver could’n find the some .so which is in the same directoryas mozserver(i’d check it)

Oh - it’s ugly. Here is the code from killerWeb…


        case MOZILLA_BACKEND:
            server = "mozilla";
            chdir( "/opt/Mozilla/mozilla" );
            setenv( "MOZILLA_FIVE_HOME", "/opt/Mozilla/mozilla", 1 );
            std::string libpath;
            if( getenv( "LD_LIBRARY_PATH" )  ) {
                libpath = getenv( "LD_LIBRARY_PATH" );
            }
            libpath += ":/opt/Mozilla/mozilla";
            libpath += ":/opt/Mozilla/mozilla/plugins";
            libpath += ":/opt/Mozilla/mozilla/components";
            setenv( "LD_LIBRARY_PATH", libpath.c_str(), 1 );

            PtSetArg( &args[argCnt++], Pt_ARG_CLIENT_NAME, "MozillaServer",  0 );
            PtSetArg( &args[argCnt++], Pt_ARG_WEB_OPTION, "0", "iUserTextSize" );
            if( !newWindow ) {
                PtSetArg( &args[argCnt++], Pt_ARG_WEB_SERVER, "/opt/Mozilla/mozilla/mozserver",  0 );
            }
            break;

Hope that helps.