window

How do I obtain the HINSTANCE for the CreateWindowEX function when using it outside of WinMain?

我与影子孤独终老i 提交于 2019-12-31 04:59:09
问题 I am trying to create a popup window when I click a button on my main window, and I am using the CreateWindowEX function for that purpose. However, the CreateWindowEx function recieves the HINSTANCE type variable as its second last parameter. Given that I am making this new window from inside the WndProcedure when a button is being clicked, the HINSTANCE variable in the WinMain function will not be available to me because it is not a global variable. The following code was obtained from the

Close window - How to determine how window was opened?

点点圈 提交于 2019-12-31 04:39:06
问题 On one page, I have a hyperlink with target="_blank" . On the target page, I have a "Close" button which uses JS to close the new tab/window. If the user clicks the hyperlink, I can use JS to close the opened window. Great! If the user right-clicks the link and selects "Open in new tab", my JS event can not close the window. Boo. :-( I understand the reasons for this, however in the second case I'd like to just not show the "Close" button if the window won't be able to be closed by Javascript

JavaFX: Set Scene min size excluding decorations

这一生的挚爱 提交于 2019-12-31 02:26:08
问题 I know that with JavaFX you can set the Stage min size using stage.setMinWidth() and stage.setMinHeight() , however, this will include the window border (with the minimize, maximize, and close buttons). How can I exclude this when setting the minimum size? 回答1: You can show the Stage undecorated, which will remove all the borders: primaryStage.initStyle(StageStyle.UNDECORATED); If you want to have it decorated If you want to have it decorated you can set the size of the Scene to the preferred

How to make a dialog(view) open up on the same monitor as the main window

落爺英雄遲暮 提交于 2019-12-31 00:50:11
问题 In a PC with multiple monitors, say you run your application which have have a second Window/Dialog other than the main window (such as Options) that you want it to open in the same screen/monitor as your MainWindow . How to force this behavior? You basically want to stop the scenario that your MainWindow is on one monitor and when you bring up the "Options" page, it shows on a different screen/monitor. 回答1: Have you looked at the WindowStartupLocation property for Window ? CenterScreen

Excel VBA - Capitalizing all selected cells in column on double click

会有一股神秘感。 提交于 2019-12-31 00:38:05
问题 I have a very simple VBA script, that capitalizes the selected cell: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) ActiveCell.Value = UCase(ActiveCell.Value) End Sub It works as expected, but sometimes I would like to capitalize all cells in a selected column, but only if I double click on the column itself. It seems that I cannot receive events with Worksheet_BeforeDoubleClick when clicking the column fields.. Is there some workaround for this? 回答1: Like I

Move Image or Div Up As Window Resizes?

天涯浪子 提交于 2019-12-30 13:56:43
问题 I have an image in my html with a class of "stretch". Currently, with css, this image re-sizes as the window re-sizes to be 100% of the screen width. I would also like it to move upwards as the window is being re-sized. I'm assuming this can be done with jQuery but I am not quite sure. Basically the "top" css value just needs to change as the screen width does. Here is the css that is currently re-sizing it: .stretch { width: 100%; height: auto; min-height: 420px; position: absolute; top:

JLabel doesn't show up

雨燕双飞 提交于 2019-12-30 13:11:12
问题 I'm working on a program but my JLabel doesn't show up. My JButton works perfectly (it appears) but for some reason the JLabel does not appear. I have checked on internet but I Haven't found anything. package com.hinx.client; import java.awt.Color; import javax.swing.*; public class Main { public static void main(String [] args) { createWindow(); } static void createWindow() { //Create panel JPanel content = new JPanel(); content.setLayout(null); //Build the frame JFrame frame = new JFrame(

how to add the selected files from dialog window to a dictionary?

时光毁灭记忆、已成空白 提交于 2019-12-30 12:04:28
问题 I wish it's able to open a dialog window and select my files, a.txt b.txt then add them in my dictionary myDict = { "a.txt" : 0, "b.txt" : 1} I searched on website import Tkinter,tkFileDialog root = Tkinter.Tk() filez = tkFileDialog.askopenfilenames(parent=root,multiple='multiple',title='Choose a file') these codes work for opening a dialog window and selecting my files. But the question is how to add the selected files to the dictionary? With Stephan's answer, the problem is solved myDict =

How do I make a Chrome extension's window blink in the taskbar?

倖福魔咒の 提交于 2019-12-30 10:12:31
问题 I've noticed there are some applications that can make the window in the taskbar blink using a chrome extension? Similar to how chrome will show a green progress bar when downloading something, other windows will blink orange to get your attention. Is there anyway to get a chrome extension to do this? 回答1: Yes, it's possible with the windows API: drawAttention If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused

WPF - data binding window title to view model property

北城余情 提交于 2019-12-30 09:43:15
问题 I'm trying to bind my window title to a property in my view model, like so: Title="{Binding WindowTitle}" The property looks like this: /// <summary> /// The window title (based on profile name) /// </summary> public string WindowTitle { get { return CurrentProfileName + " - Backup"; } } The CurrentProfileName property is derived from another property (CurrentProfilePath) that is set whenever someone opens or saves profile. On initial startup, the window title is set properly, but when ever