Badubo we need your skills.....XmoveWindow with XL V3

V3 help and support questions

Badubo we need your skills.....XmoveWindow with XL V3

Postby lar282 on Fri Feb 27, 2009 2:44 pm

Has anybody got this plugin to work with V3?
Are the french guys still around?

my window just puts itself in the upper left corner no matter what I do? Must be the .net 3.x stuff.

//Lasse
Last edited by lar282 on Thu Mar 05, 2009 12:59 pm, edited 1 time in total.
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: XmoveWindow with XL V3

Postby kris on Sun Mar 01, 2009 11:31 pm

I just did the same test and you're right it doesn't work.

I tested some of the plugin sdk properties that are used by xmovewindows and it seems that the getX and getY properties of getButton are not working in V3. getHeight and getWidth however do work... I've already emailed this to Steven.

i guess this will not be to hard to fix...
kris
kris
 
Posts: 12
Joined: Fri Dec 30, 2005 4:49 pm
Location: Belgium

Re: XmoveWindow with XL V3

Postby lar282 on Wed Mar 04, 2009 6:01 pm

kris wrote:I just did the same test and you're right it doesn't work.

I tested some of the plugin sdk properties that are used by xmovewindows and it seems that the getX and getY properties of getButton are not working in V3. getHeight and getWidth however do work... I've already emailed this to Steven.

i guess this will not be to hard to fix...
kris


kris I have a hard time verifying that the issue with getx y is fixed in xlobby_3.0.9062.43.exe. Can u help me?

the plugin still doesn't work but that might be a differrent issue.

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: XmoveWindow with XL V3

Postby kris on Wed Mar 04, 2009 10:46 pm

Lasse,

To test this function I created a small plugin that displays x,y,width and height for a given button_id. In the latest release 9062 the x and Y values are coming through. So that seems to be resolved

But Xmovewindows still does not work (window gets pulled to 0,0 coordinates)

i did however note another strange behaviour

if I request x,y for a random button of text box and then move this object the values are being updated only when I select another object. (In V2 the values were updated in realtime)
BUT when I move the textbox that is used for Xmovewindows the values are not updated. They remain the same as before the movement. I can move and resize as much as I want the stay the same.

that all the info I can come up with now...

kris
kris
 
Posts: 12
Joined: Fri Dec 30, 2005 4:49 pm
Location: Belgium

Badubo we need you........

Postby lar282 on Thu Mar 05, 2009 12:21 pm

thanks for trying..

Badubo you around. Feel like wrewriting the plugin to work with XL V3? PLEASE
I guess all the class names in XL are changed thats why the plugin doesn't work.

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby badubo on Tue Mar 10, 2009 1:18 pm

XMovewindow is quite old, the button class was not yet implemented, I use "buttonsize:" in a sendcommand.
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby lar282 on Tue Mar 10, 2009 1:20 pm

badubo wrote:XMovewindow is quite old, the button class was not yet implemented, I use "buttonsize:" in a sendcommand.

:(
ANY chance u have time to wre-write?
I just loved having my tv application on top of XL in a window.


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby S Pittaway on Tue Mar 10, 2009 3:38 pm

I am a bit busy at the moment, but its a really simple plugin to code - I do the same think in a few of my plugins...

If anyone feels like it, here a bit of C# code to strip the frame and move a window -


Code: Select all
  /// <summary>
  /// A few win32 api calls
  /// </summary>
  public class xDllImports
  {
    [DllImport("user32.dll")]
    public static extern bool LockWindowUpdate(IntPtr hWndLock);
   
    [DllImport("user32.dll")]
    public static extern IntPtr SetCursor(IntPtr cursorHandle);
   
    [DllImport("User32.dll")]
    public static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
   
    [DllImport("user32.dll")]
    public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
   
    [DllImport("user32.dll")]
    public static extern int PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
   
    [DllImport("user32.dll")]
    public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
   
    [DllImport("user32.dll")]
    public static extern IntPtr MoveWindow(IntPtr hWnd, int X, int Y, int cx, int cy);

    [DllImport("user32.dll")]
    public static extern bool SetForegroundWindow(IntPtr hWnd);

    [DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
    public static extern int GetWindowLong(IntPtr Handle, int nIndex);

    [DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
    public static extern int SetWindowLong(IntPtr Handle, int nIndex, int NewLong);

    [DllImport("user32.dll")]
    public static extern IntPtr GetLastActivePopup(IntPtr hWnd);

    [DllImport("user32.dll")]
    public static extern bool IsWindowEnabled(IntPtr hWnd);

    [DllImport("user32")]
    public static extern bool IsWindowVisible(IntPtr hWnd);
   
    [DllImport("user32.dll")]
    public static extern bool IsIconic(IntPtr hWnd);

    [DllImport("user32.dll")]
    public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);


    public  const int WM_SETREDRAW      = 0x000B;

    public  const int WM_USER           = 0x400;

    public  const int EM_GETEVENTMASK   = (WM_USER + 59);

    public  const int EM_SETEVENTMASK   = (WM_USER + 69);

    public const int GWL_WNDPROC      = (-4);
    public const int GWL_HINSTANCE    = (-6);
    public const int GWL_HWNDPARENT   = (-8);
    public const int GWL_STYLE        = (-16);
    public const int GWL_EXSTYLE      = (-20);
    public const int GWL_USERDATA     = (-21);
    public const int GWL_ID           = (-12);

    [DllImport("user32.dll", EntryPoint = "SetWindowPos")]
    public static extern bool SetWindowPos(
       IntPtr hWnd,               // window handle
       int hWndInsertAfter,    // placement-order handle
       int X,                  // horizontal position
       int Y,                  // vertical position
       int cx,                 // width
       int cy,                 // height
       uint uFlags);           // window positioning flags
    public const int HWND_TOP     = 0x0;
    public const int HWND_BOTTOM  = 0x1;
    public const int HWND_TOPMOST = -1;
    public const int HWND_NOTOPMOST = -2;

    public const int SW_RESTORE = 9;

    public const int SWP_NOACTIVATE =0x10;

    public const uint SWP_NOSIZE = 0x1;
    public const uint SWP_NOMOVE = 0x2;
    public const uint SWP_SHOWWINDOW = 0x40;
    public const uint SWP_HIDEWINDOW = 0x80;
    public const uint SWP_NOZORDER= 0x4;
    public const uint SWP_DRAWFRAME= 0x0020;
    public const uint SWP_FRAMECHANGED = 0x0020;
    public const uint SWP_ASYNCWINDOWPOS = 0x4000;
    public const int WS_CAPTION = 0xC00000;
    public const int WS_BORDER = 0x800000;
    public const int WS_DLGFRAME = 0x400000;
    public const int WS_THICKFRAME = 0x40000;



    public static void RemoveFrame(IntPtr Handle, bool TopMost, bool BottomMost )
    {
      if (Handle != IntPtr.Zero)
      {
        int nOldStyle = GetWindowLong(Handle, GWL_STYLE);
        int nNewStyle = nOldStyle & ~(WS_CAPTION | WS_BORDER | WS_DLGFRAME | WS_THICKFRAME);

        SetWindowLong(Handle, GWL_STYLE, nNewStyle);
        if ( TopMost )
          SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_FRAMECHANGED);
        else if (BottomMost)
          SetWindowPos(Handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_FRAMECHANGED);
        else
          SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_FRAMECHANGED);
      }
    }


    public static void RemoveFrame(IntPtr Handle, bool TopMost, bool BottomMost, int X, int Y, int Cx, int Cy)
    {
      if (Handle != IntPtr.Zero)
      {
        int nOldStyle = GetWindowLong(Handle, GWL_STYLE);
        int nNewStyle = nOldStyle & ~(WS_CAPTION | WS_BORDER | WS_DLGFRAME | WS_THICKFRAME);

        SetWindowLong(Handle, GWL_STYLE, nNewStyle);
        if (TopMost)
          SetWindowPos(Handle, HWND_TOPMOST, X, Y, Cx, Cy, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_FRAMECHANGED);
        else if (BottomMost)
          SetWindowPos(Handle, HWND_BOTTOM, X, Y, Cx, Cy, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_FRAMECHANGED);
        else
          SetWindowPos(Handle, 0, X, Y, Cx, Cy, SWP_NOZORDER | SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_FRAMECHANGED);
      }
    }


    /// <summary>
    ///
    /// </summary>
    public static void SendFocus(string WindowTitle)
    {
      // Look for previous instance of this program.
      IntPtr hWnd = FindWindow(null, WindowTitle);

      // If a previous instance of this program was found...
      if (hWnd != null)
      {
        //If program is minimized, restore it.
        ShowWindow(hWnd, SW_RESTORE);

        //Bring to the front
        SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_FRAMECHANGED);
       
        //Set the focus
        SetForegroundWindow(hWnd);
      }
    }//SendFocus

  }//xDllImports
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby smarty on Sat Mar 21, 2009 1:32 am

Dang it.... Just got the media player to playback with the proper size.....so now I could move up to XLobby 3....or so I thought.

XMoveWindow is a critical part of my skin...I use it to display SageTV in a number of different screens. Anyone want to start a donation for Badubo or Pittaway to do an Xlobby 3 re-write?
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby lar282 on Sat Mar 21, 2009 6:58 am

I actually rewrote his plugin but can't post it here since its his work. Maybe he reads this and gives me permission to post the new dll


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby badubo on Mon Mar 23, 2009 8:20 am

Don"t know if you speak about me or Pittaway, but you can of course upload your work
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby lar282 on Mon Mar 23, 2009 8:23 am

badubo wrote:Don"t know if you speak about me or Pittaway, but you can of course upload your work


Well, see I kind of! reversed your plugin. Hmm sorry. But I got it to work and it's your plugin and I do not want to upset you.

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby badubo on Mon Mar 23, 2009 11:16 am

Code: Select all
I do not want to upset you.

no problem you can release ;)
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby S Pittaway on Wed Mar 25, 2009 5:11 pm

people can always do what they want with anything i have writen, as long as they include the source so people can have a play if they feel like :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Badubo we need your skills.....XmoveWindow with XL V3

Postby lar282 on Wed Mar 25, 2009 9:49 pm

badubo wrote:
Code: Select all
I do not want to upset you.

no problem you can release ;)


I think the Xmove plugin is yours. Thanks for letting me change it.

I'll upload new dll tomorrow

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Next