window

OpenInputDesktop() to determine Secure/Login desktop

强颜欢笑 提交于 2019-12-12 16:07:44
问题 Visual C++ 2008 How to establish whether or not the currently interactive user is at either the Locked desktop (Windows-Key L) or the Shutdown Screen (Vista or 7) waiting for programs to close during log-out. HDESK hd = OpenInputDesktop(0, false, READ_CONTROL); This works fine for a user app on the Default desktop, but fails with error Code 5 when at the Locked or Shutdown desktops due to, I understand, the user not having permissions to open the secure desktop object. Calling this from a

How to detect and highlight rectangle on mouse hover

◇◆丶佛笑我妖孽 提交于 2019-12-12 15:10:00
问题 I have created a windows application control in C#.net to show some objects(things) in graphical mode. So I created a rectangles depend on number of items I got in list and plot it over control by using Control OnPaint event. Now I want to highlight that rectangle if mouse hovering on it. Please check attached image for more clarity & suggest me how can I achieve it . 回答1: Did you check the classical DrawCli example? It shows how a basic application should manage objects and tools. In short

How to customize Emacs split-window-X with the new window showing the next buffer?

微笑、不失礼 提交于 2019-12-12 14:04:02
问题 In Emacs 21.x I don't know if via a specific customization of split-window or due to a different default behaviour by Emacs, invoking the split-window-below besides splitting the window, it switched the buffer in the non-focused window to the next buffer. Currently (Emacs 24.x), the split-window and siblings split-window-below and split-window-right don't seem to allow such a customization. Is this true? If so, how to tweak Emacs to have this behaviour? Redefining split-window or split-window

ExtJS 4.1 How to create a window with grid dynamically

☆樱花仙子☆ 提交于 2019-12-12 13:50:36
问题 I'm a new ExtJS user and I've a question. I have a store with cars and I create a menu with buttons to see all cars by brand or model. Now I want to display a window with a grid panel containing all my cars for a particular brand/model. Actually when I create my buttons i do that : var aCarButton = Ext.create('Ext.Button', { text: aTextButton, handler: function() { var aResultWindow = new ResultWindow(aTextButton, myCarStore, 'Brand', aBrandValue); aResultWindow.create(); } }); aMenuPanel.add

The lifetime of JavaScript global variables

孤街醉人 提交于 2019-12-12 10:46:49
问题 I read the following on w3schools and I don´t understand what it means by the second part: [global variables] remain available to new pages loaded into the same window. Anyone can enlighten me ? In a web browser, global variables are deleted when you close the browser window (or tab), but remain available to new pages loaded into the same window. link: https://www.w3schools.com/js/js_scope.asp 回答1: If w3schools really says that (heaven help us, it does) , it's just plain wrong, as can easily

Check if page is in Iframe for Google Chrome

心不动则不痛 提交于 2019-12-12 10:44:32
问题 I have tried many properties of window to see if a page in an iframe can tell if it is in an iframe. I have tried: if(top.location!= self.location) //doesn't work in Google Chrome alert("I am in an iframe!") And this doesn't work (works on all browsers but Chrome). I am writing a userscript for Firefox and Chrome but Chrome really doesn't behave. Is there a way to tell if Chrome can detect if its page is in an iframe? 回答1: This works for frames I would assume it also works with iFrames if

WPF set parent (Window)

吃可爱长大的小学妹 提交于 2019-12-12 10:37:17
问题 How do you set the parent of a WPF window when you want to show it as a dialog? Both methods Show() and ShowDialog() don't seem to have that option. This was possible in Java as you could pass the parent in the constructor. Is it possible in any way in WPF? EDIT: I'm using C# 回答1: owner can be set but parent is a readonly property. var w = new Window(); w.Owner = Window.GetWindow(this); w.Show(); 回答2: on your "Showdialog" object do: templateWindow.Owner= System.Windows.Application.Current

jQuery - create an element with 16:9 aspect ratio

心不动则不痛 提交于 2019-12-12 10:16:14
问题 I am actually working on an image gallery which contains thumbnails of some videos I made. For this, I calculate the with of the gallery through the following code. $(function() { $(window).resize(function() { var width = $(this).width() - 200; $("#gallery").css("width", width); }).resize();}); Now each image should have an 16:9 aspect ratio. Therefore, I have to divide the width of the gallery width 16 and multiply this value with 9. Doesn't seem to be that hard but actually I am stuck.

How to stop window size jumping around when forcing fixed aspect ratio?

夙愿已清 提交于 2019-12-12 10:14:43
问题 Here's my test code: import QtQuick 2.4 import QtQuick.Window 2.2 Window { visible: true readonly property int defaultWidth: 700 readonly property int defaultHeight: 500 width: defaultWidth height: defaultHeight readonly property real aspectRatio: defaultWidth / defaultHeight readonly property real scaleFactor: width / defaultWidth onWidthChanged: { var properHeight = Math.round(width / aspectRatio); if ( height !== properHeight ) { height = properHeight } } onHeightChanged: { var properWidth

How do I parent new, user-created buttons inside the Graph Editor window?

China☆狼群 提交于 2019-12-12 09:27:16
问题 I'd like to add some new buttons to the Maya Graph editor -- particularly on top of the Channel list with all the attributes in the left of the window. However I'd rather not muck around with the Maya Startup scripts for the Graph Editor itself. Is there a way to "parent" the new buttons I want inside every new Graph Editor window using a separate script? Ideally this could be all Python. 回答1: TL;DR; if cmds.window("GE_ui_window", exists=True): #If the window exists cmds.deleteUI("GE_ui