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

📄 c++文件读写.txt

📁 用C++写的一个模拟ATM自动取款机的程序.我这个程序不同于网上现有的那个不能记录用户填写信息的.
💻 TXT
📖 第 1 页 / 共 2 页
字号:
 
HFILE
 Handle to a file opened by OpenFile, not CreateFile.
 
HFONT
 Handle to a font.
 
HGDIOBJ
 Handle to a GDI object.
 
HGLOBAL
 Handle to a global memory block.
 
HHOOK
 Handle to a hook.
 
HICON
 Handle to an icon.
 
HIMAGELIST
 Handle to an image list.
 
HIMC
 Handle to input context.
 
HINSTANCE
 Handle to an instance.
 
HKEY
 Handle to a registry key.
 
HKL
 Input locale identifier.
 
HLOCAL
 Handle to a local memory block.
 
HMENU
 Handle to a menu.
 
HMETAFILE
 Handle to a metafile.
 
HMODULE
 Handle to a module. The value is the base address of the module.
 
HMONITOR
 Handle to a display monitor.
 
HPALETTE
 Handle to a palette.
 
HPEN
 Handle to a pen. 
 
HRGN
 Handle to a region.
 
HRSRC
 Handle to a resource.
 
HSZ
 Handle to a DDE string.
 
HWINSTA
 Handle to a window station.
 
HWND
 Handle to a window.
 
INT
 32-bit signed integer.
 
INT_PTR
 Signed integral type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.
 
INT32
 32-bit signed integer.
 
INT64
 64-bit signed integer.
 
LANGID
 Language identifier. For more information, see Locales.
 
LCID
 Locale identifier. For more information, see Locales.
 
LCTYPE
 Locale information type. For a list, see Locale and Language Information.
 
LONG
 32-bit signed integer. 
 
LONG_PTR
 Signed long type for pointer precision. Use when casting a pointer to a long to perform pointer arithmetic.
 
LONG32
 32-bit signed integer.
 
LONG64
 64-bit signed integer.
 
LONGLONG
 64-bit signed integer.
 
LPARAM
 Message parameter.
 
LPBOOL
 Pointer to a BOOL. 
 
LPBYTE
 Pointer to a BYTE. 
 
LPCOLORREF
 Pointer to a COLORREF value.
 
LPCRITICAL_SECTION
 Pointer to a CRITICAL_SECTION.
 
LPCSTR
 Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
 
LPCTSTR
 An LPCWSTR if UNICODE is defined, an LPCTSTR otherwise.
 
LPCVOID
 Pointer to a constant of any type.
 
LPCWSTR
 Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
 
LPDWORD
 Pointer to a DWORD.
 
LPHANDLE
 Pointer to a HANDLE.
 
LPINT
 Pointer to an INT.
 
LPLONG
 Pointer to a LONG.
 
LPSTR
 Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
 
LPTSTR
 An LPWSTR if UNICODE is defined, an LPSTR otherwise.
 
LPVOID
 Pointer to any type.
 
LPWORD
 Pointer to a WORD.
 
LPWSTR
 Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
 
LRESULT
 Signed result of message processing.
 
LUID
 Locally unique identifier. 
 
PBOOL
 Pointer to a BOOL.
 
PBOOLEAN
 Pointer to a BOOL.
 
PBYTE
 Pointer to a BYTE.
 
PCHAR
 Pointer to a CHAR.
 
PCRITICAL_SECTION
 Pointer to a CRITICAL_SECTION.
 
PCSTR
 Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
 
PCTSTR
 A PCWSTR if UNICODE is defined, a PCSTR otherwise.
 
PCWCH
 Pointer to a constant WCHAR.
 
PCWSTR
 Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. 
 
PDWORD
 Pointer to a DWORD.
 
PFLOAT
 Pointer to a FLOAT.
 
PHANDLE
 Pointer to a HANDLE.
 
PHKEY
 Pointer to an HKEY.
 
PINT
 Pointer to an INT. 
 
PLCID
 Pointer to an LCID.
 
PLONG
 Pointer to a LONG.
 
PLUID
 Pointer to a LUID. 
 
POINTER_32
 32-bit pointer. On a 32-bit system, this is a native pointer. On a 64-bit system, this is a truncated 64-bit pointer. 
 
POINTER_64
 64-bit pointer. On a 64-bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer.
 
PSHORT
 Pointer to a SHORT.
 
PSTR
 Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
 
PTBYTE
 Pointer to a TBYTE.
 
PTCHAR
 Pointer to a TCHAR.
 
PTSTR
 PWSTR if UNICODE is defined, a PSTR otherwise.
 
PTBYTE
 Pointer to a TBYTE.
 
PTCHAR
 Pointer to a TCHAR.
 
PTSTR
 A PWSTR if UNICODE is defined, a PSTR otherwise.
 
PUCHAR
 Pointer to a UCHAR.
 
PUINT
 Pointer to a UINT.
 
PULONG
 Pointer to a ULONG.
 
PUSHORT
 Pointer to a USHORT.
 
PVOID
 Pointer to any type.
 
PWCHAR
 Pointer to a WCHAR.
 
PWORD
 Pointer to a WORD.
 
PWSTR
 Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
 
REGSAM
 Security access mask for registry key.
 
SC_HANDLE
 Handle to a service control manager database. For more information, see SCM Handles.
 
SC_LOCK
 Handle to a service control manager database lock. For more information, see SCM Handles.
 
SERVICE_STATUS_HANDLE
 Handle to a service status value. For more information, see SCM Handles.
 
SHORT
 Short integer (16 bits).
 
SIZE_T
 The maximum number of bytes to which a pointer can point. Use for a count that must span the full range of a pointer.
 
SSIZE_ T
 Signed SIZE_T.
 
TBYTE
 A WCHAR if UNICODE is defined, a CHAR otherwise.
 
TCHAR
 A WCHAR if UNICODE is defined, a CHAR otherwise.
 
UCHAR
 Unsigned CHAR.
 
UINT
 Unsigned INT.
 
UINT_PTR
 Unsigned INT_PTR.
 
UINT32
 Unsigned INT32.
 
UINT64
 Unsigned INT64.
 
ULONG
 Unsigned LONG.
 
ULONG_PTR
 Unsigned LONG_PTR.
 
ULONG32
 Unsigned LONG32.
 
ULONG64
 Unsigned LONG64.
 
ULONGLONG
 64-bit unsigned integer.
 
UNSIGNED
 Unsigned attribute.
 
USHORT
 Unsigned SHORT.
 
VOID
 Any type.
 
WCHAR
 16-bit Unicode character. For more information, see Character Sets Used By Fonts.
 
WINAPI
 Calling convention for system functions.
 
WORD
 16-bit unsigned integer.
 
WPARAM
 Message parameter.
 

第二部分

WINDOWS应用程序设计用到的基本术语:

1.窗口

  任何一个使用过Windows的人对窗口这个概念绝对不会陌生,窗口是windows应用程序的基本操作单元,用户通过它与应用程序发生交互,例如输入输出操作等等,从程序的内部工作原来来看,每一个窗口对应一个消息处理队列,应用程序主要通过窗口消息处理函数对用户的输入操作进行响应与处理。要想从程序员的角度充分理解窗口的含义,那么对WNDCLASS这个数据结构进行充分的了解是必须的。

2.实例

  单个实例代表一个可执行程序在内存中的拷贝,如果一个应用程序执行许多次,那么在内存中就有多少个拷贝,也就可以说明有多少个实例存在。

3.句柄

  句柄在windows环境下被定义成了一个无符号的整数,用于标识应用程序中不同的对象和同类对象中的不同实例。句柄可以看成是对象的编号,联系上面的实例,那么一个实例句柄就可以看作是单个应用程序在内存中拷贝的唯一身份编号,通常系统只能通过实例句柄去识别不同的应用程序,或者是相同应用程序的不同副本。

4.资源

  Windows应用程序包含很多资源,例如,菜单,图标,对话框等等,VC++环境下我们不仅仅可以使用系统下原有的资源,我们也可以定义自己的资源,这些资源被定义在.RC文件中,通过应用程序最后的编译,这些资源文件和程序代码连接在一起,形成一个可执行的.EXE文件或者是一个.DLL的库文件。在使用这些资源的时候,通过WIN API函数学将这些资源调用使用。

5.窗口消息处理函数

  窗口是人机交互的接口,当窗口接受到输入请求的时候,就会把这一请求交给某一个函数进行处理,而这个函数就是窗口消息处理函数,它能够决定当一个消息被接受到的时候采取什么行动。

  消息通常是由一系列的输入操作触发的,比如当我按下鼠标左键那么窗口消息处理函数就会收到一个WM_LBUTTONDOWN的消息信号。在窗口消息处理函数中,我们可以利用switch和case结构进行控制, 针对此消息作出我们想要的操作。

6.图形设备接口

  应用程序的任何输出操作都需要通过图形设备接口(GDI)中的函数来完成操作,GDI负责系统与用户或绘图程序之间的信息交换,并控制在输出设备上显示图形或者文字,它将程序员与具体的硬件设备隔离开,让程序员不需要考虑硬件设备操作的细节。

7.回调函数

  回调函数是windows操作系统自己调用的函数,用户是不能直接调用他们的。回调函数的定义必须严格的按照windows标准进行编写。

  在下面我们将要看到的HelloWin程序中,WndProc就是一个回调函数,它是是应用程序的窗口消息处理函数,当注册窗口类的时候,要把窗口消息处理函数的地址告诉Windows,Windows通过调用此函数进行消息处理。


第三部分

Windows应用程序的基本运行机制与HelloWin程序详细解

  总的来说最基本的Windows应用程序的运行执行顺序总是以如下的基本顺序执行的。

顺序结构:

调用WinMain函数开始执行--à定义窗口类--à初始化窗口类---à窗口的实例化--à通过消息循环获取消息并将消息发送给消息处理函数做出相应的操作

  由于windows应用程序运行的逻辑结构特殊所以代码的详细解释笔者就不把程序于叙述分开了了,这样有利于阅读与分析。





⌨️ 快捷键说明

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