Click here to Skip to main content
15,892,517 members
Articles / Mobile Apps / Windows Mobile

Scraping Text from the Screen

Rate me:
Please Sign up or sign in to vote.
4.96/5 (36 votes)
17 Jun 2010CPOL8 min read 108.8K   8.6K   83  
How to programmatically read text from any process at any point on the screen
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9.00"
	Name="ReadScreenText"
	ProjectGUID="{93FC999E-E635-490C-A16A-D0F27551A2DF}"
	RootNamespace="ReadScreenText"
	TargetFrameworkVersion="196613"
	>
	<Platforms>
		<Platform
			Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
			OutputDirectory="$(PlatformName)\Debug"
			IntermediateDirectory="$(PlatformName)\Debug"
			ConfigurationType="1"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				PreprocessorDefinitions="_DEBUG"
				MkTypLibCompatible="false"
				GenerateStublessProxies="true"
				TypeLibraryName="$(IntDir)/ReadScreenText.tlb"
				HeaderFileName="ReadScreenText.h"
				DLLDataFileName=""
				InterfaceIdentifierFileName="ReadScreenText_i.c"
				ProxyFileName="ReadScreenText_p.c"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				Optimization="0"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;_DEBUG;$(PLATFORMDEFINES);$(ARCHFAM);$(_ARCHFAM_);_UNICODE;ARMV4I"
				MinimalRebuild="true"
				RuntimeLibrary="1"
				UsePrecompiledHeader="2"
				WarningLevel="4"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="true"
				AdditionalOptions=" /subsystem:windowsce,5.01 /machine:THUMB"
				AdditionalDependencies="atlsd.lib libcmtd.lib corelibc.lib coredll.lib commctrl.lib ole32.lib oleaut32.lib uuid.lib atl.lib atlosapis.lib $(NOINHERIT) $(NOINHERIT)"
				LinkIncremental="2"
				DelayLoadDLLs="$(NOINHERIT)"
				GenerateDebugInformation="true"
				SubSystem="0"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCCodeSignTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
			<DeploymentTool
				ForceDirty="-1"
				RemoteDirectory=""
				RegisterOutput="0"
				AdditionalFiles="atl80.dll"
			/>
			<DebuggerTool
			/>
		</Configuration>
		<Configuration
			Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
			OutputDirectory="$(PlatformName)\Release"
			IntermediateDirectory="$(PlatformName)\Release"
			ConfigurationType="1"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				PreprocessorDefinitions="NDEBUG"
				MkTypLibCompatible="false"
				GenerateStublessProxies="true"
				TypeLibraryName="$(IntDir)/ReadScreenText.tlb"
				HeaderFileName="ReadScreenText.h"
				DLLDataFileName=""
				InterfaceIdentifierFileName="ReadScreenText_i.c"
				ProxyFileName="ReadScreenText_p.c"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;NDEBUG;$(PLATFORMDEFINES);$(ARCHFAM);$(_ARCHFAM_);_UNICODE;ARMV4I"
				ExceptionHandling="0"
				RuntimeLibrary="0"
				UsePrecompiledHeader="2"
				WarningLevel="3"
				DebugInformationFormat="0"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="true"
				AdditionalOptions=" /subsystem:windowsce,5.01 /machine:THUMB"
				AdditionalDependencies="atls.lib libcmt.lib corelibc.lib coredll.lib commctrl.lib ole32.lib oleaut32.lib uuid.lib atl.lib atlosapis.lib $(NOINHERIT) $(NOINHERIT)"
				LinkIncremental="1"
				DelayLoadDLLs="$(NOINHERIT)"
				SubSystem="0"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCCodeSignTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
			<DeploymentTool
				ForceDirty="-1"
				RemoteDirectory=""
				RegisterOutput="0"
				AdditionalFiles="atl80.dll"
			/>
			<DebuggerTool
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
			>
			<File
				RelativePath=".\MainDlg.cpp"
				>
			</File>
			<File
				RelativePath=".\ReadScreenText.cpp"
				>
			</File>
			<File
				RelativePath=".\stdafx.cpp"
				>
				<FileConfiguration
					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
					>
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="1"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
					>
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="1"
					/>
				</FileConfiguration>
			</File>
			<Filter
				Name="ScreenScrape"
				>
				<File
					RelativePath=".\ScreenScrape\ScreenScrape.cpp"
					>
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl;inc"
			>
			<File
				RelativePath=".\MainDlg.h"
				>
			</File>
			<File
				RelativePath=".\resource.h"
				>
			</File>
			<File
				RelativePath=".\stdafx.h"
				>
			</File>
			<Filter
				Name="ScreenScrape"
				>
				<File
					RelativePath=".\ScreenScrape.h"
					>
				</File>
				<Filter
					Name="detail"
					>
					<File
						RelativePath=".\ScreenScrape\detail\ListBox.hpp"
						>
					</File>
					<File
						RelativePath=".\ScreenScrape\detail\ListView.hpp"
						>
					</File>
					<File
						RelativePath=".\ScreenScrape\detail\MappedFileAllocator.hpp"
						>
					</File>
					<File
						RelativePath=".\ScreenScrape\detail\Static.hpp"
						>
					</File>
					<File
						RelativePath=".\ScreenScrape\detail\Tab.hpp"
						>
					</File>
				</Filter>
			</Filter>
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"
			>
			<File
				RelativePath=".\res\findere.bmp"
				>
			</File>
			<File
				RelativePath=".\res\finderf.bmp"
				>
			</File>
			<File
				RelativePath=".\res\ReadScreenText.ico"
				>
			</File>
			<File
				RelativePath=".\ReadScreenText.rc"
				>
			</File>
			<File
				RelativePath=".\ReadScreenText.rc2"
				>
			</File>
		</Filter>
	</Files>
	<Globals>
		<Global
			Name="RESOURCE_FILE"
			Value="ReadScreenText.rc"
		/>
	</Globals>
</VisualStudioProject>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) An engineering firm in Cedar Rapids, Iowa
United States United States
I'm also on the MSDN forums
http://social.msdn.microsoft.com/profile/paulh79

Comments and Discussions