window-handles

Windows Handling Closes the whole browser if i try to close the current window in python

人盡茶涼 提交于 2019-12-02 15:43:01
问题 Am currently using windows handling for opening the map direction in the new window and after it opens i will be closing the child window, which is opened and do the remaming work in the code.But it is closing the whole browser, while debugging it is working correctly , but while running the code, am Getting the error as, Error - selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed Down i have attached the code, ##Clicking on The Map Image

How do I create a message-only window from windows forms?

时光毁灭记忆、已成空白 提交于 2019-12-02 04:32:20
问题 I'm trying to create a message-only window to receive window messages from an MFC library class, within a winforms application. I've tried subclassing NativeWindow , and in the constructor requesting a window handle like this: CreateParams cp = new CreateParams(); cp.Parent = (IntPtr)HWND_MESSAGE; this.CreateHandle(cp); but I get a Win32Exception thrown with the message "Error creating window handle". How do I create a message-only window from windows forms? Is using NativeWindow the right

How do I create a message-only window from windows forms?

大憨熊 提交于 2019-12-02 00:30:07
I'm trying to create a message-only window to receive window messages from an MFC library class, within a winforms application. I've tried subclassing NativeWindow , and in the constructor requesting a window handle like this: CreateParams cp = new CreateParams(); cp.Parent = (IntPtr)HWND_MESSAGE; this.CreateHandle(cp); but I get a Win32Exception thrown with the message "Error creating window handle". How do I create a message-only window from windows forms? Is using NativeWindow the right approach? I know this is 7.5 years old, but just in case anyone finds this, I thought I would respond. I

Mac OS X: Can one process render to another process's window?

前提是你 提交于 2019-11-29 20:38:58
Greetings! I'm currently porting a web browser plugin from Win32 to MacOSX. One of the features of the plugin is that when the plugin is loaded, it spawns a separate process that serves as the "engine" of the plugin and executes drawing operations into the window of the plugin (specifically, by attaching an OpenGL context to the parent process's window and executing OpenGL rendering commands into that context). We do this because the plugin is typically loaded as a thread within the browser process, so crashes in the plugin would take down the whole browser. By partitioning the 'heavy lifting'

How to change console window style at runtime?

自古美人都是妖i 提交于 2019-11-29 16:50:54
I'm making a game in console application and I want to prevent user resizing and maximizing window. How can I do this using HWND? I found solution. This code will disable window Size and Maximize box: HWND consoleWindow = GetConsoleWindow(); SetWindowLong(consoleWindow, GWL_STYLE, GetWindowLong(consoleWindow, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX); 来源: https://stackoverflow.com/questions/41172595/how-to-change-console-window-style-at-runtime

C# window positioning

混江龙づ霸主 提交于 2019-11-29 10:04:05
Using Windows Forms I wanted to position window into specific coords. I thought it can be done in a simple way, but following code does not work at all: public Form1() { InitializeComponent(); this.Top = 0; this.Left = 0; } However, when only get a handle to that window, it works well: public Form1() { InitializeComponent(); IntPtr hwnd = this.Handle; this.Top = 0; this.Left = 0; } You can see that I am not working with that pointer at all. I found at MSDN following statement: The value of the Handle property is a Windows HWND. If the handle has not yet been created, referencing this property

C++: Best way to get Window Handle of the only window from a process by process id, process handle and title name [duplicate]

大城市里の小女人 提交于 2019-11-29 06:58:57
This question already has an answer here: How to get main window handle from process id? 7 answers I'm looking for the best way to get a Window Handle in the following situation: I have the process id and process handle , I know the window titlename and I know that the process has only one window . So how would I do it? FindWindow ? EnumWIndows ? Using FindWindow requires that you either know the window class or the window title. Both of these are not necessarily unique. Since you alread have the process handle (and its ID) you can implement a robust solution using EnumWindows . First, declare

Modifying opacity of any window from C#

梦想的初衷 提交于 2019-11-29 05:16:49
Is it possible to modify the opacity of all opened windows from C#. I googled for minimizing the windows and i came to know that its possible with pInvoke calls. It even worked. Similarly is it possible to change the opacity of all the opened windows from C#? Also, i am not in to MFC stuffs. Still is there any tools to know the list of apis exposed in a dll? You can use SetLayeredWindowAttributes API to do so. Check this for the pInvoke version of this API. Sample Code from the above-mentioned link: [DllImport("user32.dll")] static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey

C# get window handle after starting a process

和自甴很熟 提交于 2019-11-28 12:30:45
Is there a way to get the window handle (IntPtr) for a window after its launched from a C# app with Process.Start()? If it's the main window you're after, Process.MainWindowHandle will give you what you need. Use process.MainWindowHandle; It probably is 0 when launching the app, so you might want to loop and sleep until it is filled up. This is not a recent topic but the answers are incomplete. I agree with the Process.MainWindowHandle solution and to wait for the value but not with Sleep. If you have just started a process and want to use its main window handle, consider using the

C# window positioning

血红的双手。 提交于 2019-11-28 03:29:47
问题 Using Windows Forms I wanted to position window into specific coords. I thought it can be done in a simple way, but following code does not work at all: public Form1() { InitializeComponent(); this.Top = 0; this.Left = 0; } However, when only get a handle to that window, it works well: public Form1() { InitializeComponent(); IntPtr hwnd = this.Handle; this.Top = 0; this.Left = 0; } You can see that I am not working with that pointer at all. I found at MSDN following statement: The value of