我做的对话框应用程序 只能在1024 * 768 的分辨率、 小字体下运行  要是改了屏幕分辨率或者是系统的字体 对话框上的控件布局就乱了  有没有比较好的解决办法?

解决方案 »

  1.   

    响应WM_DISPLAYCHANGE消息,在里面控制布局
      

  2.   

    响应OnSize函数,利用MoveWindow来控制控件位置和大小
    获取分辨率利用下面函数int GetSystemMetrics(
      int nIndex   // system metric or configuration setting to retrieve
    );SM_CXSCREEN, 
    SM_CYSCREEN Width and height, in pixels, of the screen of the primary display monitor. These are the same values you obtain by callingGetDeviceCaps(hdcPrimaryMonitor, HORZRES/VERTRES).