MFC对话框位置问题

1、对话框在屏幕中心设置

ShowWindow(SW_NORMAL);
CRect rtDesk;
CRect rtDlg;
::GetWindowRect(::GetDesktopWindow(), &rtDesk);
GetWindowRect(&rtDlg);
int iXpos = rtDesk.Width() / 2 - rtDlg.Width() / 2;
int iYpos = rtDesk.Height() / 2 - rtDlg.Height() / 2;
SetWindowPos(NULL, iXpos, iYpos, 0, 0, SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);

2、对话框动态伸展变化

 

 

 

3、初始化文件ini

        CString filepath ;
	GetModuleFileName(NULL,filepath.GetBuffer(MAX_PATH),MAX_PATH);//得到运行文件路径
	filepath.ReleaseBuffer();
	filepath = filepath.Left(filepath.ReverseFind('\\'));//返回上一级
	filepath = filepath.Left(filepath.ReverseFind('\\'));//返回级数根据自己ini文件位置
	filepath +=_T("\\infig.ini");//找到自己的配置文件
	g_LangId = GetPrivateProfileInt( _T("Option"),_T("LanguageID"),-1, filepath );
 	CString strKeyValue;//写入的参数
	WritePrivateProfileString (_T("Option"), _T("LanguageID"),strKeyValue,filepath );

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

&小鹏鹏

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值