SHOW:
|
|
- or go back to the newest paste.
| 1 | - | int FindWindow_l(lua_State *L){
|
| 1 | + | int FindWindow_l(lua_State *L) |
| 2 | {
| |
| 3 | - | if(i_count == 2){
|
| 3 | + | |
| 4 | - | LPCSTR lpClassName = (LPCSTR)lua_tostring(L, 1); |
| 4 | + | if (i_count >= 1) |
| 5 | - | LPCSTR lpWindowName = (LPCSTR)lua_tostring(L, 2); |
| 5 | + | {
|
| 6 | - | |
| 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 | } |