make sure we close each handle opened by ProcessOpen in the win32 calls
This commit is contained in:
parent
0186145065
commit
7d4bded3d5
|
@ -307,6 +307,7 @@ class Stat_Window:
|
|||
pass
|
||||
|
||||
if event.button == 1: # left button event
|
||||
# TODO: make position saving save sizes as well?
|
||||
if event.state & gtk.gdk.SHIFT_MASK:
|
||||
self.window.begin_resize_drag(gtk.gdk.WINDOW_EDGE_SOUTH_EAST, event.button, int(event.x_root), int(event.y_root), event.time)
|
||||
else:
|
||||
|
|
|
@ -248,7 +248,9 @@ def get_nt_exe(hwnd):
|
|||
"""Finds the name of the executable that the given window handle belongs to."""
|
||||
processid = win32process.GetWindowThreadProcessId(hwnd)
|
||||
pshandle = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION | win32con.PROCESS_VM_READ, False, processid[1])
|
||||
return win32process.GetModuleFileNameEx(pshandle, 0)
|
||||
exename = win32process.GetModuleFileNameEx(pshandle, 0)
|
||||
win32api.CloseHandle(pshandle)
|
||||
return exename
|
||||
|
||||
def decode_windows(c, title, hwnd):
|
||||
"""Gets window parameters from the window title and handle--Windows."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user