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

📄 tut11.html

📁 WINDOWS程序员使用指南--汇编基础
💻 HTML
📖 第 1 页 / 共 4 页
字号:
which pair of the filter strings will be initially used when the open file
dialog is first displayed. The index is 1-based, that is the first pair
is 1, the second pair is 2 and so on. So in the above example, if we specify
nFilterIndex as 2, the second pattern, "*.txt" will be used.</font></font></font></td>
</tr>

<tr>
<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>lpstrFile</font></font></font></td>

<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>Pointer
to the buffer that contains the filename used to initialize the filename
edit control on the dialog box. The buffer should be at least 260 bytes
long.&nbsp;</font></font></font>
<br><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>After
the user selects a file to open, the filename with full path is stored
in this buffer. You can extract the information from it later.</font></font></font></td>
</tr>

<tr>
<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>nMaxFile</font></font></font></td>

<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>The
size of the lpstrFile buffer.</font></font></font></td>
</tr>

<tr>
<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>lpstrTitle</font></font></font></td>

<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>Pointer
to the title of the open file dialog box</font></font></font></td>
</tr>

<tr>
<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>Flags</font></font></font></td>

<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>Determine
the styles and characteristics of the dialog box.</font></font></font></td>
</tr>

<tr>
<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>nFileOffset</font></font></font></td>

<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>After
the user selects a file to open, this member contains the index to the
first character of the actual filename. For example, if the full name with
path is "c:\windows\system\lz32.dll", the this member will contain the
value 18.</font></font></font></td>
</tr>

<tr>
<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>nFileExtension</font></font></font></td>

<td><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>After
the user selects a file to open, this member contains the index to the
first character of the file extension</font></font></font></td>
</tr>
</table></center>
<font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font>
<h3>
<font face="Arial,Helvetica"><font color="#CCCCCC"><font size=+0>Example:</font></font></font></h3>
<font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>The following
program displays an open file dialog box when the user selects File-> Open
from the menu. When the user selects a file in the dialog box, the program
displays a message box showing the full name, filename,and extension of
the selected file.</font></font></font><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font>
<p><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>.386</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>.model
flat,stdcall</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>option
casemap:none</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>WinMain
proto :DWORD,:DWORD,:DWORD,:DWORD</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>include
\masm32\include\windows.inc</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>include
\masm32\include\user32.inc</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>include
\masm32\include\kernel32.inc</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>include
\masm32\include\comdlg32.inc</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>includelib
\masm32\lib\user32.lib</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>includelib
\masm32\lib\kernel32.lib</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>includelib
\masm32\lib\comdlg32.lib</font></font></font></b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font>
<p><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>.const</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>IDM_OPEN
equ 1</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>IDM_EXIT
equ 2</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>MAXSIZE
equ 260</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>OUTPUTSIZE
equ 512</font></font></font></b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font>
<p><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>.data</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>ClassName
db "SimpleWinClass",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>AppName&nbsp;
db "Our Main Window",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>MenuName
db "FirstMenu",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>ofn&nbsp;&nbsp;
OPENFILENAME &lt;></font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>FilterString
db "All Files",0,"*.*",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
db "Text Files",0,"*.txt",0,0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>buffer
db MAXSIZE dup(0)</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>OurTitle
db "-=Our First Open File Dialog Box=-: Choose the file to open",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>FullPathName
db "The Full Filename with Path is: ",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>FullName&nbsp;
db "The Filename is: ",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>ExtensionName
db "The Extension is: ",0</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>OutputString
db OUTPUTSIZE dup(0)</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>CrLf
db 0Dh,0Ah,0</font></font></font></b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font>
<p><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>.data?</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>hInstance
HINSTANCE ?</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>CommandLine
LPSTR ?</font></font></font></b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font>
<p><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>.code</font></font></font></b> 
  <br>
  <b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>start:</font></font></font></b> 
  <br>
  <b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp; 
  invoke GetModuleHandle, NULL</font></font></font></b> <br>
  <b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp; 
  mov&nbsp;&nbsp;&nbsp; hInstance,eax</font></font></font></b> <br>
  <b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp; 
  invoke GetCommandLine<br>
  &nbsp;&nbsp;&nbsp;&nbsp;mov CommandLine,eax</font></font></font></b> <br>
  <b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp; 
  invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT</font></font></font></b> 
  <br>
  <b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp; 
  invoke ExitProcess,eax</font></font></font></b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1></font></font></font> 
<p><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>WinMain
proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp;
LOCAL wc:WNDCLASSEX</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp;
LOCAL msg:MSG</font></font></font></b>
<br><b><font face="Arial,Helvetica"><font color="#CCCCCC"><font size=-1>&nbsp;&nbsp;&nbsp;

⌨️ 快捷键说明

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