rdp-win32screenshot 0.0.7.1 → 0.0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/win32/screenshot/bitmap_maker.rb +2 -0
- data/lib/win32/util.rb +6 -0
- data/spec/win32_screenshot_util_spec.rb +4 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
0.0.7.
|
1
|
+
0.0.7.2
|
2
2
|
|
@@ -18,6 +18,8 @@ module Win32
|
|
18
18
|
[:long, :pointer, :int], :int
|
19
19
|
attach_function :window_text_length, :GetWindowTextLengthA,
|
20
20
|
[:long], :int
|
21
|
+
attach_function :class_name, :GetClassNameA,
|
22
|
+
[:long, :pointer, :int], :int
|
21
23
|
attach_function :window_visible, :IsWindowVisible,
|
22
24
|
[:long], :bool
|
23
25
|
attach_function :dc, :GetDC,
|
data/lib/win32/util.rb
CHANGED
@@ -20,6 +20,12 @@ module Win32
|
|
20
20
|
BitmapMaker.window_text(hwnd, title, title_length)
|
21
21
|
title.read_string
|
22
22
|
end
|
23
|
+
|
24
|
+
def window_class hwnd
|
25
|
+
title = FFI::MemoryPointer.new :char, 100
|
26
|
+
BitmapMaker.class_name(hwnd, title, 100)
|
27
|
+
title.read_string
|
28
|
+
end
|
23
29
|
|
24
30
|
def window_hwnd(title_query)
|
25
31
|
hwnd = BitmapMaker.hwnd(title_query)
|
@@ -34,6 +34,10 @@ describe Win32::Screenshot::Util do
|
|
34
34
|
height.should be > 100
|
35
35
|
end
|
36
36
|
|
37
|
+
it ".window_class returns classname of a specified window's handle" do
|
38
|
+
Win32::Screenshot::Util.window_class(@calc_hwnd).should == "CalcFrame"
|
39
|
+
end
|
40
|
+
|
37
41
|
after :all do
|
38
42
|
# test our hwnd -> pid method
|
39
43
|
calc_pid = Win32::Screenshot::Util.window_process_id(@calc_hwnd)
|