w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to make X11 window span multiple monitors
In general, an application should not try to rigidly control its window size and position, as WM is supposed to be smart and place the windows in the best possible fashion. If you want control anyway, try using XSizeHints like this: XSizeHints sh; sh.width = sh.min_width = 1700; sh.height = sh.min_height = 930; sh.h = 220; sh.y = 0; sh.flags = PSize | PMinSize | PPosition; XSetWMNormalHints(dpy, win, &sh); XMapWindow(dpy, win); WMs will respect min_width and will not shrink the window smaller than this. If you need a fullscreen window spanning multiple monitors, this is done differently, see here.

Categories : C

attach Child Window at the bottom of it's Parent
Use MoveWindow, the X and Y parameters are not absolute coordinates but are relative to the upper-left corner of the parent window's client area.

Categories : C

How do I bring parent window in front of child modeless dialog when parent window clicked
Take out this line: Owner = Application.Current.MainWindow and you should get the behavior you want. By specifying the owner window you are keeping the child window always in front.

Categories : Wpf

Android Maps V2: Custom info window at custom position or work around?
You can place a normal View (or some ViewGroup in this case) on top of the map and move camera, so that Marker is placed where it looks like is pointed to by this View. No native (using Google Maps Android API v2) way currently, but you may track this gmaps-api-issue for when it will be possible.

Categories : Android

Duplicate a pop window display on dual monitors
My guess is the only way to do it is to use JavaScript to generate two popups and then use CSS to push the popups to the correct locations. The problem I would think you are going to run into is knowing whether or not you have two displays to manage or not.

Categories : Javascript

How to change position of window controls relative to the window size
Not necessarily the best way, but what I'd probably do is handle WM_SIZE and/or WM_SIZING and then in there use : m_Button.SetWindowPos(x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); where x and y are the new co-ordinates of the top-left of where you want your button.

Categories : Visual Studio 2010

How can I show alert in parent window from child popup window in javascript?
try this code <!DOCTYPE html> <html> <head> <script> function openWin() { myWindow=window.open('','','width=200,height=100'); myWindow.document.write("<p>This is 'myWindow'</p>"); refreshParent(); } function refreshParent() { window.parent.focus(); window.parent.alert("message"); window.parent.location.reload(); } </script> </head> <body> <input type="button" value="Open 'myWindow'" onclick="openWin()" /> </body> </html>

Categories : Javascript

Accessing parent window angular scope from child window
I had a similar need and had the same problem accessing the scope using angular.element. I was was able to solve it as follows though: In your main/parent controller do something like this: $scope.food = 'Mac & Cheese'; window.$windowScope = $scope; $window.open('views/anotherWindow.html', '_blank','menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,personalbar=yes'); Then in the child window controller you can access $windowScope like this: $scope.parentWindow = window.opener.$windowScope; console.log($scope.parentWindow.food); An alternative to putting data directly into the scope would be to use $window scope to broadcast and/or emit events, which is the preferred way of cross-controller communication in angular.

Categories : Javascript

Disable parent window when child popup window is open
Play around with this code in the pop-up: $(window).on("blur", function(){ ... }); This will fire every time the user leaves the window. Inside the argument function you should be able to make the window regain its focus, maybe using $(this).focus() or self.focus(). I haven't tested this myself. Good luck!

Categories : Javascript

Load another window in background; when rendered, close the parent window
Changed code to: InitWindow I = null; Thread C = null; public InitWindow() { InitializeComponent(); I = this; C = Thread.CurrentThread; Thread T = new Thread(() => { MainWindow M = new MainWindow(); M.Show(); M.ContentRendered += M_ContentRendered; System.Windows.Threading.Dispatcher.Run(); M.Closed += (s, e) => M.Dispatcher.InvokeShutdown(); }) { IsBackground = true, Priority = ThreadPriority.Lowest }; T.SetApartmentState(ApartmentState.STA); T.Start(); } void M_ContentRendered(object sender, EventArgs e) { // Making the parent thread background C.IsBackground = true; // foreground the current thre

Categories : C#

Obtaining Windowed window's Position in X-window System?
Try Window child; XTranslateCoordinates(dpy, *curWin, root, 0, 0, &winPos[0], &winPos[1], &child); This should give you the top left corner. Repeat with (0, height-1), (width-1, 0) and (width-1, height-1) for the other corners.

Categories : C++

Call JavaScript of parent window from child window
What you're looking for is a reference to the window that opened the popup window. Once you have that, you can call functions in that window, read and write variables in that window, or even manipulate its DOM. That reference is called opener. It gives you the window object for the window that opened the current window. For example, if you have a function in the original window like this: function updateMe( data ) { alert( data ); } then in the popup window you could call it like this: opener.updateMe( 'Hello!' ); Naturally, you need to make sure that updateMe() is a global function in the original page. Or if you have some object in the original page and updateMe() is a method of that object, you can still do it, as long as the object is global. e.g. in the host page: var myOb

Categories : Javascript

How to redirect to parent window after logging in from iframe window?
As long as the links (within the iFrame) are part of the other page, you can't "hijack" their target. You would have to have the means and ability to modify the target attribute of each link to point to _parent or use javascript to reference the window.parent. Based on what you're saying (you're logging in to a different domain and the page is not part of your site) this wouldn't be possible without implementing some kind of proxy where you could modify the contents between page visits.

Categories : Javascript

Going back from child window to parent window in Visual C++
First of all if you want to do some navigation kind of things then, Your code of going parent to child is also not work properly. Now what I suggest you is that for going from parent to child create one global variable. Like , Form2^ pp ; initialise it in constructor or create method of parent class Like, //Create method or constructor, pp = gcnew Form2(); And do your navigation Like, private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { this->Hide(); pp->ShowDialog(); } In this case no matter how many time you click on button3 only one instance of child class will show and hide. No your problem is that you want go back to parent window form from child window. You may achieve this using this.Parent as Form Like, priva

Categories : Dotnet

SetFocus to parent window, then back to child window
Big thanks to Hans Passant for solving this! The crash issue was due to my window handle being unreliable. I stopped storing the window handle in a variable, and instead I got it on the spot using GetParent(). I also didn't need to set focus to the current window, all I needed to do was replace my SendMessage with a PostMessage. So the new code: case WM_KEYDOWN: ...code to handle modifiers like shift, ctrl, etc... else { PostMessage(GetParent(win32Frame->getPlatformWindow ()), message, wParam, lParam); }

Categories : C++

Gray and disable out the parent window as soon as pop up window is opened
Updated fiddle from answer in this question with iframe support http://jsfiddle.net/LT5JC/ Open function is rather simple function open(url) { $('#block').fadeIn(); // show grayed pane $('#iframe').attr('src', url); // update src of iframe $('#container').fadeIn(); // show container with iframe }

Categories : Javascript

Redraw in parent window in child window's onPaint in mfc
One way is to just pass data to the parent window and call its Invalidate function. Then it would paint the grid lines in its own OnPaint. Or you could paint directly on the parent window from the child, but use the parent's GetDC function instead of using the child's DC.

Categories : C++

How to pass data from Parent html window to pop-up window
You forgot to call transferText() :) After I called transferText() the text was transferred... <html> <head> <script type="text/javascript"> function init() { popupWin = window.open('','popupWin',''); popupWin.document.writeln('<html><head><title>test</title></head><body><form><input type="text" id="popupTextBox"/></form></body></html>'); popupWin.document.close(); popupText = popupWin.document.getElementById("popupTextBox"); parentText = document.getElementById("parentTextBox"); transferText(); } function transferText() { popupText.value = parentText.value } </script> </head> <body> <input type="text" id="parentTextBox"/> <input type="button" onclick=

Categories : Javascript

Accessing the Parent Window's Content from the child window
The root of your problem is same origin policy that won't let you observe load events for external domains. If you try this in developer console while browsing SO, everything's fine: var child = window.open( 'http://stackoverflow.com' ); child.onload = function() { alert( 'Popup loaded!' ); // Fired! }; However if you try to open a page from other domain, it fails: var child = window.open( 'http://stackexchange.com' ); child.onload = function() { // It's not gonna be fired unless you run it from stackexchange.com. alert( 'Popup loaded!' ); }; The same thing happens when you call window.open() or window.open( '' ) as it tries to load about:blank page which is out of your domain's scope and that's why your browser won't fire attached events (same for child.addEventListene

Categories : Javascript

How to reload the parent window from a pop-up window by calling a JS function?
Window Launcher: <script type="text/javascript"> function launch() { window.open('opened.html'); } </script> <a href="#" onclick="launch()">Launch!</a> Launched Window: <script type="text/javascript"> function reload_parent() { parent.window.opener.document.location.reload(); } </script> <a href="#" onclick="reload_parent()">Reload!</a> This kind of problem does not lend itself nicely to jsfiddle.net, and can't be done on file:/// domain due to cross-domain security problems, so you will have to actually run a server to host this. localhost is fine. I have hosted it myself here for you to see: http://framba.ch/opener.html

Categories : Javascript

Is it possible to receive messages from a parent window which is NOT the main window?
If a control is a child of a tab (or any other control) then it's the tab that will get notification messages like WM_COMMAND. It's easiest to make your controls all children of your main window and just fix the z-order to make them appear in front of the tab (you already have WS_CLIPSIBLINGS set on the tab control, which you would also need). If you leave the controls as children of the tab then the only way to get notification messages is to sub-class the tab. Or, you can do this the way property sheets do it, and use child dialogs (a dialog with the DS_CONTROL style set) to host the tab content. Then you can have a separate dialog procedure that handles messages from the child controls, and it makes it easy to show/hide a whole page of controls rather than handling them all individual

Categories : C++

How to position popup window relative to the window top?
Here is the working jsfiddle: http://jsfiddle.net/kcG9W/. You needed to calculate the scroll offset of the window, which would make the top look like 0px, then add 200 to that so the top would appear to be 200px. $('#thumbs img').click(function(){ $('.popup').fadeIn(300); $('#dark-overlay').fadeIn(300); var top = $(window).scrollTop() + 200 + 'px'; $('.popup').css({top:top}); });

Categories : Javascript

c# - Setting current window as the foreground window
Of course, bringing a window to the foreground may be easily achieved using the SetForegroundWindow API. But this involves working with the System.Runtime.InteropServices namespace, and thus including unmanaged code in your application. An easier approach is a trick I found while looking for a way to do this. It is as simple as setting our form's TopMost property to true and then immediately setting it back to false. Setting it to true will determine the operating system to show it on top of any other windows, no matter if it is focused or not. And then, we restore the default behavior, by setting the property back to false: the window will go to the background if another application gets focus, and thus, comes to the foreground. So, insert the following code snippet wherever you need s

Categories : C#

Updating wpf parent window after some action on another window
Do insert operations inside main window (UserManagmentWindow): UserManagmentWindow.cs: // Inside add button handler open adduser window as dialog box... var result = adduser.ShowDialog(); if(result == true){ // user pressed OK button... // insert new user in database // refresh UserManagmentWindow } Post your code if you need more details...

Categories : C#

How to get child window url from parent window using javascript
You can't detect the event precisely, but you can do a workaround and check the URL all X milliseconds. var self = this var detectsUrl = setInterval(function(){ var a = winRef.document.createElement('a'); a.href = winRef.document.URL; if (a.hostname == "www.myURL.com") { winRef.close(); clearInterval(detectsUrl); self.callback(); }; }, 1000); // Here we check every seconds

Categories : Javascript

Changing position of Custom Info Window of GoogleMap Marker android
What is wrong? What is wrong is that you are reading the JavaScript API documentation. That's why there is javascript in the URL. The Maps V2 for Android documentation for MarkerOptions tells a different story for anchor(): The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.

Categories : Java

WPF host Win32 window frozen because of multiple WM_NCHITTEST when moving mouse over the bottom right corner
I found the solution by setting the size of Win32 window to be 1 pixel (both width and height) smaller than the WPF Host Window, the issue is gone. I think it's because both Win32 and WPF windows were sharing the same non-client area and the messages got looping.

Categories : Wpf

Place a window (borderless) on top (z-index) of another window (borderless) such that the one on top trails the one on the bottom
You need process the WM_WINDOWPOSCHANGING message on one of the windows and use SetWindowPos to make sure you keep the z-order. You can either use SetWindowPos to send the window below a message that it should precede the current window, or call it from the second window to the first one with the HWND_TOP argument when the z-order changes.

Categories : C++

How to set window position in VB when window is not visible?
Try: FormTest.Left = 1000 FormTest.Visible = True FormTest.BringToFront() And if you want the window to start at the position you want when you use .Show() then: FormTest.StartPosition = FormStartPosition.Manual With this way it will start on the position you specified from the beggining.

Categories : Vb.Net

jquery ui dialog not showing in center of window after setting position to center
You're specifying the position value wrong. It should be like this: position: { my: "center", at: "center", of: window } In any case, the default value for position is center aligned, so just remove it. http://api.jqueryui.com/dialog/#option-position

Categories : Asp Net Mvc

show bottom right corner of div if mouse click near bottom of browser window
Have a look at Dan's answer on "How to tell if a DOM element is visible in the current viewport?". He's describing several methods to check if an element is still visible to the user. For your case this means you could check wether the div to be shown would be visible. Or in case it wouldn't: swop it top/left of the cursor position (and vis-à-vis).

Categories : Javascript

Losing the elemets/objects identity of same objects in parent window when renavigating from child window
When u navigate from the parent window a stale element reference exception is thrown each time you interact with the previously found web elements. In this case, although the replacement elements may look identical they are different; the driver has no way to determine that the replacements are actually the same or what's expected. If the element has been replaced with an identical one, a useful strategy is to look up the element again. To learn more, read this.

Categories : Selenium

OGRE - Multiple windows - render window and menu window
I prefer to use Qt for my GUI controls. I think it the most convenient library vor creating non-game GUIs. Combining Ogre and Qt is possible. There are code examples for Windows, Mac, Unix. Please have a look here.

Categories : Ubuntu

My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

bottom align divs at bottom of the window
Change your #container position to absolute. Also, make sure your container is not inside another container or element with a specified position, or the positioning will be relative to that container, and not the browser window.

Categories : CSS

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

Div won't position itself at the bottom of parent div
Add this: html,body { height: 100%; } #container { background-color: #fafafa; height: 100%; /* <--- */ width: 1112px; margin: 0 auto 0 auto; position: relative; } FIDDLE

Categories : CSS

Changing position of origin inside a window's Client area to get cursor position
The DPtoLP function converts device coordinates into logical coordinates. The conversion depends on the mapping mode of the device context, the settings of the origins and extents for the window and viewport, and the world transformation. http://msdn.microsoft.com/en-us/library/windows/desktop/dd162474(v=vs.85).aspx

Categories : Visual Studio 2010

How to get the attribute value from parent page.I tried using opener and window.parent.But doesn't work
Consider sending values "news1" and "image1.jpg" to page2 as URL arguments: <page2 URL>?news=news1&image=image2 Edited: Can you place your data into hidden inputs inside a form, and use your link to submit it (onclick="form.submit();")? This way you'll make a POST request instead of GET.

Categories : Javascript

window.parent.postMessage parent check what iframe sent message
You can only check which domain sent the message. If you need more identification you can always layer it into your messaging system. Send messages like: message = { "source": "menu", "message": "click on entry" }; Each frame then has their own source. You will need to serialize the message, JSON works nicely.

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.