window

How to use SetWinEventHook() function to get Active Window changed message

删除回忆录丶 提交于 2019-12-18 05:07:28
问题 I have been working on a project which needs to detect current active window and get the active window title continuously. Can anyone explain me how to use SetWinEventHook() function to get Active Window changed message. [ i used GetForegroundWindow() function with a timer to get the active window. That approach is not very accurate because of the timer. So i need to use it with SetWinEventHook() function. can someone explain me how to do that? ] hEvent = SetWinEventHook(EVENT_SYSTEM

Android 4.2 ACTION_OUTSIDE MotionEvent X and Y return 0 outside of own application

馋奶兔 提交于 2019-12-18 04:27:07
问题 I created a TYPE_SYSTEM_ALERT view, set the flags FLAG_NOT_TOUCH_MODAL and FLAG_WATCH_OUTSIDE_TOUCH , and added it with WindowManager.addView() . When I touch outside of the view onto my own activity, everything works and MotionEvent.getY() returns the correct value. However, if I exit my activity and and touch onto another application, MotionEvent.getY() always returns 0. I'm not sure if this only happens on 4.2 or not. Any help would be appreciated! 回答1: It's unfortunate that this question

Make Inno Setup WizardForm moveable if titlebar is disabled

血红的双手。 提交于 2019-12-18 04:23:17
问题 I want to make an installer with a custom look and disabled the titlebar by setting the BorderStyle to bsNone . Now I cannot move the window anymore. I have looked around and found a solution for Delphi: http://www.chami.com/tips/delphi/010397D.html Can this be accomplished in Inno Setup? I have already looked up the WM_NCHITTEST thing on MSDN but I cannot figure out if and how I can make this work. Edit: After looking around and compiling it using the advanced compiler advanced compiler I

Giving a command in a embedded terminal

夙愿已清 提交于 2019-12-18 04:23:13
问题 I'm using the following python code to embed a terminal window (from Ubuntu Linux) in a Tkinter window. I would like give the command 'sh kBegin' in the window automatically when the terminal window starts: from Tkinter import * from os import system as cmd root = Tk() termf = Frame(root, height=800, width=1000) termf.pack(fill=BOTH, expand=YES) wid = termf.winfo_id() cmd('xterm -into %d -geometry 160x50 -sb &' % wid) root.mainloop() Pseudo: cmd('xterm -into %d -geometry 160x50 -sb &' % wid)

Borderless windows on Linux

淺唱寂寞╮ 提交于 2019-12-18 04:21:44
问题 Is their a standard way to make a particular window borderless on Linux? I believe that the window border is drawn by your window manager, so it may be that I just need to use a particular window manager (that would be find, I'd just need to know which one)... My hope is that all the window managers might follow some standard that allows me to do this programatically... 回答1: Using Xlib and old _MOTIF_WM_HINTS : struct MwmHints { unsigned long flags; unsigned long functions; unsigned long

Make protractor test occupy the entire screen

我的梦境 提交于 2019-12-18 03:41:06
问题 I have seen a couple questions online related to this issue (How to set default browser window size in Protractor/WebdriverJS) but they don't address my issue. I have the tests that I want to be able to run successfully on a laptop screen or desktop screen of ant size. I had tried all of these methods below but unsuccesfully. The issue with this one is that I have to hardcode a width and height. I want to detect the screen size automatically browser.driver.manage().window().setSize(width,

Resolving windows in Structure Map or how to manage multiple windows in WPF MVVM?

雨燕双飞 提交于 2019-12-17 23:39:39
问题 I have been reading Mark Seeman's book on dependency injection in .NET and I'm struggling to configure composition root in WPF application. My container will be registered in the application startup method: protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var container = new Container(); container.Configure(r => { r.For<IAccountServices>().Use<AccountServicesProxy>(); r.For<MainWindow>().Use<MainWindow>(); }); } This makes sense as the application startup represents

Close child window, redirect parent window

本小妞迷上赌 提交于 2019-12-17 23:32:33
问题 I've got a page which opens a child window, from a parent. After the user has done something in the child window, I need the child window to close, and its parent window to be redirected to a page, on the click of a button in the child window. Any ideas? 回答1: from child: opener.location.href = '/redirect'; close(); 回答2: The key is to use window.opener to access the parent window: <script> window.opener.location = '/redirect.html'; window.close(); </script> 回答3: try this: var parent = window

Better window navigation in Emacs?

时间秒杀一切 提交于 2019-12-17 22:46:56
问题 When I split window in emacs several times (under terminal) the whole screen is divided into several parts with hierarchical arrangement. In vim it is easy to switch between windows intuitively with Control-w + (h,j,k,l), but in Emacs I can only use Control-x + o to switch to "the other window", which probably would require several iterations to finally get to the window I intend. I wonder if there is a better way similar to that in Vim to easily navigate between windows? 回答1: Have you tried

Window icon does not show

依然范特西╮ 提交于 2019-12-17 21:18:39
问题 I study this tutorial http://zetcode.com/gui/pyqt5/firstprograms/ and code here. import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.setGeometry(300, 300, 300, 220) self.setWindowTitle('Icon') self.setWindowIcon(QIcon('web.png')) self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_()) Can I show Window icon?