How are doing the comparison and what exactly are you comparing? Is it a C-style char array or a C++ string container? Are you using the equality operator ==? Let me take a guess and say you are using C-style char arrays and the equality operator.
Code:
char buffer[] = "Explorer.exe"
...
if( buffer == "Explorer.exe" )
{
// They are equal, do something
}
The reason that does not work is that both the array name (the part in blue) and the string literal (the part in red) are interpreted as addresses by the compiler in the code above. The if statement above is essentially seen as:
Code:
if( address of buffer == address of string literal "Explorer.exe" )
The addresses of these two things are NEVER going to be equal. The compiler will allocate different memory addresses to them.
If you want to compare these you need to use the strcmp function:
Code:
char buffer[] = "Explorer.exe";
...
if( strcmp(buffer,"Explorer.exe") == 0 )
{
// They are equal, do something
}
Or, you can just use a C++ string container which has an overloaded == operator and can correctly handle this case:
Code:
string buffer = "Explorer.exe";
...
if( buffer == "Explorer.exe" )
{
// They are equal, do something
}