def sublime_opacity(opacity): if stt_settings is None: return if sublime_3: wndLst = [sublime.Window(hwnd) for hwnd in sublime_api.windows()] for wnd in wndLst: LHDesktop = GetDesktopWindow() LHWindow = wnd.hwnd() wl = GetWindowLong(LHWindow,GWL_EXSTYLE) try: if((wl & WS_EX_LAYERED) != WS_EX_LAYERED): parametro = str(LHWindow)+' '+ str(wl) ShellExecute(LHDesktop,"open", exe_file,parametro,None,SW_HIDE) if opacity is not None: SetLayeredWindowAttributes(LHWindow,0,opacity, LWA_ALPHA) cur_opacity = stt_settings.get("opacity", None) if cur_opacity != opacity: stt_settings.set("opacity", opacity) persist_settings() except ValueError: print("Error! ") else: #LHDesktop = GetDesktopWindow(None) LHDesktop = GetDesktopWindow() LHWindow = GetWindow(LHDesktop,GW_CHILD) Clase = 'PX_WINDOW_CLASS' while(LHWindow != None): LHParent = GetWindowLong(LHWindow, GWL_HWNDPARENT) clas = create_string_buffer(255) GetClassName(LHWindow,clas,255) classs = clas.value if IsWindowVisible(LHWindow): if (LHParent==0) or (LHParent==LHDesktop): if(classs==b'PX_WINDOW_CLASS'): #print('Applying opacity level ',opacity) wl = GetWindowLong(LHWindow,GWL_EXSTYLE) try: if((wl & WS_EX_LAYERED) != WS_EX_LAYERED): parametro = str(LHWindow)+' '+ str(wl) ShellExecute(LHDesktop,"open", exe_file,parametro,None,SW_HIDE) if opacity is not None: SetLayeredWindowAttributes(LHWindow,0,opacity, LWA_ALPHA) cur_opacity = stt_settings.get("opacity", None) if cur_opacity != opacity: stt_settings.set("opacity", opacity) persist_settings() break except ValueError: print("Error! ") LHWindow = GetWindow(LHWindow, GW_HWNDNEXT)
def windows(): return [Window(id) for id in sublime_api.windows()]
def windows(): return [Window(id) for id in sublime_api.windows()] def get_macro(): return sublime_api.get_macro()