window

Letting a Window believe it is still in focus although it is not

南笙酒味 提交于 2021-02-07 04:13:42
问题 I have to deal with a nasty MS Windows application that quits doing its job as soon as it loses focus. My question is, how can I trick this application somehow to believe that it is still in focus, although it really is not? My thoughts are: Is it possible to suppress the corresponding "WM" message from just this application? Can I send a fake message to this window that it acts like it is in focus? 回答1: Sending the WM_ACTIVATE message works for some apps: SendMessage(hWnd, WM_ACTIVATE, WA

vb.net unable to Console.SetWindowPosition

旧巷老猫 提交于 2021-02-05 09:56:05
问题 I'm creating a Windows Console application in VB.NET, and I am unable to set the window position relative to the screen. In short, I want a function to centre the window to the screen. I have tried to use Console.SetWindowPosition(w, h) method and Console.WindowTop , Console.WindowLeft properties. When returning the values for WindowTop and WindowLeft , they both return 0, and if I attempt to change these values with Console.WindowLeft = n (n > 0), the program throws an OutOfBounds exception,

Check if window is in background Tkinter

≡放荡痞女 提交于 2021-02-05 09:20:10
问题 So, I'm trying to make an app on tkinter . I've just started learning how this module works. In my app, I have a root window and a child (top leveled) window, and I set the child to be always on top. When I minimize my root window, the child window also minimizes, because I have defined that condition. My problem is when I select other window. When I do it, the child window still stays on top and I want to know if there is a way to know if my root window is in background, a.k.a.: I'm not

tkinter keeping window on top all times on MacOS

北城以北 提交于 2021-02-04 21:24:00
问题 I'm trying to create a screen "curtain" which blocks parts of the screen except for the mouse cursor's vicinity. On windows, using root.wm_attributes("-topmost", "true") keeps the window on top, even if I focus on another app, perfectly. However, upon running the code on MacOS, if the focus for the window is lost, it will not keep itself on topmost. What would be the MacOS equivalent to -topmost window manager attribute which will always keep the window on top, regardless of focus? import

tkinter keeping window on top all times on MacOS

房东的猫 提交于 2021-02-04 21:22:56
问题 I'm trying to create a screen "curtain" which blocks parts of the screen except for the mouse cursor's vicinity. On windows, using root.wm_attributes("-topmost", "true") keeps the window on top, even if I focus on another app, perfectly. However, upon running the code on MacOS, if the focus for the window is lost, it will not keep itself on topmost. What would be the MacOS equivalent to -topmost window manager attribute which will always keep the window on top, regardless of focus? import

Set a return value as variable in window batch

僤鯓⒐⒋嵵緔 提交于 2021-01-29 08:14:08
问题 How can I use if else statement to echo if value more than 1? @echo off setlocal set "sql=c:\xampp\mysql\bin\mysql.exe" for /f "usebackq" %%a in (`%sql% -u root -ss -e "select COUNT(*) FROM mytable" mydatabase`) do set TESTVAR=%%a if %TESTVAR% GEQ 1 (echo Database has already existed.) else echo import pause 回答1: Kind of like this: @echo off setlocal set "sql=c:\xampp\mysql\bin\mysql.exe" for /f "usebackq" %%a in (`%sql% -u root -ss -e "select COUNT^(*^) FROM browser" form_generator`) do set

Tkinter not creating a window?

邮差的信 提交于 2021-01-29 07:55:48
问题 I am trying to create a window with Tkinter but no window is being created and I am not receiving any error codes? from tkinter import * def login_window(): window=Tk() window.title("Login") info_lbl = Label(window) info_lbl.grid(row=0, column=1) username_lbl = Label(window, text='Username') username_lbl.grid(row=1, column=1) username_entry = Entry(window, width=10) username_entry.grid(row=1, column=2) password_lbl = Label(window, text='Password') password_lbl.grid(row=2, column=1) password

lxml installed with conda: “ImportError: DLL load failed: The specified procedure could not be found”

给你一囗甜甜゛ 提交于 2021-01-28 18:56:00
问题 I am using anaconda on windows 10 with the lastest version of conda 4.5.12 . I am creating a very simple test env to try to install lxml with python 3.6.6 . Here my environment.yml file: channels: - defaults dependencies: - python=3.6.6 - lxml Then I create an env using conda: conda env create -f environment_test.yml -n test26 Here the list of packages after the installation: (test26) C:>conda list # packages in environment at C:\Program Files\Anaconda3\envs\test26: # # Name Version Build

Is there anyway to get the position of android menubar item?

﹥>﹥吖頭↗ 提交于 2021-01-28 10:29:53
问题 I need to load Android dialog activity window once clicked on the icon in the action bar as displayed in the following image: I know how to load the window using the following code. resolver=getContentResolver(); layoutParams=getWindow().getAttributes(); layoutParams.x=400; layoutParams.height=600; layoutParams.width=1000; layoutParams.y= 30; this.getWindow().setAttributes(layoutParams); What I need to know is if there is any way to find out the position of the icon in action bar, without

Is there anyway to get the position of android menubar item?

白昼怎懂夜的黑 提交于 2021-01-28 10:27:22
问题 I need to load Android dialog activity window once clicked on the icon in the action bar as displayed in the following image: I know how to load the window using the following code. resolver=getContentResolver(); layoutParams=getWindow().getAttributes(); layoutParams.x=400; layoutParams.height=600; layoutParams.width=1000; layoutParams.y= 30; this.getWindow().setAttributes(layoutParams); What I need to know is if there is any way to find out the position of the icon in action bar, without