In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to use the SetRegistryKey function, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
In the startup member function of MFC's CWinApp class, there is a SetRegistryKey function that sets a primary key for the program in the registry. Cooperate with WriteProfileInt and other functions to read and write the configuration file of the program.
SetRegistryKey (_ T (")); / / with this sentence, the read and write will / / specify its own INI file name for the INI file, otherwise the compiler will name the INI file free ((LPTSTR) theApp.m_pszProfileName); theApp.m_pszProfileName = (LPCTSTR) malloc (256); _ tcscpy ((LPTSTR) theApp.m_pszProfileName, _ T (" ScaleWeight "))
Write configuration file information as follows:
Void SecondDig::OnCancel () {CRect rect; GetWindowRect (& rect); theApp.WriteProfileInt (_ T ("InitData"), _ T ("left"), rect.left); theApp.WriteProfileInt (_ T ("InitData"), _ T ("top"), rect.top); theApp.WriteProfileInt (_ T ("InitData"), _ T ("right"), rect.right) TheApp.WriteProfileInt (_ T ("InitData"), _ T ("bottom"), rect.bottom); / / AfxMessageBox (_ T ("cancel")); / / DestroyWindow (); CDialogEx::OnCancel ();}
Read the configuration file information as follows:
BOOL SecondDig::OnInitDialog () {CDialogEx::OnInitDialog (); CRect rect; int left = theApp.GetProfileInt (_ T ("InitData"), _ T ("left"), 0); int top = theApp.GetProfileInt (_ T ("InitData"), _ T ("top"), 0); int right = theApp.GetProfileInt (_ T ("InitData"), _ T ("right"), 0) Int bottom = theApp.GetProfileInt (_ T ("InitData"), _ T ("bottom"), 0); rect.left = left; rect.top = top; rect.right = right; rect.bottom = bottom; this- > MoveWindow (& rect,true); return TRUE / / return TRUE unless you set the focus to a control / / exception: the OCX property page should return FALSE} Thank you for reading this article carefully. I hope the article "how to use the SetRegistryKey function" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.