windows - findwindow doesn't work c++ -


so im trying create camo unlocker have never had trouble getting process id through findwindow

but im trying find black ops 2's proc id window name doesn't work

call of duty®: black ops ii

code:

#include <iostream> #include <windows.h> #include <tchar.h>  using namespace std;  int main(){      hwnd hwnd = findwindow(0, _t("call of duty®: black ops ii - multiplayer"));      if(hwnd){         cout << "window found" << endl;     }      return 0; } 

findwindow works correctly. possible causes problem are:

  1. you have encoding error. should use unicode api:

    hwnd hwnd = findwindoww(null, l"call of duty®: black ops ii - multiplayer"); 
  2. there no top level window window text. use tool spy++ check that.

you should make sure read documentation carefully. states following:

if function fails, return value null. extended error information, call getlasterror.

you should says , call getlasterror in event of failure.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -