Ejemplo n.º 1
0
        //This just solves a casting problem.
        //All calls on a unamangedobject are intercepted, so none of this ever gets called.
        //We can cast a proxy to an UnmanagedObject to any interface, even if it doesn't support it.
        //This because calls get intercepted and called from the interception code... if an unknown call is encountered null is returned.
        //However a direct reference (no proxy) to the remote object can't be cast.
        //Internally, immediately after the injection, we create the first remoteobject for the IClient interface.
        //At that point we have a direct reference and no proxy (we are still on the injected code), so we can't cast to IClient...
        //To allow us to return an object as "IClient" rather than RemoteObject to the user app...
        //we need a dummy implementation, so that we can cast before we return.
        //Once we return the object (across remoting boundaries.. Client.exe->user app) a proxy is created on the user app (since this class has a proxy attribute),
        //so all IClient calls get intercepted by our proxy and these funtions here become meaningless.

        public void SysMessage(uint color, uint font, string message)
        {
            //dummy event executions to get rid of the annoying 'is never used' messages
            OnKeyDown(0, true);
            OnKeyUp(0);
            OnQuit();
            Win32API.Imports.MSG msg = new Win32API.Imports.MSG();
            OnWindowsMessage(ref msg);

            throw new NotImplementedException();
        }
Ejemplo n.º 2
0
 public bool curclient_OnWindowsMessage(ref Win32API.Imports.MSG msg)
 {
     Win32API.WindowHandler.Messages message = (Win32API.WindowHandler.Messages)msg.message;
     AddToListBox(message.ToString());
     return(true);
 }