Announcement

Collapse
No announcement yet.

Masquerading skinned application

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Masquerading skinned application

    Hi guys,

    I wonder if anybody has got any ideas about this.

    We want to embed OzieExplorer, a topographcial mapping application into RR. When doing this from RR, Ozie is not very well behaved if embedded in RR and we are close to completing a Skinbedder skin for it. See http://www.mp3car.com/vbulletin/sb-s...iexplorer.html

    Ozie has an interface DLL and I am considering writing a RR plugin for it using Visual C as being able to access some features from RR will also be very useful. This DLL requires the Ozie application to be open and communicates with Ozie using the same WM_COPYDATA messaging that RR uses. However, once the OziExplorer application is embedded in Skinbedder, its window name and class disappears so it can't be found.

    I think the only solution around this problem is that the RR Plugin needs to open a hidden window with the same class and name details as the Oziexplorer application (so the Ozie DLL can find an application) and intercept the messages from the Ozie DLL and redirect them to Skinbedder.

    Ani ideas, thoughts or sample code would be appreciated.

    Rod
    RodW
    2007 Toyota Hilux with a CarPC..

    Worklog: http://www.mp3car.com/vbulletin/work...ota-hilux.html
    OziExplorer GPS Embedded in RR: http://www.mp3car.com/vbulletin/sb-s...iexplorer.html

  • #2
    I know absolutely nothing about Visual C, but I do know that AutoIt has an option to look for child windows (Such as just about any program that is embedded into RR is)

    There is most likely a way to do the same thing in Visual C.

    There is also the option to look for the window handle, instead of just the name.

    In AutoIt for instance the command is: Opt("WinSearchChildren", 2).

    I am clueless to Visual C, but hopefully that will give you a direction to look get it to work.
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

    Comment


    • #3
      Thanks John, that is useful info. I tracked it down in VC

      So the approach will be to:
      1. use FindWindow to find the toplevel window handle (in this case SkinBedder)
      2. use FindWindowEx to find the child window (in this case OzieExplorer)
      3. Raise a new window with the same name and class as the OziExplorer
      4. Capture the WM_COPYDATA messages that the Ozi DLL sends to the OziExplorer application. Still researcing that one, but I got some sample code somewhere

      Rod
      RodW
      2007 Toyota Hilux with a CarPC..

      Worklog: http://www.mp3car.com/vbulletin/work...ota-hilux.html
      OziExplorer GPS Embedded in RR: http://www.mp3car.com/vbulletin/sb-s...iexplorer.html

      Comment


      • #4
        Thanks for the tip, I got this working, It was simply a matter of opening a window, drilling own into Skinbedder a couple of levels to find the window I needed and then using the Windows messaging loop to relay messages each way. I am doing thi sin a simple application that opens a window.

        Now all I need to do is write the DLL. Hopefully I can move the magic window into the DLL so I don't need to have a separate window open to do the magic.

        Here is the message processing code:
        Code:
        	case WM_COPYDATA:
        		cd = (PCOPYDATASTRUCT) lParam;
        		if(hWnd == Ozi){
        			// The data has come from Ozie, send to the DLL
        			RetVal = SendMessage(OziDLL,WM_COPYDATA, wParam, lParam);
        			return RetVal;
        		}
        		else{
        			// Not from Sb, must be from DLL
        			OziDLL = hWnd;	// Save the DLL handle	
        			RetVal = SendMessage(Ozi,WM_COPYDATA, wParam, lParam);
        			return RetVal;
        		}
        		break;
        And here is the code to dig out the window.
        Code:
           Sb = FindWindow(NULL,"OziEmbedded"); //SB Window Title
           if(Sb){
        		OziWindow = FindWindowEx(Sb,NULL,"TWindowContainer","OZIWINDOW");  //SB  embed statement
        		if (OziWindow){
        			Ozi = FindWindowEx(OziWindow,NULL,"TfmMainForm",NULL); //The Window we want
        		}
           }
        Rod
        RodW
        2007 Toyota Hilux with a CarPC..

        Worklog: http://www.mp3car.com/vbulletin/work...ota-hilux.html
        OziExplorer GPS Embedded in RR: http://www.mp3car.com/vbulletin/sb-s...iexplorer.html

        Comment

        Working...
        X