def create(self): brush = Sdk.CreateBrush(win32con.BS_SOLID, win32mu.RGB(self._bgcolor), 0) strclass = win32ui.GetAfx().RegisterWndClass(0, 0, brush, 0) style = win32con.WS_POPUP self.CreateWindowEx(win32con.WS_EX_TOPMOST, strclass, '', style, self._rect, self._parent, 0)
def InitInstance(self): afx = win32ui.GetAfx() afx.OleInit() afx.EnableControlContainer() self.LoadMainFrame() from pywinlib.framework import interact interact.CreateInteractiveWindow() interact.edit.currentView.GetParent().ShowWindow(win32con.SW_MAXIMIZE)
def console_callback(self): import win32ui,win32con cwnd=win32ui.GetAfx().GetMainWnd() if cwnd.IsWindowVisible(): cwnd.ShowWindow(win32con.SW_HIDE) else: cwnd.ShowWindow(win32con.SW_RESTORE) cwnd.ShowWindow(win32con.SW_SHOW) cwnd.BringWindowToTop()
__version__ = "$Id$" import win32ui, win32api, win32con afx = win32ui.GetAfx() sdk = win32ui.GetWin32Sdk() from appcon import UNIT_MM, UNIT_SCREEN, UNIT_PXL def GetSystemMetrics(): cxframe = win32api.GetSystemMetrics(win32con.SM_CXFRAME) cyframe = win32api.GetSystemMetrics(win32con.SM_CYFRAME) cxborder = win32api.GetSystemMetrics(win32con.SM_CXBORDER) cyborder = win32api.GetSystemMetrics(win32con.SM_CYBORDER) cycaption = win32api.GetSystemMetrics(win32con.SM_CYCAPTION) return cxframe, cyframe, cxborder, cyborder, cycaption def GetDeviceCaps(): wnd = sdk.GetDesktopWindow() dc = wnd.GetDC() width_pxl = dc.GetDeviceCaps(win32con.HORZRES) height_pxl = dc.GetDeviceCaps(win32con.VERTRES) #Number of pxl per logical inch dpi_x = dc.GetDeviceCaps(win32con.LOGPIXELSX) dpi_y = dc.GetDeviceCaps(win32con.LOGPIXELSY) #width_mm=dc.GetDeviceCaps(win32con.HORZSIZE) #height_mm=dc.GetDeviceCaps(win32con.VERTSIZE)