Announcement

Collapse
No announcement yet.

Screen location

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

  • Scott Turchin
    replied
    Seemed like a lot of work initially but if you use this it may save some time re-starting the app.


    One question: Do I have to do a GetWindowRect first? Or does it do it for me?

    This might work

    I just gotta play with my binary registry data routine now...

    Thanks

    Scott


    [This message has been edited by Scott Turchin (edited July 09, 2000).]

    Leave a comment:


  • Scott Turchin
    replied
    The size of the app is fixed, but will that store WHERE? Sounds like it, I'll research it and try it out


    Tanks,

    Scott


    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    MCSE, MCP+Internet

    Leave a comment:


  • Lance Edmonds
    replied
    I'm surprised no-one has suggested GetWindowPlacement() and SetWindowPlacement()... you only need to save a WINDOWPLACEMENT structuce in the registery as binary data, and you can restores more than just the window size quite efficiently.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Scott Turchin
    replied
    Thanks,
    I may use my WriteIni function and save to an ini file, but I also use Innosetup adn give it all registry entries to delete on uninstall

    It's very good at that sort of thing too!


    Scott


    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    MCSE, MCP+Internet

    Leave a comment:


  • Bob Houle
    replied
    Scott,
    Why don't you try a small UDT and a data file in the user's application directory? It's a little old fashioned compared to writing to the registry, but it works for me. Besides, when the user deltes your application and it's folder there is no orphan info in the registry.

    Sample:
    Code:
    '======================================================================
    ' Time saver:
    '          Create a small one-time user information file
    '          to store data in the application's directory.
    '======================================================================
    
    ' Declare a UDT
    TYPE dirRec
         FromDirect AS STRING * 100   'Or whatever you need
         ToDirect AS STRING * 100
         mytime AS STRING * 3
    END TYPE
    
    ' Make it Global (if necesary)                                                                             
    GLOBAL Rec AS dirRec        
    
    ' Place info into a record
      Rec.FromDirect = "c:\myDirectory"     'Just sample info
      Rec.ToDirect = "e:\myOtherDirectory"
      Rec.myTime  = TRIM$(Minutes)
    
     ' Store this record info in User.DAT file
       OPEN "User.dat" FOR RANDOM AS #1 LEN = LEN(Rec)
       PUT #1, 1, Rec
       CLOSE
     
     ' Read the User.dat file and place info into your rec
       OPEN "User.dat" FOR RANDOM AS #1 LEN = LEN(Rec)
       GET #1, 1, Rec
       CLOSE
    HTH,
    Bob

    ------------------

    Leave a comment:


  • Fred Oxenby
    replied
    Message %WM_DESTROY is sent for every (child)Window
    You probably should compare hWnd = WindowToSave to select
    what window-pos to save to register just once...




    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

    Leave a comment:


  • Scott Turchin
    started a topic Screen location

    Screen location

    Why do I feel like I asked this question already..hehe...

    I'm saving to registry the location of the dialog box so that it will start there again where it was left off..

    Doing so on WM_DESTROY also.

    Code:
        Case %WM_DESTROY
            GetWindowRect hDlg, WndRect
            SaveSetting %HKEY_LOCAL_MACHINE,"Software\Computer Creations Software\" + g_szMine,"Top", Format$(WndRect.nTop)
            SaveSetting %HKEY_LOCAL_MACHINE,"Software\Computer Creations Software\" + g_szMine,"Left", Format$(WndRect.nLeft)
          Function = 0
          Exit Function

    The numbers don't seem to jive, am I going about this the wrong way?

    The SaveSetting is a registry save routine in my DLL.


    Thanks,

    Scott


    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    MCSE, MCP+Internet
Working...
X