HWNDを知っているだけでプロセスの名前を取得する必要があります
私はそれがwin32apiまたはdlまたはwin32/apiで可能であることを知っていますが、そのapiのあまりにも奇妙なパラメーターについては何も知りません...私はnoobプログラミングです
私はwin32/api(win32apiではない)でHWNDを取得します。これは整数であり、16進数ではありませんが、簡単に変換できます...
これは私にハンドルを与えるコードです...
require 'win32/api'
include Win32
# Callback example - Enumerate windows
EnumWindows = API.new('EnumWindows', 'KP', 'L', 'user32')
GetWindowText = API.new('GetWindowText', 'LPI', 'I', 'user32')
EnumWindowsProc = API::Callback.new('LP', 'I'){ |handle, param|
buf = "\0" * 200
GetWindowText.call(handle, buf, 200);
if (!buf.index(param).nil?)
puts "window was found: handle #{handle}"
0 # stop looking after we find it
else
1
end
}
EnumWindows.call(EnumWindowsProc, 'the title here ')
そして今何?
助けてください!