CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2010
    Posts
    2

    Talking Saving and Restoring Windows Position with win32 api

    Hi guys, do you have any code in win32 api (c++) which can save and restore windows positions. I tried to googling on how to save and restore windows pos tutorial but I can't find the one which is in win32 api. Most of the tutorial is in mfc. Is there any source code in c++ using win32 api which can save/restore windows pos? Thanx.

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Saving and Restoring Windows Position with win32 api

    There is no API call to do this. You'll have to get your window position at exit, save it somewhere (probably registry) then retrieve this value when a new window is created.

  3. #3
    Join Date
    Feb 2010
    Posts
    2

    Re: Saving and Restoring Windows Position with win32 api

    Hi hoxsiew, do u know how can I store my windows position using registry? Do u hv any example code on how to do that? Thanx.

  4. #4
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Saving and Restoring Windows Position with win32 api

    No, not specifically.

    If you use a framework like MFC, it is done for you; the framework creates an entry in the software section for your application and it is easily accessed by the CWinApp members. Otherwise, you'll have to create the entry yourself. See:

    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

    for a list of the registry API functions.

    You can use GetWindowPlacement/SetWindowPlacement:

    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

    to save/restore window position information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured