New My Programs Plugin (1 Viewer)

TNDAri

Portal Pro
July 12, 2006
70
0
GER - Bremen
Hiho!

We decided to dev a new "My Programs" Plugin. it must be such smaler and not so complex like the current.

So i need ideas, what this must be able to. We thought about a mix of the MultiShortcut Plugin, the EasyApps plugin and the current My Programs Plugin.

The idea is to create a App Plugin with the features of all 3 plugins, but much easier to handle/configure.

So the main new idea is that the User could choose where the App Button is listed ( Home Menu, My Plguins Menu or seperate Menu for the apps )

Are there any features we also need, which all 3 plugins don't have??

Just post them 8)

Greatz


Ok, i got a little list with the features wich will be added - more ideas are welcome ;)

1. Save stuff
No database just an external XMl file....database is overdressed for this. XML is fast enough

2. Select the position of your App Button
The App buttons could be added to the Home Menu, My Plugins Menu or even to the list of the plugin

3. Folders are possible
The Folders could also be added to the Home, MyPlugins Menus.
So we could make a folder only for your ( just an example ) SNES Roms. ( sorry i am a gamer ;) )

4. The App "types"
Standart : Just the standart "start-the-app" thing ;)
File Extension : Example : start your roms directly with the Emulator
Embedded : I think i could create this with the idea of RoyN ( THX ) ;)

5. Misc
Icons, options for the Window state of the starting App, The HideMP option, select/edit arguments at runtime, run scripts at start and ending of app possible

6. Maybe
Select the Style of the Button....i know this is very easy to dev but is this realy needed????

Hmm i think thats it....
 

RoyN

Portal Pro
March 17, 2006
78
0
I was looking for something like this.... I tried my programs and easy apps... didnt much like any :( (sorry)...

for me, nice features to have when calling external programs would be:

- Possibility to call the program directly from home or whatever (like you said)
- Possibility to have the program either full-screen, or "embedded"... by embedded, I mean: have the program take only a window-sized area within the MP interface.
- Finally, tied with the "embedded look" above, an option of adding some buttons on the left side or whatever (dependig on skin), where you can have sendkey functionality.

That way, you can have a set of buttons that are themed in media portal style, and have an application running "inside" and you press those buttons, to control the program.

This would work great when controlling, say, a slingbox player (which was what I am trying to do), I can have the player on part of the screen, and then I can have buttons for changin channels, etc on the side, which send keys to this application.

To the end-user it is just like one integrated interface, but it is actually 2 apps (MP+ExternalApp)...

Any thoughts on this? Any way of doing this currently? I was amazed the current My Programs doesnt have a way of having sendkey buttons along the bottom/side of the embedded app.... It would also be useful for simple games, and so forth...

Any ideas? Possible?
 

TNDAri

Portal Pro
July 12, 2006
70
0
GER - Bremen
RoyN said:
...
- Possibility to call the program directly from home or whatever (like you said)

This is the main idea and i got the code ready for this, but not fully intigrated in the plugin yet.

RoyN said:
- Possibility to have the program either full-screen, or "embedded"... by embedded, I mean: have the program take only a window-sized area within the MP interface.
- Finally, tied with the "embedded look" above, an option of adding some buttons on the left side or whatever (dependig on skin), where you can have sendkey functionality.

The embedded thing is something difficult.....i have no ide how to handle this....maybe there is a dev out there who have ideas ;)

The first idea was to capture the window and put the captured image to the "embedded" window. But for Applications wich many FPS ( like External DVD players ) its to slow.

I love the ide but at the first look i say its not possible, but maybe someone has THE idea to get this work. :)
 

RoyN

Portal Pro
March 17, 2006
78
0
Well, it wouldnt be very difficult if you just resize/move the window to take the area that one has defined....

It can be made more complex (say if you want to remove window-titles, menu bar, etc...)

I am amember at mp3car.com, and there we discuss in-car pcs... there are some appplications which do exactly this, embed applications in themselves (basically, the same thing I suggest here)... from what I gather, they are either parenting the original window (which requires you find the window by giving either/or the window name or class name), or they merely "hide" the areas we dont want to see...

There is some delphi code that is really simple that embeds the slignplayer I mentioned above...I'll paste it here so you can see, it isnt really very complicated, and I guess I'll have to make something like this if no one else does, but I just dont have any programming tools on my machine at the mo... gotta go get the cds in the office :)

Anyways, the code is pretty straight forwafrd, as it uses mainly windows methods...
(ps, not written by me)
Code:
{ Application Name : SlingView
  Version : 1.2
  Author : Andrew Butkus
  Website : [url]www.lommage.co.uk/slingbox[/url]

  ==============================================================

  Bugfix History
  --------------
      3/1/2006
        - Recoded version 1.2

  ==============================================================
}

unit MainForm1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, ExtCtrls;

type
  TForm1 = class(TForm)
    procedure FormShow(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure DoResize;
  end;

  procedure InitialiseSlingWindow;

var
  Form1: TForm1;
  
  Window: Cardinal = 0; // Slingplayer Window (make sure starts with 0)
  WindowRect, DefaultWindowRect: TRect; // Settings for windows position

  UserResizing: Boolean = False; //Boolean check to see if application is
                                 //resizing, or if its the user (this avoids
                                 //the code to be re-called everytime the
                                 //application resizes)

implementation

{$R *.dfm}

//-----------------------------
{ Find Window to modify }
function EnumViewWindowsProc(WHandle: HWND; lParam: LPARAM): BOOL; export; stdcall;
var
  WindowName : array[0..MAX_PATH] of char;
begin
  Result := True;
  GetWindowText(WHandle, WindowName, MAX_PATH);

  If (String(WindowName) = 'SlingPlayer') then
  begin
    //Store original size of window in a temp rect
    GetWindowRect(WHandle, WindowRect);
    //Set the mask to hide the window - for user testing of main window
    SetWindowRgn(WHandle, CreateRectRgn(0, 0, 0, 0), True);

    If MessageDlg('Did the main Sling Player Main Video window Disappear?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
    begin
      Window := WHandle; //If it is slingplayer window then assign to a global variable
      Result := False; //Discontinuing checking for window
    end
    else
      //If window doesnt hide, then set the mask back to the original dimensions
      SetWindowRgn(WHandle, CreateRectRgn(0, 0, WindowRect.Right, WindowRect.Bottom), True);
  end;
end;

{ This is called when application starts }
procedure InitialiseSlingWindow;
begin
  { Start of by getting the slingplayer window }
  EnumWindows(@EnumViewWindowsProc, 0);

  { If doesnt exist then exit, as its not running }
  If Window = 0 then
  begin
    Showmessage('SlingPlayer not running, Exiting ...');
    Application.Terminate;
  end;

  { Store current Slingplayer window position }
  DefaultWindowRect.Top := WindowRect.Top;
  DefaultWindowRect.Left := WindowRect.Left;
  DefaultWindowRect.Bottom := WindowRect.Bottom;
  DefaultWindowRect.Right := WindowRect.Right;
end;
//-----------------------------

{ Do the resize procedure (for resizing form and slingplayer window) }
procedure TForm1.DoResize;
begin
  UserResizing := False; //Switch into application resizing mode

  Form1.Left := WindowRect.Left;
  Form1.Top := WindowRect.Top;

  Form1.Width := WindowRect.Right - 40;
  Form1.Height := WindowRect.Bottom - 173;

  UserResizing := True; //Switch back to user resizing mode

  MoveWindow(Window, 0 - 24, 0 - 62, WindowRect.Right, WindowRect.Bottom, True);
  SetWindowRgn(Window, CreateRectRgn(0, 0, WindowRect.Right - 24, WindowRect.Bottom - 140), True);
end;

{ Make our application the parent window of Slingplayer }
procedure TForm1.FormShow(Sender: TObject);
begin
  //Set constraints of the window (this is more due to slingplayer not being able to maxed sized)
  Form1.Constraints.MaxHeight := Screen.Height - 165;
  Form1.Constraints.MaxWidth := Screen.Width - 48;
  Form1.Constraints.MinHeight := 235;
  Form1.Constraints.MinWidth := 320;

  Windows.SetParent(Window, Form1.Handle); //Make sling player a part of our form
  DoResize; //and now resize slingplayer to the size of our form
end;

{ When form is resized make sure the slingplayer window is updated }
procedure TForm1.FormResize(Sender: TObject);
begin
  If UserResizing then //here we check to see if the user is resizing or if the application is
  begin
    WindowRect.Left := Form1.Left;
    WindowRect.Top := Form1.Top;

    WindowRect.Right := Form1.Width + 40;
    WindowRect.Bottom := Form1.Height + 173;

    DoResize;
  end;
end;

{ Put Slingplayer back the way it was before } 
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  //Move the window back to original position
  MoveWindow(Window, DefaultWindowRect.Left, DefaultWindowRect.Top, DefaultWindowRect.Right, DefaultWindowRect.Bottom, True);

  SetWindowRgn(Window, CreateRectRgn(0, 0, Screen.Width, Screen.Height), True); //Reset the mask
  Windows.SetParent(Window, 0); //Make the slingplayer parent back to the desktop
end;

end.
 

RoyN

Portal Pro
March 17, 2006
78
0
in other words, what the above code does is "own the window" that you want to "embed"... it then puts it INSIDE another form... then cuts down this form to hide parts of the application....

I know that in the carpc programs people embed video players, dvd players, games, emulators etc... without FPS problems AFAIK....
 

RoyN

Portal Pro
March 17, 2006
78
0
Cool! Thanks! :)

Tell me if you need any help...

a program I was looking at to try and do something similar (albeit alot more "hacked"), is called "Skinbedder"... (you can google it), what that does is (it is made primarily to make windows desktop gps programs like google earth or iguidance more in-car touchscreen friendly)..

What it does is it embeds an application, and creates buttons over the application, which can be used to trigger scripts or keypresses. It is quite complex in that it can handle various different windows within a same program (so it cn "skin" several dialog boxes or forms within the same application)... it is quite complex and I havent been able to get it to work with slingplayer, but in complex terms it does the same thing I spoke of above, only it takes it to a whole more complex level...
 

RoyN

Portal Pro
March 17, 2006
78
0
Cool... one minor suggestion, maybe you can have a way of making "embedded" a window-type... that way you can still have an emulator that runs embedded (and a button on your skin to make it fullscreen), and so forth....
 

TNDAri

Portal Pro
July 12, 2006
70
0
GER - Bremen
RoyN said:
Cool... one minor suggestion, maybe you can have a way of making "embedded" a window-type... that way you can still have an emulator that runs embedded (and a button on your skin to make it fullscreen), and so forth....

I thought about the sendKey stuff.......ok, the standart min, max and close buttons of windows are standart.

Maybe there is a way to create a little TaskManager for the running embedded apps......but first i will try to code the stuff i listed ;) I think this is enough work for the first test release ;)
 

Users who are viewing this thread

Top Bottom