Announcement

Collapse
No announcement yet.

Dialog New and create off-screen questions

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

  • Dialog New and create off-screen questions

    Can a dialog be created off screen or must it be moved?
    This moves to 0,0.
    Is this a feature?
    I want to control a hidden dialog and wondered if there are any advantages to moving it off-screen rather than hiding it?

    Code:
    DIALOG NEW hParent, "Dialog1", -100, -100, 200, 200, %WS_POPUP OR _
            %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR %WS_MINIMIZEBOX OR _
            %WS_MAXIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
            OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, _
            %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR, TO hDlg
    The world is full of apathy, but who cares?

  • #2
    I would not create a window "off screen" as it could be visible on a multi-monitor system, also there are issues with the focus. Whats wrong with hiding it? Windows have the visible style for a reason.
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      Appreciate it.
      The world is full of apathy, but who cares?

      Comment


      • #4
        Just creating a dialog does not show it. Even after issuing the DIALOG SHOW command, you can prevent it from displaying by intercepting the WM_INITDIALOG notification in your callback and instructing Windows not to display the dialog

        Code:
        SELECT CASE AS LONG CBMSG
                CASE %WM_INITDIALOG
                    DIALOG SHOW STATE CB.HNDL, %SW_HIDE   'see help on uses
        Rick Angell

        Comment


        • #5
          That is how I'm doing it.
          I noticed in PBForms %WS_VISIBLE is not an option
          Also noticed removing the option from Dialog New has no effect.
          I was curious why a dialog created with Dialog New -100,-100 still displays at 0,0
          Last edited by Mike Doty; 29 Sep 2008, 02:26 PM.
          The world is full of apathy, but who cares?

          Comment


          • #6
            I will take a guess at location is a DWORD and therefore a positive number??? and same with size???

            if so, then to not break things it would be 0, 0, 0, 0

            Engineer's Motto: If it aint broke take it apart and fix it

            "If at 1st you don't succeed... call it version 1.0"

            "Half of Programming is coding"....."The other 90% is DEBUGGING"

            "Document my code????" .... "WHYYY??? do you think they call it CODE? "

            Comment


            • #7
              >I will take a guess at location is a DWORD and therefore a positive number???

              Depends on how DIALOG NEW is implemented by the compiler.

              However, the only two ways I can think to implement it are with either CreateWindowEx or a DLGTEMPLATE for use with DialogBoxIndirect[Param] or CreateDialogIndirect[Param]. As all three of these functions accept a 'short' for location and an 'int' for size and these data types are signed binary integers, 'negative' numbers are accepted and because they are presumably behave differently than would the absolute values of same.

              That's a lot of geekspeak; from experience, 'minus' locations are off the screen and 'minus' sizes are either errors or something you can't see regardless of function used.

              But you can test it out for yourself easily enough: try it.

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X