window

How to get hWnd of window opened by ShellExecuteEx.. hProcess?

我怕爱的太早我们不能终老 提交于 2019-12-17 13:54:27
问题 This "simple" issue seems to be fraught with side issues. eg. Does the new process open multiple windows; Does it have a splash screen? Is there a simple way? (I'm starting a new instance of Notepad++) ... std::tstring tstrNotepad_exe = tstrProgramFiles + _T("\\Notepad++\\notepad++.exe"); SHELLEXECUTEINFO SEI={0}; sei.cbSize = sizeof(SHELLEXECUTEINFO); sei.fMask = SEE_MASK_NOCLOSEPROCESS; sei.hwnd = hWndMe; // This app's window handle sei.lpVerb = _T("open"); sei.lpFile = tstrNotepad_exe.c

How can selenium web driver get to know when the new window has opened and then resume its execution

不羁岁月 提交于 2019-12-17 10:58:32
问题 I am facing an issue in automating a web application using selenium web driver. The webpage has a button which when clicked opens a new window. When I use the following code, it throws OpenQA.Selenium.NoSuchWindowException: No window found WebDriver.FindElement(By.Id("id of the button that opens new window")).Click(); //Switch to new window _WebDriver.SwitchTo().Window("new window name"); //Click on button present on the newly opened window _WebDriver.FindElement(By.Id("id of button present

Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode

北城以北 提交于 2019-12-17 09:57:30
问题 We are executing our selenium automation script using jenkins window service(Headless mode) on daily basis .it was working fine till yesterday. suddenly it stopped working and not launching the browser. it shows the below error message [1553677874.187][SEVERE]: Timed out receiving message from renderer: 600.000. after that all the remaining test cases are getting failed. It is working fine if we run the build using jenkins as without windows service. We are experiencing this issue only with

WPF App Doesn't Shut Down When Closing Main Window

孤街醉人 提交于 2019-12-17 08:45:13
问题 I'm used to WinForms programming in Visual Studio, but I wanted to give WPF a try. I added another window to my project, called Window01. The main window is called MainWindow. Before the public MainWindow() constructor I declare Window01: Window01 w1; Now I instantiate this window in: private void Window_Loaded(object sender, RoutedEventArgs e) { w1 = new Window01(); } I have a button where the window is shown: w1.ShowDialog(); . The 'funny' thing here is the fact that if I start the

javascript - document.write error?

让人想犯罪 __ 提交于 2019-12-17 07:51:32
问题 Consider the script.. <html> <head> <script type="text/javascript"> document.write('TEST'); </script> </head> <body> Some body content ... </body> </html> This works fine and the word 'TEST' is added to the <body> But when <script type="text/javascript"> window.onload = function(){ document.write('TEST'); } </script> is used, then the body content is fully replaced by the word 'TEST' i.e, the old body contents are removed and ONLY the word 'TEST' is added. This happens only when document

javascript - document.write error?

微笑、不失礼 提交于 2019-12-17 07:51:24
问题 Consider the script.. <html> <head> <script type="text/javascript"> document.write('TEST'); </script> </head> <body> Some body content ... </body> </html> This works fine and the word 'TEST' is added to the <body> But when <script type="text/javascript"> window.onload = function(){ document.write('TEST'); } </script> is used, then the body content is fully replaced by the word 'TEST' i.e, the old body contents are removed and ONLY the word 'TEST' is added. This happens only when document

Finding the handle to a WPF window

╄→尐↘猪︶ㄣ 提交于 2019-12-17 07:14:23
问题 Windows forms had a property win1.Handle which, if I recall, returns the handle of the main window handle? Is there an equivalent way to get the handle of a WPF Window? I found the following code online, IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; but I don't think that will help me because my application has multiple windows. Thanks!! 回答1: Well, instead of passing Application.Current.MainWindow , just pass a reference to whichever window it is you

ReferenceError and the global object

不问归期 提交于 2019-12-17 06:51:29
问题 In javascript window is the global object, which means every object in the global scope is a child of window . So why I get this result: console.log(window.foo); // No error, logs "undefined". console.log(foo); // Uncaught ReferenceError: foo is not defined. Fiddle Those two lines should be the same, shouldn't they? 回答1: Because with window.foo you are explicitly looking for foo property of window object which is not the case in latter option. In the latter option, if foo isn't defined, you

How to get screenshot of a window as bitmap object in C++?

女生的网名这么多〃 提交于 2019-12-17 04:54:59
问题 How to get screenshot of a window as bitmap object in C++? Supposed that I already have the window handle. And I want to know also whether it's possible to get the screenshot of a window when it's in minimized state ? C++ here means VC++ with all the libraries associated with Windows XP+ (win32). 回答1: you should call the PrintWindow API: void CScreenShotDlg::OnPaint() { // device context for painting CPaintDC dc(this); // Get the window handle of calculator application. HWND hWnd = :

How to create custom window chrome in wpf?

被刻印的时光 ゝ 提交于 2019-12-17 02:55:12
问题 How can I create a basic custom window chrome for a WPF window, that doesn't include the close button and still a moveable and resizeable window? 回答1: You set your Window's WindowStyle="None" , then build your own window interface. You need to build in your own Min/Max/Close/Drag event handlers, but Resizing is still maintained. For example: <Window WindowState="Maximized" WindowStyle="None" WindowStartupLocation="CenterScreen" MaxWidth="{Binding Source={x:Static SystemParameters.WorkArea},