Announcement

Collapse
No announcement yet.

Dialogs: created with pixels or units option?

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

  • Dialogs: created with pixels or units option?

    Hi all,

    is there a way to know at runtime if a dialog has been created with PIXELS or UNITS ?

    Thanks a lot
    Eros

  • #2
    There has to be a way, since the compiler does it. Probably some setting in the (proprietary) runtime.

    But you might be able to do it with something like...

    Code:
      FUNCTION GetDialogUnitofMeasure (BYVAL hWnd AS LONG) AS LONG
      LOCAL X, Y AS LONG, R AS RECT 
    
      DIALOG GET SIZE hWnd to X, Y  
      GetWindowRect  hWnd, R
     
      IF X  =  (R.nRight - R.nLeft) THEN 
         FUNCTION = %DIALOG_USES_PIXELS
      ELSE
          FUNCTION = %DIALOG_USES_DIALOG_UNITS
     END IF 
    END FUNCTION 
    
    ...
    CALLBACK FUNCTION ...... 
    
         UnitOfMeasure =  GetDialogUnitOfMeasure (CBHNDL) 
        .....
    MCM
    Last edited by Michael Mattias; 27 Aug 2008, 10:40 AM.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Thanks a lot Michael. Your solution seems perfect.

      Comment

      Working...
      X