





HWND windowHandle = FindWindow("USurface_266139671", NULL);
#include <iostream>
#include <windows.h>
using namespace std;
//Callback function. This function will be called for every open window
BOOL CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam ) {
int* found = reinterpret_cast<int*>(lParam); //Pointer to hold the result
char szClassName[80], szTitle[80];
GetClassNameA( hwnd, szClassName, sizeof(szClassName) ); //Gets the current window's class name
GetWindowTextA( hwnd, szTitle, sizeof(szTitle) ); //Gets the current window's title
if( strstr( szTitle, "Talisman Online" ) ) { //If the title contains the string
cout << "Window title: " << szTitle << endl;
cout << "Class name: " << szClassName << endl << endl;
*found = 1; //We found what we wanted
}
return TRUE;
}
BOOL FindGameWindow() {
int iFound = 0;
//Enumerates all open windows.
//It will call EnumWindowsProc for every window it finds.
EnumWindows( EnumWindowsProc, reinterpret_cast<LPARAM>( &iFound ) );
return iFound == 1;
}
// Main routine.
int main( int argc, char **argv ) {
while( !FindGameWindow() ) {
Sleep( 500 );
}
std::cout << "FOUND" << endl;
system( "pause" );
return 0;
}

#include <windows.h>
#include <Psapi.h>
#pragma comment(lib, "Psapi.lib")
#pragma comment(lib, "User32.lib") // Just for the messagebox
#define APPLICATION_NAME "client.exe"
bool CheckProcess(DWORD processID)
{
char szProcessName[MAX_PATH];
memset(szProcessName, 0x0, sizeof(szProcessName));
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, // Less access would be fine depending on what you want to do
FALSE, processID);
if(hProcess != NULL)
{
GetModuleBaseName(hProcess, NULL, szProcessName, sizeof(szProcessName));
if(strcmp(szProcessName, APPLICATION_NAME) == 0)
{
MessageBoxA(NULL, "Found the process!", "Found", MB_OK);
return true;
}
}
CloseHandle( hProcess );
return false;
}
bool CheckAllProcesses()
{
DWORD aProcesses[1024], cbNeeded, cProcesses;
if (!EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded))
{
return false;
}
cProcesses = cbNeeded / sizeof(DWORD);
for (int i = 0; i < cProcesses; i++)
{
if(aProcesses[i] != 0)
{
CheckProcess(aProcesses[i]);
}
}
return true;
}
int main()
{
CheckAllProcesses();
return 0;
}
#include <iostream>
#include <windows.h>
#include <TlHelp32.h>
using namespace std;
DWORD GetOutlookPID();
BOOL CALLBACK CloseOutlook(HWND hWnd,LPARAM lParam);
int main()
{
cout << "Exiting Outlook"<<endl;
cout<<endl;
DWORD PID = 0;
PID = GetOutlookPID();
EnumWindows((WNDENUMPROC)*CloseOutlook,(LPARAM)PID);
return 0;
}
BOOL CALLBACK CloseOutlook(HWND hWnd,LPARAM lParam)
{
DWORD PID = (DWORD)lParam;
DWORD test = 0;
DWORD ProcessID = 0;
DWORD dWait;
bool retValue = true;
HANDLE hHandle;
do
{
GetWindowThreadProcessId(hWnd,&ProcessID);
test = GetLastError();
if(ProcessID == PID)
{
DWORD dWait;
if(PostMessage(hWnd,WM_CLOSE,0,0) != 0)
{
hHandle = OpenProcess(PROCESS_TERMINATE|SYNCHRONIZE,false,PID);
dWait = WaitForSingleObject(hHandle,300);
if(dWait != WAIT_OBJECT_0)
{
/*if(dWait == WAIT_FAILED || dWait == WAIT_TIMEOUT)
{
TerminateProcess(hHandle,0);
}*/
}
}
retValue = false;
}
else
{
retValue = true;
}
}while(test == 0);
return retValue;
}
DWORD GetOutlookPID()
{
TCHAR * tName = "OUTLOOK.EXE\0";
HANDLE hProcess;
DWORD ProcessID;
PROCESSENTRY32 PE;
PE.dwSize = sizeof(PE);
bool bSuccess, bSuccess2 = true;
hProcess = CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
if(hProcess != INVALID_HANDLE_VALUE)
{
bSuccess = Process32First(hProcess,&PE);
if(bSuccess == true)
{
if(strcmp(PE.szExeFile,tName)==0)
{
ProcessID = PE.th32ProcessID;
}
else
{
do
{
bSuccess2 = Process32Next(hProcess,&PE);
if(bSuccess2 == true)
{
if(strcmp(PE.szExeFile,tName) == 0)
{
ProcessID = PE.th32ProcessID;
}
}
}while(bSuccess2 == true);
}
}
CloseHandle(hProcess);
}
return ProcessID;
}