Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EXE begin recording or playing 02

0 views
Skip to first unread message

John Doe

unread,
Feb 19, 2005, 4:13:52 AM2/19/05
to
The EXE code below does everything before recording or playing
(hopefully). Does not include keypad keys.

//condense title bar
int Place1=0,Place2=0;
bool Marked=false;
char TtlName[256];
char CpyTtlName[256];
//make search name
char BrdName[4]="Brd";
char PadName[4]="Pad";
char ExtName[5]=".txt";
char FdrName[35]="C:\\Program Files\\PadWorks\\scripts\\";
char KeyName[9]={0};
char PthName[320]={0};
//find script name
HANDLE FindHandle;
WIN32_FIND_DATA FindData;
bool GblFilName=false;
int LthFndFilName=0;
char*FilNamInTtlName=0;
char FndFilMchName[256]="";
LRESULT CMainFrame::ReceivedFromDLL(UINT wParam, LONG lParam)
{//EXE
*TtlName='\0';
*CpyTtlName='\0';
Marked=false;
GblFilName=false;
Place1=0;Place2=0;
//condense title bar
::GetWindowText(::GetForegroundWindow(),TtlName,255);
while(TtlName[Place1]!='\0')
{//EXE-WH_TB
while(isalnum(TtlName[Place1]))
{//EXE-WH_TB-WH_NRML
CpyTtlName[Place2]=TtlName[Place1];
Place1++;Place2++;
}//EXE-WH_TB-WH_NRML
while((TtlName[Place1]!='\0')&&(!isalnum(TtlName[Place1])))
{//EXE-WH_TB-WH_ODD
if(Marked)
{//EXE-WH_TB-WH_ODD-IF_MRKD
Place1++;
}//EXE-WH_TB-WH_ODD-IF_MRKD
else
{//EXE-WH_TB-WH_ODD-EL_MRK
CpyTtlName[Place2]=' ';
Marked=true;
Place1++;Place2++;
}//EXE-WH_TB-WH_ODD-EL_MRK
}//EXE-WH_TB-WH_ODD
Marked=false;
}//EXE-WH_TB
if(CpyTtlName[Place2-1]==' ')
{//EXE-terminate over space character
CpyTtlName[Place2-1]='\0';
}//EXE-terminate over space character
else
{//EXE-terminate the string
CpyTtlName[Place2]='\0';
}//EXE-terminate the string
//make search name
if(BrdKey)
{//EXE-keyboard key
strcpy(KeyName,BrdName);
}//EXE-keyboard key
else
{//
if(PadKey)
{//EXE-keypad key
strcpy(KeyName,PadName);
}//EXE-keypad key
else
{//non-alphanumeric key
return 0;
}//non-alphanumeric key
}//
KeyName[3]=(char)(wParam&0xff);
KeyName[4]='\0';
strcat(KeyName,ExtName);
strcpy(PthName,FdrName);
strcat(PthName,"*");
strcat(PthName,KeyName);
//find script name
*FndFilMchName='\0';
FindHandle=::FindFirstFile(PthName,&FindData);
if(FindHandle!=INVALID_HANDLE_VALUE)
{//EXE-seeking script
do
{//EXE-seeking script-more files
LthFndFilName=strlen(FindData.cFileName);
if(LthFndFilName>8)
{//EXE-found file name > key name
*(FindData.cFileName+LthFndFilName-9)='\0';
FilNamInTtlName=strstr(CpyTtlName,FindData.cFileName);
if(FilNamInTtlName!=0)
{//EXE-search for script-more files-script found
if(LthFndFilName>strlen(FndFilMchName))
{//EXE-search for script-more files-script found-LNGR_NAM_FD
strcpy(FndFilMchName,FindData.cFileName);
}//EXE-search for script-more files-script found-LNGR_NAM_FD
}//EXE-search for script-more files-script found
}//EXE-found file name > key name
else
{//EXE-global script found
GblFilName=true;
}//EXE-global script found
}//EXE-seeking script-more files
while(::FindNextFile(FindHandle,&FindData));
::FindClose(FindHandle);
}//EXE-seeking script
if(*FndFilMchName=='\0')
{//
if(GblFilName)
{//EXE-global script was only match
strcpy(PthName,FdrName);
strcat(PthName,KeyName);
}//EXE-global script was only match
else
{//EXE-no script found, start recording
strcpy(PthName,FdrName);
strcat(PthName,CpyTtlName);
strcat(PthName," ");
strcat(PthName,KeyName);
//Com_EXE_DLL(StartRecording);
//return 0;
}//EXE-no script found, start recording
}//
else
{//EXE-window title specific script found
strcpy(PthName,FdrName);
strcat(PthName,FndFilMchName);
strcat(PthName," ");
strcat(PthName,KeyName);
}//EXE-window title specific script found
OutputDebugString(PthName);
//Com_EXE_DLL(StartPlaying);
return 0;
}//EXE

0 new messages