www.pudn.com > doc2pdf-0_7_1.rar > doc2pdf_keystroke.h


///////////////////////////////////////////////////////////////////////////// 
//  
// Project:		Doc2pdf 
// 
// File:		doc2pdf_keystroke.h 
// 
// Author(s):	Matt Peterson  
// 
// Description:	Passes keystrokes using WM_JOURNAL_PLAYBACK 
// 
///////////////////////////////////////////////////////////////////////////// 
 
 
#include "stdafx.h" 
 
class Doc2pdfKeyEvents 
{ 
protected: 
	EVENTMSG*				m_EventArray;  
	int						m_Size; 
	int						m_Count; 
	int						m_Pos; 
	 
 
	void Realloc(int size); 
	int CharToEvent(int ch); 
	int	SpecialToEvent(const CString& str); 
	 
public: 
	Doc2pdfKeyEvents(); 
	~Doc2pdfKeyEvents(); 
 
	// Returns boolean. TRUE if empty. 
	BOOL Next(); 
 
	// Returns boolean 
	BOOL IsEmpty(); 
 
	// Returns zero on success, non-zero on error 
	int GetKeyEvent(EVENTMSG* msg); 
 
	// Returns zero on success, non-zero on error 
	int Init(const CString& keys); 
 
}; 
 
 
// Install the journal playback hook 
void Doc2pdfInstallJournalHook(); 
 
 
// Send the keystrokes in the string. 
// Example keystroke strings: 
// 
//		Wait for the notewpad window. press ctrl - p, wait for the print 
//      window, and press enter... 
//			"#WFWUntitled - Notepad##CTLP##WFWPrint#\n"  
// 
//		Wait for a window and type "hello world"... 
//			"#WFWUntitled - Notepad#hello world" 
// 
void Doc2pdfSendKeyStrokes(const CString& keystrokes); 
 
// Install the journal playback hook 
void Doc2pdfRemoveJournalHook(); 
 
// Remove all characters from a string that we can not send keystrokes for 
// Returns the number of characters removed 
int Doc2pdfTightyString(CString& str); 
 
 
// Boolean value.  FALSE if timed out 
BOOL Doc2pdfWaitForFile(HINSTANCE hmod,  
						const CString& file,  
						UINT flags,  
						int timeout); 
 
// Boolean value.  FALSE if timed out 
BOOL Doc2pdfWaitForWindow(HINSTANCE hmod,  
						  const CString& title, 
						  int timeout);