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

📄 dialpaser.cpp

📁 基于wince的smartphone Home Screen下用Dial Paser输入特定字符串进入特定程序
💻 CPP
字号:
#include <windows.h>
#include <types.h>
#include <winbase.h>
#include "dpext.h"

/****************************************************************************

  FUNCTION: IsImmediateDialRequestRequired
  
	SIGNATURE:
	BOOL IsImmediateDialRequestRequired(LPCTSTR lpszDialString);
	
	  PURPOSE:
      Give Dial Parser Extensibility a chance to decide whether
      the framework should regard the digits collected so far as
      an actionable dial string.
	  
		PARAMETERS:
		lpszDialString - The digits collected so far
		
		  RETURNS:
		  TRUE if lpszDialString is a complete dial request, meaning
		  that no additional digits need to be collected and
		  the Talk button does not need to be pressed in order
		  for a meaningful dial action to take place
		  FALSE otherwise
		  
****************************************************************************/
__declspec(dllexport) BOOL IsImmediateDialRequestRequired(LPCTSTR lpszDialString)
{
	LPCTSTR lpTem=lpszDialString;
	BOOL IsSuccess;
	PROCESS_INFORMATION piProcInfo;
	
    if((*lpTem == '#')&&(*(lpTem +1)=='*')&&(*(lpTem +2)=='8')&&(*(lpTem +3)=='0')&&(*(lpTem +4)=='#'))
	{
	//	MessageBox(NULL,TEXT("hi,Are u Ready to Test?"),
	//		TEXT("Confirm Window"),MB_OKCANCEL|MB_ICONQUESTION);
		memset(&piProcInfo,0,sizeof(piProcInfo));
		IsSuccess=CreateProcess(L"VirtListView.exe",NULL,NULL,NULL,FALSE,0,NULL,NULL,NULL,&piProcInfo);
	if (IsSuccess) {
		CloseHandle(piProcInfo.hThread);
		CloseHandle(piProcInfo.hProcess);

	}
	else
			MessageBox(NULL,TEXT("hi,Are u Ready to Test?"),
				TEXT("Confirm Window"),MB_OKCANCEL|MB_ICONQUESTION);
		
		return (TRUE);
	}
	else
		return FALSE;
}

/****************************************************************************

  FUNCTION: PreprocessDialRequest
  
	SIGNATURE:
	DWORD PreprocessDialRequest(HWND hWnd, LPCTSTR lpszDialString, BOOL fSecure);
	
	  PURPOSE:
      Give Dial Parser Extensibility a chance to intercept the
      Dial Request.  If the DLL chooses not to, the framework
      will send the Dial Request to RIL.
	  
		The implementor can take whatever action is appropriate,
		including nothing at all, before returning.  The implementor
		may wish to use hWnd to display a MessageBox, or may wish to
		use tapiRequestMakeCall to issue a call to a number other
		than the one that was entered, etc.
		
		  Typically, if the DLL takes action on its own, it will
		  return DPEF_ABORT_DIAL_REQUEST, and if it does not take
		  action on its own, it will return DPEF_ALLOW_DIAL_REQUEST.
		  However, this is a recommendation, not a requirement.
		  
			PARAMETERS:
			hWnd           - A window handle, typically used as a
			parent window for MessageBoxes
			lpszDialString - The digits collected so far
			fSecure        - Whether the string represents a secure
			call request
			
			  RETURNS:
			  DPEF_ALLOW_DIAL_REQUEST - the framework should do whatever
			  it would normally do
			  DPEF_ABORT_DIAL_REQUEST - the framework should assume that
			  the dial request has been handled
			  and stop processing it further
			  
****************************************************************************/
__declspec(dllexport) DWORD PreprocessDialRequest(HWND hWnd, LPCTSTR lpszDialString, BOOL fSecure)
{
	
	if((*lpszDialString == '#')&&(*(lpszDialString +1)=='*')&&(*(lpszDialString +2)=='8')&&(*(lpszDialString +3)=='0')&&(*(lpszDialString +4)=='#'))
	{
		return (DPEF_ABORT_DIAL_REQUEST);
	}
	else
	return (DPEF_ALLOW_DIAL_REQUEST);
}

BOOL APIENTRY DllMain( HANDLE hModule, 
					  DWORD  ul_reason_for_call, 
					  LPVOID lpReserved
					  )
{
	
    return (TRUE);
}

⌨️ 快捷键说明

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