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

How to make Alpha Five stay on top of the Window stack.

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

    How to make Alpha Five stay on top of the Window stack.

    Edward Morgan asked how to make ALPHA itself (the actualy program window) stay on top of other programs being used in a windows environment.

    Look for the code solution in the this thread.

    In this example it is used in a toolbar but it can also be used in a form or Xdialog.
    Marcel

    I hear and I forget. I see and I remember. I do and I understand.
    ---- Confusius ----

    #2
    Re: How to make Alpha Five stay on top of the Window stack.

    Since Marcel is very busy writing cool new code, I have taken the liberty of posting this. Also see image of an application of mine where I now use this in my PIM. I dynamically set the size of the a5 window to the form to float on top. For example, this is very useful for my password db where I need to enter the password to web sites, there are other places I need this functionality as well.

    Autoexec file needs this:
    Code:
    ''Code By  : Marcel Kollenaar 1/27/07
    DECLARE user32 SetWindowPos LLLLLLLL
    Declare user32 GetActiveWindow L
    
    Constant global SWP_NOMOVE = 2
    Constant global SWP_NOSIZE = 1
    Constant global FLAGS = SWP_NOMOVE .OR. SWP_NOSIZE
    Constant global HWND_TOPMOST = -1
    Constant global HWND_NOTOPMOST = -2
    'Get the pointer to the active Window.
    Dim hwnd as N
    hwnd := GetActiveWindow()
    SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
    Here is my complete autoexec file.
    Code:
    'Date Created: 20-Jul-2002 06:09:42 PM
    'Last Updated: 28-Jan-2007 08:19:29 PM
    'Created By  : PG
    'Updated By  : PG
    
    Dim Global vA5OnTop as L
    a5.Hide()
    controlpanel.hide()
    a5_windowbar_close()
    :A5.window_title="PIM PG   " + Left(CDOW(Date()),3) + "  " + DTOC(Date())
    
    f=form.load("MainMenu")
    f.Restore()
    
    vWidth = f.width
    vHeight = f.height
    a5.Restore()
    
    funcAlphaSize(vWidth,vHeight)
    
    f.Maximize()
    'xbasic_wait_for_idle()
    'a5.Show()
    f.show()
    f.activate()
    xbasic_wait_for_idle()
    a5.Show()
    ''======================================================================================
    ''Code By  : Marcel Kollenaar 1/27/07
    DECLARE user32 SetWindowPos LLLLLLLL
    Declare user32 GetActiveWindow L
    
    Constant global SWP_NOMOVE = 2
    Constant global SWP_NOSIZE = 1
    Constant global FLAGS = SWP_NOMOVE .OR. SWP_NOSIZE
    Constant global HWND_TOPMOST = -1
    Constant global HWND_NOTOPMOST = -2
    'Get the pointer to the active Window.
    Dim hwnd as N
    hwnd := GetActiveWindow()
    SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
    vA5OnTop = .T.
    ''======================================================================================
    END
    I use a global variable to control OnTop or Not status. I also use two global functions:

    Function #1 - This one is to toggle the OnTop/Not:
    Code:
    'Date Created: 28-Jan-2007 07:58:07 PM
    'Last Updated: 28-Jan-2007 07:58:07 PM
    'Created By  : PG
    'Updated By  : PG
    FUNCTION funcA5_OnTop AS L (vStatus AS N )
        ''function By  : PG    
        ''code by Marcel Kollenaar
        ''Put A5 window always on top or not (see Autoexec for initization code)
        dim hwnd as N
        
        'Get the pointer to the active Window.
        hwnd := GetActiveWindow()
        
        IF vStatus = 1
            'Use this code to make the form stay on top in the form module:
            SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
            funcA5_OnTop = .T.
        ELSE if vStatus = 0
            'Use this code to make the form NOT stay on top in the form module:
            SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
            funcA5_OnTop = .F.
        END IF
    END FUNCTION
    Function #2 - This one to control main Alpha window size to form size:
    Code:
    'Date Created: 27-Jan-2007 05:45:04 PM
    'Last Updated: 27-Jan-2007 05:45:04 PM
    'Created By  : PG
    'Updated By  : PG
    FUNCTION funcAlphaSize AS C (vWidth=500 AS N, vHeight=200 AS N, vLeft=350 AS N, vTop=200 AS N, vForm=.T. as L)
        ''Size the Min Alpha window
        ''Allow A5 window size to be based upon form size if vForm=.T.
        
        ''typical screen size =     800X600
        ''                            1024X768
        ''                            1152X864
        ''                            1280X720
        ''                            1280X768
        ''                            1280X960
        ''                            1280X1024
        
        vScreenWidth = ui_info(0)
        vScreenHeight = ui_info(1)
        
        IF vForm=.T.
            a5.left = (vScreenWidth/2)-(vWidth/2)         'The horizontal pixel coordinate of the Alpha Five window.
            a5.top = (vScreenHeight/2)-(vHeight/2)        'The vertical pixel coordinate of the Alpha Five window.
            a5.width = vWidth + 10        'The width of the Alpha Five window in pixels.
            a5.height = vHeight + 25        'The height of the Alpha Five window in pixels.
        ELSE
            a5.left = vLeft         'The horizontal pixel coordinate of the Alpha Five window.
            a5.top = vTop            'The vertical pixel coordinate of the Alpha Five window.
            a5.width = vWidth        'The width of the Alpha Five window in pixels.
            a5.height = vHeight    'The height of the Alpha Five window in pixels.
        END IF
        
    END FUNCTION
    Note: The +10 & +25 approximately account for the main Alpha window border thickness.

    Here is some typical button code on the main menu to open a form:
    Code:
    'Date Created: 27-Jan-2007 07:02:32 PM
    'Last Updated: 28-Jan-2007 10:35:19 PM
    'Created By  : PG
    'Updated By  : PG
    
    parentform.Close()
    a5.Hide()
    xbasic_wait_for_idle()
    a5.Maximize()
    f=form.load("TaskManager")
    f.Restore()
    
    vWidth = f.width+10
    vHeight = f.height+50
    a5.Restore()
    funcAlphaSize(vWidth,vHeight)
    f.show()
    f.activate()
    a5.Show()
    END
    Note: The +10 & +50 approximately account for the toolbar and form edges/status bar.

    See image. I just create this the other day, so I will be adding more controls for other forms in my PIM, but I want to keep it small & compact.

    P.S. Marcel, you are a scholar and a gentleman!

    Also, thanks to Ronald Anusiewicz who proved you can make a small & compact A5 window.
    Last edited by Peter.Greulich; 01-29-2007, 03:43 PM.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      Re: How to make Alpha Five stay on top of the Window stack.

      Thank you very much Peter and Marcel for making this available and all the hard work you put into it!

      Very interesting possibilities!

      Best regards,

      Jeff

      Comment


        #4
        Re: How to make Alpha Five stay on top of the Window stack.

        Peter, you give me to much credit. But, thanks for the parts I finished ;) .

        This code solves 2 problems:

        1. The floating of a form like a menu bar.
        2. Placing Alpha Five on top.

        The code I started with is comming from http://www.devx.com/tips/Tip/12630 and was signed by Rod Stephens. Later I found the same code at http://support.microsoft.com/default...b/84251/EN-US/. Therefore I think that the MSDN side is the official source.

        I tested the floating problem with http://support.microsoft.com/default.aspx/kb/114775. This code does not work for the regular forms. It is Ronald Anusiewicz that came up with Xbasic code that let normal forms float. Thanks, Ronald.

        I suggest the next creditation:

        Ronald Anusiewicz: Floating Form
        Peter Greulich:Popup Theme and PIM code.
        Microsoft Developers Network: Topmost or Floating Window in Visual Basic and GetActiveWindow API.
        Marcel Kollenaar: Translation Visual Basic into Xbasic.

        Peter, thanks for putting the solution in the code section and you too did a nice job with the PIM code.
        Marcel

        I hear and I forget. I see and I remember. I do and I understand.
        ---- Confusius ----

        Comment

        Working...
        X