Announcement

Collapse
No announcement yet.

Having trouble setting my project to be on top

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

  • Having trouble setting my project to be on top

    I have a project which runs when right clicked on an image, all is well apart from one thing.

    I would like my project to be set on top of the viewing order.

    I don't like it when it is set to "Always On Top"

    Been looking through the examples and got this script

    Code:
    Window.SetOrder(Application.GetWndHandle(),  HWND_TOP);
    It is placed on "Page, On Show" ( There is only one page)

    It does nothing when my app runs.

    If I set it to
    Code:
    Window.SetOrder(Application.GetWndHandle(),  HWND_TOPMOST);
    it works but I don' want it on top all the time.

    I have tried "NOTTOPMOST" also but to no avail..

    I don't know what I am doing wrong..

    Anybody help me out here.

  • #2
    have you tried to consider the "SetForegroundWindow" function?



    Comment


    • #3
      Nope I have not tried that....

      I don't understand that link, sorry.

      I don't see it or owt like it in the selection of actions.

      Comment


      • #4

        here


        here


        here

        Comment


        • #5
          Thanks herrin for the input.

          It has taken me a while but I have it now.

          Code:
          -- Minimises All Windows - Restores VeriHash
          VeriHash = Application.GetWndHandle();
          Windows=Window.EnumerateTitles(true);
          for Window_Handle, Window_Title in pairs (Windows) do
          Window.Minimize(Window_Handle);
          Window.Restore(VeriHash);
          end
          Seems to be working well. I right click on my image, it minimises ALL windows then restores my app.

          Just need to delay it a wee while after restoring it to when it starts its thing.

          Cheers again.

          Comment


          • #6
            narrr.. Don't like how that works...

            It's like using brute force to do summet. Doesn't look good.

            Needs more work

            Comment


            • #7
              Having not liked how my last effort worked and not understanding
              SetForegroundWindow
              I reverted to using what I do understand.

              I made a little project, Set TOPMOST. It has two buttons, one making the project TOPMOST in the order and the other button making it NOTTOPMOST.
              Worked like a charm.

              So I took this to my other project and wrote this code
              Code:
              Window.SetOrder(Application.GetWndHandle(), HWND_TOPMOST);
              Application.Sleep(1000);
              Window.SetOrder(Application.GetWndHandle(), HWND_NOTOPMOST);
              My project gets built as a "Hard Drive Folder"

              So now when I right click on a specified image I can call my project, it boots into life set on top of all open Windows. I see it doing it's thing but now I can open other Windows and my project is not permanently On TOP.
              It is working just the way I wanted. Which is nice.
              I have checked it also as Pinned to Start, Pinned To taskbar and directly double clicking on the .exe itself.
              All works perfectly.

              Many thanks to herrin for helping me out, much appreciated.

              Only one more thing to sort out. The process can take a while, 2 to 3 minutes depending on the image size and I feel a progress bar will top things off nice.
              So, look out for me asking about that...

              Cheers.

              Comment

              Working...
              X