⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resswitch.htm

📁 改变屏幕的深度和分辨率
💻 HTM
字号:
<html>

<head>
<title>ResSwitch &amp; ResList v1.2</title>
</head>

<body bgcolor="#FFFFFF">

<h2><img src="resswitch.gif" width="35" height="37" alt="resswitch.gif (383 bytes)"><font
face="Arial"><a href="http://localhost/download/qres.zip">ResSwitch &amp; ResList v1.2</a>
<i>2 freeware utilities including MFC source code to quickly change Screen Depth and
Resolution</i></font></h2>

<p><font face="Arial" size="3">Tired of using the Windows Control panel or QuickRes to
change your graphics cards screen depth &amp; resolution. This program uses the command
line sent to it to change the screen depth &amp; resolution. For example to change into
1024 * 768 in 24 bit colour, just use the command line &quot;ResSwitch.exe 1024 768 24
0&quot;. With this structure you can create a number of shortcuts to ResSwitch on your
desktop using different command lines which will allow you to change mode with a simple
double click on your desktop. By setting up shortcut keys in the shortcut file to
ResSwitch you can quickly change modes by just using the keyboard only. The size of the
binary file itself is only 6K. </font></p>

<p><font face="Arial" size="3">Also included is ResList which is a simple console app
which lists the available video modes which ResSwitch can use.</font></p>

<p><font face="Arial" size="3">The </font><font face="Arial"><a
href="http://localhost/download/qres.zip">enclosed zip file</a> contains </font><font
face="Arial" size="3">the ResSwitch and ResList source code, a very handy MFC class to
wrap access to the two underlying API's ResSwitch and ResList uses and a prebuilt binary
version of both programs. The enclosed binary requires that you have the MFC 4.2b DLLs
already installed. If you haven磘 already got them on your machine (MFC42.DLL in your
Windows system directory), then grab them from Microsoft磗 web site at <a
href="http://activex.microsoft.com/controls/vc/mfc42.cab">http://activex.microsoft.com/controls/vc/mfc42.cab</a></font></p>

<p>&nbsp;</p>

<table>
  <tr>
    <td><font face="Arial"><a href="#Usage">Usage</a></font></td>
  </tr>
  <tr>
    <td><font face="Arial"><a href="#History">History</a></font></td>
  </tr>
  <tr>
    <td><font face="Arial"><a href="#APIReference">API Reference</a></font></td>
  </tr>
  <tr>
    <td><font face="Arial"><a href="#Contact">Contacting the Author</a></font></td>
  </tr>
</table>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="Usage"></a><font face="Arial"><big><big><strong>Usage</strong></big></big></font>

<ul>
  <li><font color="#000000" size="3" face="Arial">To use the class in your code simply include
    videomod.cpp in your project and #include videomod.h in which ever of your modules needs
    to make calls to the class.</font></li>
  <li><font face="Arial">Your code will need to include MFC either statically or dynamically.</font></li>
  <li><font face="Arial">You will also need to have afxtempl.h in your precompiled header.</font></li>
  <li><font face="Arial">To see the class in action, have a look at the code in the main
    function in the module &quot;ResList.cpp&quot; or the Winmain function in the module
    &quot;ResSwitch.cpp&quot;.</font></li>
</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><big><a name="History"></a></big><font color="#000000" size="5"><strong>History</strong></font></font></p>

<p><strong><font face="Arial">v1.1 (25 September 1997</font>)</strong> 

<ul>
  <li><font face="Arial">Changed name &quot;QuickerRes&quot; to &quot;QRes&quot; to avoid
    conflict with an similarly named third party product. </font></li>
  <li><font face="Arial">Now supports setting the monitor frequency (NT only according to the
    documentation).</font> </li>
  <li><font face="Arial">Inclusion of a new console mode program called QList (binary &amp;
    source code) with enumerates all the video modes available. Comes in helpful if QRes is
    reporting that some options you select is unavailable.</font> </li>
</ul>

<p><strong><font face="Arial">v1.2 (4 January 1999</font>)</strong> 

<ul>
  <li><font face="Arial">Changed name (yet again) from &quot;QRes&quot; to
    &quot;ResSwitch&quot; to avoid conflict with another similarly named third party product. </font></li>
  <li><font face="Arial">Source code now ships with Visual C++ 5 workspace files now as
    standard.</font></li>
  <li><font face="Arial">All source code is now fully UNICODE enabled and UNICODE build
    configurations are now provided.</font></li>
  <li><font face="Arial">General tidy up of the codebase.</font></li>
  <li><font face="Arial">Full documentation is provided for the code in the form of this HTML
    file.</font></li>
</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p class="crt"><font face="Arial"><a name="APIReference"></a><big><big><strong>API
Reference</strong></big></big></font></p>

<p><font face="Arial">The API consists of the public member functions of the classes
CVideoMode &amp; CVideoModes</font></p>

<p><font face="Arial"><a href="#CVideoMode">CVideoMode</a><br>
<a href="#GetCurrentVideoMode">CVideoModes::GetCurrentVideoMode</a><br>
<a href="#GetAvailableVideoModes">CVideoModes::GetAvailableVideoModes</a><br>
<a href="#ChangeVideoModePermanently">CVideoModes::ChangeVideoModePermanently</a><br>
<a href="#ChangeVideoModeTemporarily">CVideoModes::ChangeVideoModeTemporarily</a><br>
<a href="#CanChangeVideoMode">CVideoModes::CanChangeVideoMode</a><br>
<a href="#RevertVideoModeToDefault">CVideoModes::RevertVideoModeToDefault</a></font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="CVideoMode" href="#CSMTPAddress"></a><font face="Arial"><big><strong>CVideoMode</strong></big></font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">This class is an encapsulation of a video mode. It contains 4 public
member variables, namely:</font></p>

<p><font face="Arial"><em>m_dwBitsPerPixel</em>: Specifies in bits per pixel the colour
resolution of the display device. For example: 4 bits for 16 colours, 8 bits for 256
colours, or 16 bits for 65,536 colours.</font></p>

<p><font face="Arial"><em>m_dwWidth</em>: Specifies the width, in pixels, of the display
device.</font></p>

<p><font face="Arial"><em>m_dwHeight</em>: Specifies the height, in pixels, of the display
device.</font></p>

<p><font face="Arial"><em>m_dwFrequency</em>: Specifies the frequency, in hertz of the
display device in a particular mode. On some early builds of Windows 95, changing the
frequency of the display adapter is not supported and this value should be set to 0 which
means the default hardware value.</font></p>

<p>&nbsp;</p>

<p><a name="GetCurrentVideoMode"></a><big><font face="Arial"><strong>CVideoModes::GetCurrentVideoMode</strong></font></big></p>

<p><font face="Arial"><strong>static BOOL CVideoModes::GetCurrentVideoMode(CVideoMode&amp;
</strong><em>mode</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">TRUE if the current video mode was retrieved successfully
otherwise FALSE.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>mode</em> Upon successful return this will contain the current
video mode of the main display adapter.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Internally this retrieves the current settings GetDeviceCaps
function on a device context for the display.</font></p>

<p>&nbsp;</p>

<p><a name="GetAvailableVideoModes"></a><big><font face="Arial"><strong>CVideoModes::GetAvailableVideoModes</strong></font></big></p>

<p><font face="Arial"><strong>static BOOL
CVideoModes::GetAvailableVideoModes(CAvailableVideoModes&amp; </strong><em>modes</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">TRUE if the available video modes were retrieved
successfully otherwise FALSE.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>modes</em> Upon successful return this will contain an array
containing the available video modes of the main display adapter. </font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Returns all the video modes which the display adapter supports.</font></p>

<p><font face="Arial">CAvailableVideoModes is defined as follows: </font>

<dl>
  <dd><font face="Arial"><em>typedef CArray&lt;CVideoMode, CVideoMode&amp;&gt;
    CAvailableVideoModes; </em></font></dd>
</dl>

<p>&nbsp;</p>

<p><a name="ChangeVideoModePermanently"></a><big><font face="Arial"><strong>CVideoModes::ChangeVideoModePermanently</strong></font></big></p>

<p><font face="Arial"><strong>static LONG CVideoModes::ChangeVideoModePermanently(const
CVideoMode&amp; </strong><em>mode</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p><font face="Arial">Returns one of the following values: </font></p>

<table>
<TBODY>
  <tr vAlign="top">
    <td><font face="Arial" size="2"><b>Value</b> </font></td>
    <td><font face="Arial" size="2"><b>Meaning</b> </font></td>
  </tr>
  <tr vAlign="top">
    <td><font face="Arial" size="2">DISP_CHANGE_SUCCESSFUL </font></td>
    <td><font face="Arial" size="2">The settings change was successful. </font></td>
  </tr>
  <tr vAlign="top">
    <td><font face="Arial" size="2">DISP_CHANGE_RESTART </font></td>
    <td><font face="Arial" size="2">The computer must be restarted in order for the graphics
    mode to work. </font></td>
  </tr>
  <tr vAlign="top">
    <td><font face="Arial" size="2">DISP_CHANGE_BADFLAGS </font></td>
    <td><font face="Arial" size="2">An invalid set of flags was passed in. </font></td>
  </tr>
  <tr vAlign="top">
    <td><font face="Arial" size="2">DISP_CHANGE_FAILED </font></td>
    <td><font face="Arial" size="2">The display driver failed the specified graphics mode. </font></td>
  </tr>
  <tr vAlign="top">
    <td><font face="Arial" size="2">DISP_CHANGE_BADMODE </font></td>
    <td><font face="Arial" size="2">The graphics mode is not supported. </font></td>
  </tr>
  <tr vAlign="top">
    <td><font face="Arial" size="2">DISP_CHANGE_NOTUPDATED </font></td>
    <td><font face="Arial" size="2">Unable to write settings to the registry. </font></td>
  </tr>
</TBODY>
</table>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>mode</em> The video mode to change into.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">If this function succeeds then the changes are permanent, meaning
that upon next boot of Windows the video mode will be the preserved to that which you just
changed into.</font></p>

<p>&nbsp;</p>

<p><a name="ChangeVideoModeTemporarily"></a><big><font face="Arial"><strong>CVideoModes::ChangeVideoModeTemporarily</strong></font></big></p>

<p><font face="Arial"><strong>static LONG CVideoModes::ChangeVideoModeTemporarily(const
CVideoMode&amp; </strong><em>mode</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="rl"><font face="Arial">The return value is the same as <a
href="#ChangeVideoModePermanently">ChangeVideoModePermanently</a></font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>mode</em> The video mode to change into. </font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">If this function succeeds then the changes are not permanent,
meaning that upon next boot of Windows the video mode will be the the same as before you
called this function.</font></p>

<p>&nbsp;</p>

<p><a name="CanChangeVideoMode"></a><big><font face="Arial"><strong>CVideoModes::CanChangeVideoMode</strong></font></big></p>

<p><font face="Arial"><strong>static LONG CVideoModes::CanChangeVideoMode(const
CVideoMode&amp; </strong><em>mode</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="rl"><font face="Arial">The return value is the same as <a
href="#ChangeVideoModePermanently">ChangeVideoModePermanently</a></font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>mode</em> The video mode to test whether or not the change can
be made.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Using this function allows an application to determine if a
specified graphics modes is actually valid, without causing the system to change to that
graphics mode.</font></p>

<p>&nbsp;</p>

<p><a name="RevertVideoModeToDefault"></a><big><font face="Arial"><strong>CVideoModes::RevertVideoModeToDefault</strong></font></big></p>

<p><strong><font face="Arial">static LONG CVideoModes::RevertVideoModeToDefault();</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="rl"><font face="Arial">The return value is the same as <a
href="#ChangeVideoModePermanently">ChangeVideoModePermanently</a></font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Using this function allows an application to determine if a
specified graphics modes is actually valid, without causing the system to change to that
graphics mode. </font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><a name="Contact"></a><font color="#000000" size="4"><strong>CONTACTING
THE AUTHOR</strong></font></font></p>

<p><font face="Arial" color="#000000" size="3">PJ Naughter<br>
Email: <a href="mailto:pjn@indigo..ie">pjn@indigo.ie</a><br>
Web: <a href="http://indigo.ie/~pjn">http://indigo.ie/~pjn</a><br>
4th January 1999</font></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -