Announcement

Collapse
No announcement yet.

Auto Position in diferent resolutions

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

  • Auto Position in diferent resolutions

    I have a project that I want that when it opens, that it always be in the same place regardless of the computer's resolution, I want it to always open in the lower right corner, (I don't always want to move it) as in the image I'm sending, are there any codes that help me?
    Attached Files

  • #2
    A search of the forums would have found your answer
    try this

    Code:
    --Position Window  Use On Start or On Show Event
    
    local tDesktop = System.GetDisplayInfo();
    local hWnd = Application.GetWndHandle();
    local tWindow = Window.GetSize(hWnd);
    Window.SetPos(hWnd, tDesktop.Width-tWindow.Width, tDesktop.Height-tWindow.Height - 40);--40 for taskbar
    or for a DialogueEX
    Code:
    --Position Dialog On Show
    
    local tDesktop = System.GetDisplayInfo();
    local hWnd = DialogEx.GetWndHandle();
    local tWindow = Window.GetSize(hWnd);
    Window.SetPos(hWnd, tDesktop.Width-tWindow.Width, tDesktop.Height-tWindow.Height - 40);--40 for taskbar
    Code thanks to Ulrich

    Cheers

    Comment


    • #3
      Originally posted by colc View Post
      A search of the forums would have found your answer
      try this

      Code:
      --Position Window Use On Start or On Show Event
      
      local tDesktop = System.GetDisplayInfo();
      local hWnd = Application.GetWndHandle();
      local tWindow = Window.GetSize(hWnd);
      Window.SetPos(hWnd, tDesktop.Width-tWindow.Width, tDesktop.Height-tWindow.Height - 40);--40 for taskbar
      or for a DialogueEX
      Code:
      --Position Dialog On Show
      
      local tDesktop = System.GetDisplayInfo();
      local hWnd = DialogEx.GetWndHandle();
      local tWindow = Window.GetSize(hWnd);
      Window.SetPos(hWnd, tDesktop.Width-tWindow.Width, tDesktop.Height-tWindow.Height - 40);--40 for taskbar
      Code thanks to Ulrich

      Cheers
      OMG OMG OMG IT JUST WORKS THANKS, Now, what a need to do to invert this to bottom left? I try something here but withou sucess, thakyou!

      Comment


      • #4
        Left edge of screen is zero so use
        Code:
        Window.SetPos(hWnd, 0, tDesktop.Height-tWindow.Height - 40);--40 for taskbar
        Cheers

        Comment


        • #5
          Originally posted by colc View Post
          Left edge of screen is zero so use
          Code:
          Window.SetPos(hWnd, 0, tDesktop.Height-tWindow.Height - 40);--40 for taskbar
          Cheers
          Thankyou, i've try this and works too, Window.SetPos(hWnd, tDesktop.Width-tWindow.Width - tDesktop.Width-tWindow.Width + 450, tDesktop.Height-tWindow.Height - 40);--40 for taskbar

          450 is the size of my project.

          You can help more please?

          I would like to run an EXE file that is not in the DOCS folder in my project, in fact it is on the network, but every time I add an EXE to my project it soon adds the DOCS folder, is it possible to run an external EXE?

          Comment


          • #6
            Place the exe in manually using your file explorer instead of importing through the IDE. Also, why would you import it if you just want to run it? Just put the fully qualified path into a call using Shell.Execute().
            https://github.com/CentauriSoldier

            Comment


            • #7
              Originally posted by Centauri Soldier View Post
              Place the exe in manually using your file explorer instead of importing through the IDE. Also, why would you import it if you just want to run it? Just put the fully qualified path into a call using Shell.Execute().
              I'm from brazil and i dont undestand so much of autoplay codes, i'm using this forum to help me out.

              Comment

              Working...
              X