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

📄 itapi3.cpp

📁 完整的MP3播放器源码
💻 CPP
字号:
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
//
// $NoKeywords: $
//
// @doc EXTERNAL API

#include "StdAfx.h"

#include "ITAPI.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////

static const TCHAR _szEdit[]      = _T("Edit");
static const TCHAR _szButton[]    = _T("Button");
static const TCHAR _szComboBox[]  = _T("ComboBox");
static const TCHAR _szListBox[]   = _T("ListBox");
static const TCHAR _szStatic[]    = _T("Static");

/////////////////////////////////////////////////////////////////////////////

// @func This function compares the window class name with the specified
// string.
//
// @parm The window handle of the window.
// @parm A string to compare the window class name to.
//
// @rdesc Nonzero if the class name matches the specified string; otherwise 0.
BOOL ITCLIB::CompareClassName(HWND hWndCtl, LPCTSTR lpszClassName)
{
	ASSERT(::IsWindow(hWndCtl));

	TCHAR szClassName[64];
//	if (::GetClassName(hWndCtl, szClassName, CountOf(szClassName)) == 0)
//		return FALSE;

	return (_tcscmp(szClassName, lpszClassName) == 0);
}

/////////////////////////////////////////////////////////////////////////////
// Control types

// @func This function determines if the specified window is an EDIT
// control based on its window class name.
//
// @parm The window handle of the window.
//
// @rdesc Nonzero if the specified window is an EDIT control; otherwise 0.
//
// @comm This function is in the ITCLIB namespace.
//
// @xref <t CompareClassName>
BOOL ITCLIB::IsEditControl(HWND hWndCtl)
{
	return CompareClassName(hWndCtl, _szEdit);
}

// @func This function determines if the specified window is a BUTTON
// control based on its window class name.
//
// @parm The window handle of the window.
//
// @rdesc Nonzero if the specified window is a BUTTON control; otherwise 0.
//
// @comm This function is in the ITCLIB namespace.
//
// @xref <t CompareClassName>
BOOL ITCLIB::IsButtonControl(HWND hWndCtl)
{
	return CompareClassName(hWndCtl, _szButton);
}

// @func This function determines if the specified window is a COMBOBOX
// control based on its window class name.
//
// @parm The window handle of the window.
//
// @rdesc Nonzero if the specified window is a COMBOBOX control; otherwise 0.
//
// @comm This function is in the ITCLIB namespace.
//
// @xref <t CompareClassName>
BOOL ITCLIB::IsComboBoxControl(HWND hWndCtl)
{
	return CompareClassName(hWndCtl, _szComboBox);
}

// @func This function determines if the specified window is a LISTBOX
// control based on its window class name.
//
// @parm The window handle of the window.
//
// @rdesc Nonzero if the specified window is a LISTBOX control; otherwise 0.
//
// @comm This function is in the ITCLIB namespace.
//
// @xref <t CompareClassName>
BOOL ITCLIB::IsListBoxControl(HWND hWndCtl)
{
	return CompareClassName(hWndCtl, _szListBox);
}

// @func This function determines if the specified window is a STATIC
// control based on its window class name.
//
// @parm The window handle of the window.
//
// @rdesc Nonzero if the specified window is a STATIC control; otherwise 0.
//
// @comm This function is in the ITCLIB namespace.
//
// @xref <t CompareClassName>
BOOL ITCLIB::IsStaticControl(HWND hWndCtl)
{
	return CompareClassName(hWndCtl, _szStatic);
}

⌨️ 快捷键说明

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