When I double-click my TrayIcon, I do the following:

<code>
  HWND hwnd1 = ::GetForegroundWindow();
  HWND hwnd2 = ::GetActiveWindow();

  if (hwnd1 != NULL)
  {
   ::SetActiveWindow(hwnd1);
   ::SetFocus(hwnd1);
   ::PostMessage(hwnd1, WM_NULL, 0, 0);
  }
  else
  if (hwnd2 != NULL)
  {
   ::SetFocus(hwnd2);
   ::PostMessage(hwnd2, WM_NULL, 0, 0);
  }

  // obj is the callback passed to me from Javascript
  obj->HandleEvent( (PRInt32)hWnd );
</code>

Note: In fact, I now restore the JS Script Context back to the Javascript
Stack, after looking at the code from XMLHttpRequest. I found that without
this, my callback cannot access my chrome files correctly
(window.open('abc.xul' will pop-up an error saying '/res/abc.xul' is not
found. My relative path should be /content/abc.xul, not /res. I am using
XulRunner 1.8 and 1.9x btw.

Regards,
    Kok Hoor

"dupes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Will you post a small sample?  Maybe I can help.
>


_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to