locked
Communication between normal and elevated apps RRS feed

  • Question

  • Hello! As far as I understand, there is no way for an unelevated application to send WindowsMessage to an administrator one... Yet, I wish to send some information from unelevated explorer right-click event to my app, even if it's in admin role.

    I've thought of only one way, and it seems way too complicated:

    1) If the program starts elevated, it registers a TcpListener and creates a temp registry key, where it stores its PID and port number.

    2) Then once app is started via explorer context menu, it searches the registry for existing processes with the same PID, and then sends info to the elevated instance via Tcp.

     

    Is there any way to make it a bit nicer? Thank you.

    Monday, March 26, 2007 11:20 PM

Answers

  • You can change the window messages that your application is allowed to recieve from unprivileged applications by using the ChangeWindowMessageFilter() function. You should make sure that you carefully audit the security of handlers for any additional messages you choose to accept to ensure you don't create a security hole.
    Tuesday, March 27, 2007 7:45 AM