Advertisement
captmicro

Untitled

Jan 10th, 2013
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int FindWindow_l(lua_State *L)
  2. {
  3.     int i_count = lua_gettop(L);
  4.     if (i_count >= 1)
  5.     {
  6.         LPCSTR lpWindowName = (LPCSTR)lua_tostring(L, 1);
  7.         LPCSTR lpClassName = 0;
  8.         if (i_count == 2) lpClassName = (LPCSTR)lua_tostring(L, 2);
  9.        
  10.         HWND Window = FindWindowA(lpClassName, lpWindowName);
  11.         lua_pushnumber(L, (int)Window);
  12.     }
  13.     return 1;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement