Position project at certain location on screen

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ghobii
    Forum Member
    • Jan 2003
    • 69

    Position project at certain location on screen

    Is it possible to open an autoplay project at certain coordinates on the users screen?
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    Hi. Yep, just try out the Window.SetPos() action as seen here: Click Here

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment

    • ghobii
      Forum Member
      • Jan 2003
      • 69

      #3
      I saw that, but I don't know how to specify what window I want to position. And I wasn't sure if this command could reference the parent app.

      Comment

      • TJ_Tigger
        Indigo Rose Customer
        • Sep 2002
        • 3159

        #4
        You will need to get the application handle and that can be specified in the Window.SetPos as seen below.
        Code:
        Example 1
        Window.SetPos(app_handle, 100, 150);
        
        Sets a program window's X coordinate to 100 pixels and the Y coordinate to 150. The program's window handle is passed to the action through the variable "app_handle."
        Here is the example from the help title on how to get and search for the title of the window you want to find.

        Code:
        Example 2
        -- Get the titles and window handles of all open windows.
        windows = Window.EnumerateTitles();
        
        -- A variable containing text in the title you want to search for.
        window_name = "Notepad";
        
        -- Loop through the table of windows.
        for handle, title in windows do
        
            -- Check if the window title has the target text.
            result = String.Find(title, window_name, 1, false);
        
            -- if the string was found in the title, send the window a close message.
            if (result ~= -1) then
                Window.Close(handle, CLOSEWND_SENDMESSAGE);
            end
        end
        
        Finds all open windows with the string "Notepad" in the title and sends each of them a close message.
        TJ-Tigger
        "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
        "Draco dormiens nunquam titillandus."
        Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

        Comment

        • Ted Sullivan
          Indigo Rose Staff Member
          • Oct 2003
          • 963

          #5
          If you're trying to get the handle of *your* autoplay application, the easiest way is with Application.GetWndHandle.



          Examples:

          Code:
          -- Get the AutoPlay application's window handle.
          handle = Application.GetWndHandle();
          
          -- Move the window
          Window.SetPos(handle, 100, 150);
          or
          Code:
          -- Get the AutoPlay application's window handle.
          handle = Application.GetWndHandle();
          
          -- Hide the AutoPlay application window.
          Window.Hide(handle);
          
          -- Sleep for 3 seconds.
          Application.Sleep(3000);
          
          -- Show the AutoPlay application window.
          Window.Show(handle);
          New Release: Setup Factory 9.6 adds Windows 11 compatibility and support for hardware token OV/EV Code Signing certificates.

          Comment

          • RiteSh
            Forum Member
            • Nov 2005
            • 2

            #6
            Same idea with Setup Factory application?

            Is it possible to have same positioning of the window for SetupFactory Application?

            Comment

            Working...
            X