Results 1 to 6 of 6

Thread: Is there a way to remove the menu bar from and embedded application

  1. #1
    Variable Bitrate
    Join Date
    Nov 2006
    Posts
    265

    Is there a way to remove the menu bar from and embedded application

    This question probably goes back to antiquity as far as RR is concerned, but here goes, and yes I have searched and generally get 500 hits.

    I am embedding an application which appears to be a well behaved Windows application. RR handles removal of the title bar and scales the application to fit the defined application area (Axx) in the skin. Transparency works just fine and I can "click through" as expected.

    My problem is the menu bar just below the title bar. I vaguely remember eliminating the nRoute menu bar when I was using nRoute but can't find that code.

    I have tried clipping (Cxx) the area where the menu bar is but to no avail. I even tried clipping everything in the Axx area but the menu bar. That didn't work either.

    When I try clipping should I allow for title bar and menu bar, i.e., am I clipping too little?

    I also tried writing an AutoIt script running in a separate process to play with regions and successfully eliminated the menu bar only to have RR "remove" my regions and re-show the menu bar when RR re-embedded the application window (I do do love timing issues and two programs doing the same thing to the same thing at the same time).

    So, is there a defined way to eliminate the top 25 or so pixels (menu bar) from the embedded application area so I can "see through" it to the RR skin.

    Regards,
    Jim


    P.S. Might be nice to have parms on the Axx skin command to define the area or top amount to be removed from the application window when embedding since, according to old RR source, RR uses regions when embedding anyway.

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,818
    All RR does is remove the border, resize and position the application into the defined space.

    I would think that (depending on the application) when you resize the window, it may reposition/recalculate all of it's internal objects -- including the menu bar.

    The "best" solution would be to find/locate the menu window (child to the window being embedded) and make it invisible. This can be done with the FindWindoeEX and ShowWindow API calls, but it requires you being able to find the menu window consistently. The problem is that this stuff varies a lot from the behavior of each application so it's hard to tell how well it will work.

    The DESIRED solution would be to be able to skin the application or hide the menu using the application's own settings.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    Variable Bitrate
    Join Date
    Nov 2006
    Posts
    265
    guino,

    Many thanks. I must have remembered what I did with nRoute incorrectly. I will look into some additional approaches.

    Regards,
    Jim

  4. #4
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,818
    Making an extension plugin COULD help if the application allow you to stick it INTO RR's screen - then all you'd have to do is position the window on a 25 pixel offset from the embedding frame. But I have to warn you that many applications crash when you do that.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  5. #5
    Variable Bitrate
    Join Date
    Nov 2006
    Posts
    265
    guino,

    I found my solution. I use AutoIt scripting extensively for things other than DLLs and WM6 work for which I use CPP and C# respectively. If I am doing portable stuff I use Java as I work with both Windows and several flavors of Linux.

    Anyway, AutoIt has an almost complete set of functions for the Windows API and I found the function that turns off the menubar on any window that uses the Windows menu API.

    The code is very simple and I call the script whenever the embedded application is executed which is primarily by "LOAD".

    Just for anyone's future reference I've attached the appropriate AutoIt code fragment.

    Code:
    	$AWC_Hwnd = WinGetHandle("[CLASS:<name of main window class>]", "")
    	_GUICtrlMenu_SetMenu($AWC_Hwnd, 0)	; a zero in the second parm removes the menu
    Regards,
    Jim

  6. #6
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,818
    That's pretty nice. Thanks for sharing.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •