Announcement

Collapse
No announcement yet.

About objects Handles

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

  • About objects Handles

    Hi all
    why all objects Handles values Equals to zero on the Preload event ??

  • #2
    Code:
    hndlinp = Input.GetProperties("Input1");
    Dialog.Message("Notice", hndlinp.WindowHandle);
    when executed from the on preload event = 0
    when excuted from the on show event = value of non zero
    why ?

    Comment


    • #3
      On Preload is as the name implies, before it is loaded. The page is not done initializing when that code is executed, so many or most functions will not work as you might expect.
      Bas Groothedde
      Imagine Programming :: Blog

      AMS8 Plugins
      IMXLH Compiler

      Comment


      • #4
        i expect nil not zero
        thanks imagin

        Comment


        • #5
          Originally posted by startup View Post
          i expect nil not zero
          thanks imagin
          The properties table for that object exists, so that's why you're probably getting 0 (an invalid window handle, because it isn't created yet). This way, you can use GetProperties and SetProperties to initialise the settings for an object before it is shown.

          Example On Preload:
          Code:
          local tProps = Input.GetProperties("Input1");
          tProps.Height = 44;
          Input.SetProperties("Input1", tProps);
          Bas Groothedde
          Imagine Programming :: Blog

          AMS8 Plugins
          IMXLH Compiler

          Comment


          • #6
            Originally posted by Imagine Programming View Post

            The properties table for that object exists, so that's why you're probably getting 0 (an invalid window handle, because it isn't created yet)
            that explains every thing
            thanks imagine


            Comment

            Working...
            X