Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

getting non-alpha window titles and navigating to non-alpha windows

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

    getting non-alpha window titles and navigating to non-alpha windows

    I have searched hi and low and have tried to use various sys functions in all different ways to try and get the window navigate from Alpha desktop app to an open web page. I am trying to script opening a web page, going back to alpha, do something in alpha, then go back to the web page.

    If you open a website with sys_open() how do you get the window title of that window so you can use sys_focus_put() to navigate back to that page? Or any other possible method. Also, is there a method that can check to see if a non-alpha window exists. I sense somehow sys_id_enum() fits in here but having a hard time getting it to work. Thanks.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    #2
    Re: getting non-alpha window titles and navigating to non-alpha windows

    Not sure if this helps, but copy the following into a new code. When you run it opens a web page in an xdialog and then populates a set number of fields

    It may give you some help in your directions. While it open a web page for an Australian site, there are no issues with the data etc as it does not take you past the point. It was simply my way of controlling a user to enter standard registration details. In this case it only uses my details.

    From my point of view, it does expend the power of the xdialog

    'Date Created: 04-Oct-2011 09:12:18 AM
    'Last Updated: 13-Nov-2012 01:33:15 PM
    'Created By : MXpearso
    'Updated By : mxpearso
    'Create an XDialog dialog box to prompt for parameters.
    DIM myurl as P
    dim myurl.object as p
    dim myurl.class as c
    dim ww as n


    DIM SHARED Coy as C
    dim lname as c
    dim fname as c
    dim userid1 as c
    dim userpw as c
    DIM SHARED Add1 as C
    DIM SHARED Add2 as C
    DIM SHARED City as C
    DIM SHARED State as C
    DIM SHARED zip as C
    DIM SHARED ph as C
    DIM SHARED fax as C
    DIM SHARED mob as C
    DIM SHARED Email as C
    DIM SHARED Web as C
    DIM SHARED ABN as C
    DIM SHARED GST as n
    DIM SHARED GST1 as C
    DIM SHARED BSB as C
    DIM SHARED accno as C
    DIM SHARED accname as C
    DIM SHARED varC_resultpro as C
    dim myt as p
    dim ch1 as n
    'myt = table.open("defaults",FILE_RO_SHARED)
    Coy = "One Stop Solutions" 'alltrim(myt.company)
    fname = "Mark" 'alltrim(myt.first_name)
    lname = "Pearson" ' alltrim(myt.last_name)
    Add1 = "8 Benton Crt" 'alltrim(myt.street)
    Add2 = "" 'alltrim(myt.street2)
    City = "Douglas" 'alltrim(myt.city)
    State = "Qld" 'alltrim(myt.state)
    zip = "4814" ' alltrim(myt.zip)
    ph = "0747757013" 'alltrim(myt.phone)
    fax = "" ' alltrim(myt.fax)
    mob = "0434602372"'alltrim(myt.mobile)
    Email = "[email protected]" 'alltrim(myt.email)
    userid1 = "Mark" 'alltrim(myt.userid)
    userpw = "******" 'alltrim(myt.upw)
    'myt.close()
    if coy = "" .or. fname = "" .or. lname = "" .or. add1 = "" .or. city = "" .or. state = "" .or. zip = "" .or. ph = "" .or. mob = "" .or. email = "" .or. userid1 = "" .or. userpw = "" then
    ui_msg_box("Need to complete a valid propfile","Not all profile fields marked with '*' are filled in. You must do this first.")
    script_play("profile")
    end
    end if

    myurl.class = "shell.explorer.2"

    dim myurl.events as c
    myurl.events = <<%code%
    function beforenavigate2 as v (pDisp as P,URL as A,Flags as A,TargetFrameName as A,PostData as A,Headers as A,Cancel as L)
    end function

    function clienttohostwindow as v (CX as N,CY as N)
    end function

    function commandstatechange as v (Command as N,Enable as L)
    end function

    function documentcomplete as v (pDisp as P,URL as A)
    myurl.object.document.getElementById("firstname")=fname
    myurl.object.document.getElementById("lastname")=lname
    myurl.object.document.getElementById("company")=coy
    myurl.object.document.getElementById("regusername")=userid1
    myurl.object.document.getElementById("regpassword")=userpw
    myurl.object.document.getElementById("confirm")=userpw
    myurl.object.document.getElementById("address1")=add1
    myurl.object.document.getElementById("address2")=add2
    myurl.object.document.getElementById("suburb")=city
    myurl.object.document.getElementById("state")=state
    myurl.object.document.getElementById("postcode")=zip
    myurl.object.document.getElementById("phone")=ph
    myurl.object.document.getElementById("email")=email
    myurl.object.document.getElementById("mobile")=mob
    myurl.object.document.getElementById("sender")=mob

    end function

    function downloadbegin as v ()
    end function

    function downloadcomplete as v ()
    end function

    function filedownload as v (ActiveDocument as L,Cancel as L)
    end function

    function navigatecomplete2 as v (pDisp as P,URL as A)
    end function

    function navigateerror as v (pDisp as P,URL as A,Frame as A,StatusCode as A,Cancel as L)
    end function

    function newwindow2 as v (ppDisp as OLE::webbrowser::IWebBrowser,Cancel as L)
    end function

    function newwindow3 as v (ppDisp as OLE::webbrowser::IWebBrowser,Cancel as L,dwFlags as N,bstrUrlContext as C,bstrUrl as C)
    end function

    function onfullscreen as v (FullScreen as L)
    end function

    function onmenubar as v (MenuBar as L)
    end function

    function onquit as v ()
    end function

    function onstatusbar as v (StatusBar as L)
    end function

    function ontheatermode as v (TheaterMode as L)
    end function

    function ontoolbar as v (ToolBar as L)
    end function

    function onvisible as v (Visible as L)
    end function

    function printtemplateinstantiation as v (pDisp as P)
    end function

    function printtemplateteardown as v (pDisp as P)
    end function

    function privacyimpactedstatechange as v (bImpacted as L)
    end function

    function progresschange as v (Progress as N,ProgressMax as N)
    end function

    function propertychange as v (szProperty as C)
    end function

    function setphishingfilterstatus as v (PhishingFilterStatus as N)
    end function

    function setsecurelockicon as v (SecureLockIcon as N)
    end function

    function statustextchange as v (Text as C)
    end function

    function titlechange as v (Text as C)
    end function

    function updatepagestatus as v (pDisp as P,nPage as A,fDone as A)
    end function

    function windowclosing as v (IsChildWindow as L,Cancel as L)
    end function

    function windowsetheight as v (Height as N)
    end function

    function windowsetleft as v (Left as N)
    end function

    function windowsetresizable as v (Resizable as L)
    end function

    function windowsettop as v (Top as N)
    end function

    function windowsetwidth as v (Width as N)
    end function

    function windowstatechanged as v (dwWindowStateFlags as N,dwValidFlagsMask as N)
    end function


    %code%
    DIM SHARED varC_result as C
    DIM myurl_url as c
    myurl_url = "https://www.smsbroadcast.com.au/signup"
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_modeless_dlg_box("Register",<<%dlg%
    {startup=init}
    {can_exit=go1}
    {on_activate=fil1}
    {stretch=width,height}


    {region}
    {activex=100,40myurl?.t.};
    {endregion};

    %dlg%,<<%code%
    If a_dlg_button = "go1" then

    ui_modeless_dlg_close("Register")


    end if



    if a_dlg_button="document" then
    a_dlg_button=""
    showvar(properties_enum(myurl.object.document),"document")
    end if
    if a_dlg_button = "init" then
    a_dlg_button = ""
    a_dlg_button = ""
    hourglass_cursor(.t.)
    if myurl_url <> "" then
    on error goto myurl_error
    myurl.object.navigate(shellExplorer_url(myurl_url))
    on error goto 0
    end if
    hourglass_cursor(.f.)

    end if
    end

    myurl_error:
    ui_msg_box("Error","Invalid URL.",UI_STOP_SYMBOL)
    end
    %code%)
    UI_DLG_MAXIMIZE("Register")
    -----------------------------------------------
    Regards
    Mark Pearson
    [email protected]
    Youtube channel
    Website

    Comment


      #3
      Re: getting non-alpha window titles and navigating to non-alpha windows

      Thanks Mark,
      That's pretty intense code. I'll have to pour over it for a while and see if I can understand it. Did you write that code, or did that come from a genie or a resource?

      Thanks a gain.
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: getting non-alpha window titles and navigating to non-alpha windows

        I can't claim full ownership. I got a lot of help from putting an activx control onto a form and the looked at the functions in the code explorer. The I matched by trial and error with adding a web browser to an xdialog using the xdialog genie and then converting to xbasic.

        Took some time but I got there. My real issue with this example was the getting field names from teh source code of the web page. The page was embedded, so sort had to get to at first.
        -----------------------------------------------
        Regards
        Mark Pearson
        [email protected]
        Youtube channel
        Website

        Comment


          #5
          Re: getting non-alpha window titles and navigating to non-alpha windows

          Hi Mark,
          Very cool. I tried it but on a site with dropdowns and dynamic content (you click on the dropdown and when you select something other fields appear on the form). Let me preface what follows with "I know next to nothing about code or html". Is there a way to code this so the dropdown opens and the other fields that appear get populated?

          I'm assuming I have to look at the html to get the field names so I'm looking at the input line, for example;
          <input name="ctl00$ctl00$body$body$txtBarCode" type="text" maxlength="30" id="txtBarCode" /> and thinking the "id=" contains the pointer data for the "myurl.object.document.getElementById" in your code. Is this correct?

          Thanks,
          Bill

          Comment


            #6
            Re: getting non-alpha window titles and navigating to non-alpha windows

            I did this so long ago. I think you are corect. The id iswhat the code looks for on the page

            I am not sure what you mean about the drop down bit. Can you give ascreen shot or something. All fields get populated by their id. Is the drop down stoppling the code or something like that?
            -----------------------------------------------
            Regards
            Mark Pearson
            [email protected]
            Youtube channel
            Website

            Comment


              #7
              Re: getting non-alpha window titles and navigating to non-alpha windows

              Mark, screenshot attached.
              Yes it does stop it by virtue of the fact that the fields we need to populate stay hidden on the form until the "not one of these?" link is pressed. If it's possible to send a left mouse click to it, in the code, then that would be a work around but I can't figure out how to do it.
              Thanks again,
              Bill


              order_form.png

              Comment


                #8
                Re: getting non-alpha window titles and navigating to non-alpha windows

                as a trial, try hard coding the result for the drop down field. This may trigger the rest of your options work. If this is the case and works, you may need to have a user interface that allows a step for selecting the result you want. I can help with that, if the test works
                -----------------------------------------------
                Regards
                Mark Pearson
                [email protected]
                Youtube channel
                Website

                Comment

                Working...
                X