w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Xlib: How to ask window manager for maximized window size?
_NET_WORKAREA property of the root window is probably closest match. However on a multi-headed system it will give you the combined work area on all monitors. If that's what you want, fine (but see here on making a window span multiple monitors). If you want to maximize over a single monitor, then there's a problem as there's no per-monitor API like _NET_WORKAREA. Your best bet is creating a window in a maximized state and then querying its size. If that's not an option, I'm afraid you will have to query the number and sizes of available monitors, and then go and calculate the work area of each monitor by subtracting "struts" from the full area (see here about _NET_WM_STRUT and _NET_WM_STRUT_PARTIAL).

Categories : Misc

Prevent Maximized WPF Window from Covering Taskbar
A customized WPF window does not respect the area occupied by the task bar. In order to do this, you need support from the Win32 API. The first method you will need is... [DllImport("user32.dll")] public static extern IntPtr MonitorFromWindow(IntPtr hwnd, int dwFlags); The MonitorFromWindow function retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window. http://msdn.microsoft.com/en-us/library/windows/desktop/dd145064(v=vs.85).aspx Set dwFlags = 2 The next one is... [DllImport("user32.dll")] public static extern bool GetMonitorInfo(HandleRef hmonitor, [In, Out] MonitorInfoEx monitorInfo); The GetMonitorInfo function retrieves information about a display monitor.

Categories : C#

if(window.location.hash) event only executing partially
Is this at the top of the page or the bottom? My guess is that the first few lines are not running because the page isn't fully loaded yet, a race condition, but the lower lines are running because jQuery puts this on its internal event queue so they actually run some milliseconds later. If thats the case, just wrap this whole thing in something like this: $(function() { //all your code in here }); Which tells jQuery to only run this code after the whole file has loaded.

Categories : Jquery

How do non-window program monitor system clipboard?
According to Microsoft, "There are three ways of monitoring changes to the clipboard. The oldest method is to create a clipboard viewer window. Windows 2000 added the ability to query the clipboard sequence number, and Windows Vista added support for clipboard format listeners. Clipboard viewer windows are supported for backward compatibility with earlier versions of Windows. New programs should use clipboard format listeners or the clipboard sequence number." This GetClipboardSequenceNumber does not take any arguments and according to Microsoft, "The system keeps a serial number for the clipboard for each window station. This number is incremented whenever the contents of the clipboard change or the clipboard is emptied. You can track this value to determine whether the clipboard content

Categories : C#

Open a popup window in the center of the monitor
you can center you popup in css like this is only css method to make it center so no js will be required to center it #containerdiv { width:90%; height: 90%; display: none; position: fixed; left:50%; top:50%; margin:-45% 0 0 -45%; background:#FFF; border: 1px solid #666; border: 1px solid #555; box-shadow: 2px 2px 40px #222; z-index: 999999; box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; }

Categories : Javascript

How to create a self-destroying child window to monitor an activity?
I don't quite understand what you're trying to accomplish, but based solely on the title of the question I'm guessing you want some sort of pop-up progress window that destroys itself when progress is complete. Here's a contrived example that displays a window that self-destructs when progress passes 100%. It's not very bullet-proof, but it shows that it's possible to create a window that self-destructs. import Tkinter as tk class App(tk.Frame): def __init__(self, *args, **kwargs): tk.Frame.__init__(self, *args, **kwargs) go_button = tk.Button(text="Go!", command=self.go) go_button.pack() def go(self): self.dialog = ProgressWindow(self) self.do_real_work(0) def do_real_work(self, count): # simulate doing work; update the stat

Categories : Python

How can I partially reveal and partially fill color in image
What you need is image masking. From apple docs - An image mask is a bitmap that specifies an area to paint, but not the color. In effect, an image mask acts as a stencil to specify where to place color on the page. Quartz uses the current fill color to paint an image mask. So as your percentage of download increases you decrease the alpha value of the uiimage below. Hope this is what you require.

Categories : Iphone

how to show ajax respone partially in hidden value and partially in div
Try this code and see what happens: <input type="hidden" runat="server" class="piechartval" ID="piechartval" value="HERE" /> <div class="rankadvancement "><img src="Assets/Images/imgLoading.gif" style="width: 16px;" />HERE<div> success: function(data) { $('.piechartval').val(data); --- this one in hidden input $('.rankadvancement').html(data); --- this one in div } Edit: on a side note, use a class on the hidden div, as the ID will change because of the runat="server". fixed the code to reflect that.

Categories : Javascript

Using Performance Monitor to monitor pooled connections
You can run this from a SQL query windows to get a count and the details of current connections and session running on your SQL server. select * FROM sys.dm_exec_sessions AS es INNER JOIN sys.dm_exec_connections AS ec ON es.session_id = ec.session_id I've had trouble with pooled connections. They're hard to control. Explicitly closing them never seemed to work since they're under the control of .NET. The biggest reason we've run out of connections is uncommitted transactions. If a transaction is left uncommitted or rolled back for some reason, the connection, instead of being re-used, get's stuck in limbo, forcing .NET to open yet another connection to continue processing.

Categories : Sql Server

Monitor.Enter vs Monitor.Wait
According to MSDN: Monitor.Wait Method(Object) SynchronizationLockException: The calling thread does not own the lock for the specified object. In other words: You can only call Monitor.Wait(Object), when you already own the lock, whereas you call Monitor.Enter(Object) in order to acquire the lock. As for why Monitor.Wait is needed: If your thread realizes, that it is lacking information to continue execution (e.g. it's waiting for a signal), you might want to let other threads enter the critical section, because not all threads have the same prerequisites. For the waiting thread to continue execution, you will need to call Monitor.Pulse(Object) or Monitor.PulseAll(Object) before releasing the lock (otherwise, you're going to get the same kind of exception as with Monitor.Wait(Ob

Categories : C#

Error "Task can be only monitored with a single monitor" when setting my monitor to a task in dll
OnMessage function creates implicit monitor which receives the task message and calls your anonymous function. Same goes for OnTerminated. If you wish to use MonitorWith, you should implement message processing and termination handling as a monitor events, not with OnMessage/OnTerminated functions.

Categories : Delphi

Qt5 Android maximized application
I'm working on qml apps on android devices. include <QGuiApplication> include <QtQml/QQmlApplicationEngine> int main(int argc, char *argv[]) { QGuiApplication app(argc,argv); QQmlApplicationEngine engine; engine.load(QUrl("qrc:///main.qml")); return app.exec(); } (this is my main.cpp) and my main.qml is: import QtQuick 2.1 import QtQuick.Controls 1.0 ApplicationWindow { id: mainWin visible: true ... ... with the above code my app fits full screen on android and i can get the screen size with mainWin.width and mainWin.height.

Categories : Android

When maximized, why is there a line break after the word "and"?
I think you just need to remove the < br > from the text: <div style='overflow:hidden;background-color:black;'> <div style='overflow:hidden; color:white; float:left;'> <img style='width:64px;margin-bottom:50px;float:left; margin-right:10px;' src='/img/bigGreenCheckmark.png' /> Bookkeeping &amp; Business Services: Proven. Reliable. Accurate. Hassle-Free bookkeeping with No B.S. - Give us a chance and we'll prove it. </div> <div style='float:right; margin-right: 10px; color:#EFDD6F; font-size:1.5em; line-height: 2em;'>(310) 204-4717</div> </div>

Categories : CSS

maximized height on div bound to bottom
Thx to the guy who deleted his answer, it was close to be working. height is somehow ignored, but using top and position: absolute; it worked. When DIV 2 resizes, there must be an event triggered resizing DIV 3 tho: <body style="width: 100%; text-align: center;"> <div style="margin: 0 auto;text-align:center">container <div style="width: 200px; margin-top: 100px; float: left;"> left </div> <div style="width: 728px; float: left;"> <div style="height: 100px;" id="a"> 1 </div> <div style="height: 150px;" id="b"> 2 </div> <div style="background-color: red; position: absolute; bottom: 0;" id="test"> 3 </div>

Categories : CSS

How to center a WPF Window in a Excel VSTO addin
I was able to solve this by get getting the Rect of the Main Excel Window using user23 [DllImport("user32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect); [StructLayout(LayoutKind.Sequential)] private struct RECT { public int Left; public int Top; public int Right; public int Bottom; } It appears that Globals.ExcelAddin.Application.ActiveWindow was not giving me back the dimension I expected. I think it was giving me the Ribbon Addin's dimensions and not Excel's Main Window.

Categories : Dotnet

SPLASH SCREEN HIDDEN BY MAXIMIZED FORM
Try this. Private Sub MDIMainForm_Load(sender As Object, e As System.EventArgs) Handles Me.Load System.Threading.Thread.Sleep(3000) 'Splash screen display time Me.WindowState = FormWindowState.Maximized End Sub For my project it's work.

Categories : Vb.Net

Non maximized browser messes up background image
Using a 100% x 100% absolutely positioned div for your background image is probably what's causing the issue. Switch to CSS classes on < body > .pic1 { background-image: '../path/to/image1'; } .pic2 { background-image: '../path/to/image1'; } etc And then instead of changing the src of the image tag you would change the class of < body >. This will allow you to remove the absolute positioning of that div and layout the site "normally".

Categories : Javascript

Javascript .open opens maximized in Chrome
I'm testing your example on win7 and it works fine on chrome, at least for me Have a look at this fiddle Are you using it on a maximized (fullscreen) window on Mac? Btw, I would not recommend using window.open since it usually gets blocked by pop-up blocker Edit: tested on Chrome stable, build 28.0.1500.95 m

Categories : Javascript

Maximized owned Form not restoring correctly
Here's one possibility... Add a property to the Owned form to track its last FormWindowState (could just be private if you don't care to expose it): private FormWindowState _lastState; public FormWindowState LastWindowState { get { return _lastState; } } Add an override for WndProc to the Owned form: protected override void WndProc(ref Message message) { const Int32 WM_SYSCOMMAND = 0x0112; const Int32 SC_MAXIMIZE = 0xF030; const Int32 SC_MINIMIZE = 0xF020; const Int32 SC_RESTORE = 0xF120; switch (message.Msg) { case WM_SYSCOMMAND: { Int32 command = message.WParam.ToInt32() & 0xfff0; switch (command) { case SC_MAXIMIZE: _lastState = FormWindowState.Maximized; break; case SC_

Categories : C#

Issue with 3 "rows" in a layout, middle one being maximized
Try using a RelativeLayout as the parent container with the following changes: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/eventActivityLayout" android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:id="@+id/infoBar" android:layout_width="match_parent" android:layout_alignParentTop="true" android:layout_height="wrap_content" android:background="#AAA" > <TextView android:id="@+id/left_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="3dp" android:textSize="12sp" /> <TextView android:id="@+

Categories : Android

Excel export functionality - from jquery dialog window
Return the binary stream to the output from the action: String filename = filters.getPeriod() + "_" +filters.getRegion() ; httpServletResponse.setContentType("application/octet-stream"); httpServletResponse.setHeader("Content-Disposition", "attachment; filename="+filename+".xls"); ServletOutputStream outputStream = httpServletResponse.getOutputStream(); Path fileIn = Paths.get(filename); Files.copy(fileIn, outputStream); outputStream.flush(); return NONE;

Categories : Java

Excel Window & UserForm Minimize and Maximize Functions
When you display the form, you are likely doing something like: UserForm.Show The Show method takes an optional argument, whether to display the form Modal or Modeless. Modal display is default, and does not allow interaction with the worksheet/workbook objects. Instead, when you display the form, do: UserForm.Show vbModeless This will allow the user to interact with the worksheet/workbook, which alleviates the need for your custom button and you will not need to do Me.Hide. Minimizing the Application will minimize the UserForm. Maximizing the Application will re-display the workbook and the userform. If you must use the vbModal display of the UserForm (and in many applications this is a deliberate requirement to prevent user from interacting with the Workbook/Worksheets), let me

Categories : Windows

How to Disable restore box of windows form when it is in maximized condition?
Have a look at this question: How do I remove minimize and maximize from a resizable window in WPF? The first and most upvoted answer doesn't belong to WPF only. So it should also work with a Winforms application.

Categories : C#

setPreferredSize not working on panels when frame maximized on Windows XP?
OK, thanks to the prompts to use a LayoutManager, I did some digging in that direction. Turns out that JScrollPanes use JViewports which in turn use ViewportLayout implemenation of a LayoutManager. These have control over their delegated 'View' component. As can be seen in the modified code below, I override the layoutContainer method in here now to double the height of my 'movingPanel' in relation to the viewport and this works visibly better than before and when maximised in XP. Thanks import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.LayoutManager; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.sw

Categories : Java

TAdvStringGrid is not aligning to full screen when form is maximized at run time
It worked out finally with the ColumnSize Stretch property of TAdvStringGrid by setting out ColumnSize.Stretch = True which helped me align TAdvSTringGrid table to the full screen..

Categories : Delphi

CPU usage not maximized and high synchronization in server app relying on async/await
It sounds like your server is almost completely asynchronous (async MSMQ, async DB, async HttpClient). So in that case I don't find your results surprising. First, there is very little CPU work to do. I'd fully expect each of the thread pool threads to sit around most of the time waiting for work to do. Remember that no CPU is used during a naturally-asynchronous operation. The Task returned by an asynchronous MSMQ/DB/HttpClient operation does not execute on a thread pool thread; it just represents the completion of an I/O operation. The only thread pool work you're seeing are the brief amounts of synchronous work inside the asynchronous methods, which usually just arrange the buffers for I/O. As far as throughput goes, you do have some room to scale (assuming that your test was floodin

Categories : C#

How to make PageControl occupy full screen when form is maximized at Delphi
Adjust the anchor(if you are on FireMonkey instead of VCL look at Margins and Padding properties) property of the PAgeControl to allow the auto resize of the component. Take a look at this video tutorial for more information.

Categories : Delphi

Validation error messages disappear when Trinidad component panelAccordion is minimized or maximized
One way you can achieve the desired effect is by submitting the form when a user clicks on each <tr:accordionPanel>. It supports many other client side events so pick one that best suits your needs.If you submit the entire form, this will force validation to kick in for all components however, whether the user entered a value or not. This might be the quickest and simplest way but some people might be picky and not like this solution. You can also make use of partial updates and partial triggers and submit only the components that are part of the current accordion panel based on the event you choose.

Categories : JSF

Given weighted points on a plane, find locations for U squares such that the total enclosed weight would be maximized
It's a geometric special case of the weighted maximum coverage problem. The general MCP is NP-hard, and I suspect that this special case is as well, though unlike the general case, it probably has an efficient polynomial-time approximation scheme. You want an optimal solution, however, so the first thing that I would recommend is to feed the integer linear programming formulation in the linked Wikipedia article to an LP solver. maximize sum_j (w_j * y_j) subject to for all i, sum_i x_i <= U for all j, sum_{i : j in S_i} x_i - y_j >= 0 for all i, x_i in {0, 1} for all j, 0 <= y_j <= 1 The weight w_j of each point j is given, and the sets S_i are all possibilities for covering points with a width L square. The meaning of x_i is whether set S_i is chosen. The meaning of y_j is

Categories : Algorithm

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#

NavigationWindow class: remove navigation bar and maximized NavigationWindow
You can host a Frame in your Window. That is essentially what a NavigationWindow does. MSDN has more info on navigation hosts.

Categories : C#

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

Display Excel inside VB6 / VB.NET Form & work with Excel without excel menu
As far as I can tell - this is not possible. The reason being that you cannot subclass the excel window in VBA. If you program outside of excel with VB.NET or VB6 it would be sort of possible, but would probably not work really good. If you only want to display some data from a sheet and perform some small actions on them, you could probably read the Data via the EPPLUS Library, display them as a datatable (EPPLUS can convert between datatable and excel files), perform your actions and save them to the file afterwards. But this would only work in VB.net

Categories : Vb.Net

Excel file created in Excel 2007 is not opening in Excel 2003 using c#
If you make an Excel file programmatically and name it with the .xls extension from Excel 2007 or 2010, you may be making an Open XML (.xlsx) file unknowingly, as this is the default save format for those versions of Excel. Essentially, if you are hard coding the file name, you may be saving an .xlsx file with the .xls extension, which would explain why you can't open the files. Try renaming the files generated from Excel 2007 to the .xlsx extension and see if you can open them.

Categories : C#

window.close closes the postbacked child window and a copy of child window still appears
The showModalDialog method will freeze JavaScript execution on the parent window until the dialog that it opens has closed, so we can rule out that as the reason why your second window opens. When FileUpload.aspx posts back from the server, it should work the same way as modeless aspx postbacks. I think you should be able to get rid of the window.open() method and you should be fine. Parent window: window.showModalDialog("FileUpload.aspx", "FileUpload", "center:yes;resizeable=yes;dialogHeight:300px;dialogWidth:600px;"); The Child window will call this when it's done. window.close();

Categories : Javascript

open the link from the popup window in an external window and then close the original popup window
Try <input name="Apply Online" type="button" id="Apply Online" value="Apply Online" ONCLICK="window.location.href='some_url';$.colorbox.close();"> or <input name="Apply Online" type="button" id="Apply Online" value="Apply Online" ONCLICK="window.location.href='some_url';parent.$.colorbox.close();">

Categories : Javascript

How does the [L] flag cause my url to partially duplicate?
In contrast, the PATH_INFO that is appended to the URI before each rule reflects only the value of PATH_INFO before this round of mod_rewrite processing. As a consequence, if large portions of the URI are matched and copied into a substitution in multiple RewriteRule directives, without regard for which parts of the URI came from the current PATH_INFO, the final URI may have multiple copies of PATH_INFO appended to it. In order to prevent that from happening, you need to use the DPI flag so your rule would be: RewriteEngine On RewriteRule ^foo/(.*)$ bar/$1 [DPI] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?request=$1 The DPI flag will take care of removing the path info from it. You can read more here.

Categories : PHP

Getting records structured the same way only partially
The parent table seems like the best option. // This is the parent table Entry ID PK Common fields Video ID PK EntryID FK Unique fields Game ID PK EntryID FK Unique fields ... What the queries will look like will largely depend on the type of query. To, for example, get all games ordered by a certain date, the query will look something like: SELECT * FROM Game JOIN Entry ON Game.EntryID = Entry.ID ORDER BY Entry.AddDate To get all content ordered by date, will be somewhat messy. For example: SELECT * FROM Entry LEFT JOIN Game ON Game.EntryID = Entry.ID LEFT JOIN Video ON Video.EntryID = Entry.ID ... ORDER BY Entry.AddDate If you want to run queries like the one above, I suggest you give unique names to your primary key fields (i.e. VideoID and GameID) so you can

Categories : Database

How to redraw Canvas partially?
use the same bitmap instead of creating a new one, and call invalidate with a rectangle (or with the bounds) as its parameter. in the onDraw, you can call canvas.getClipBounds() in order to find the rectangle to invlidate. also, in order to improve your code, try to avoid creating new objects on the onDraw method. in fact, if it's a heavy game, consider using openGL instead. for simplicity, you can use third party libraries like libGDX or AndEngine.

Categories : Android

how to partially Update AppWidget
if you write it to api 11 and above use: // Get the layout for the App Widget RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); views.setTextViewText(id,text); appWidgetManager.updateAppWidget(appWidgetId, views); as shown in this question How to partially update views in an app widget without rebuilding all the RemoteViews otherwise rebuild the entire removeviews (basiclly call remoteViews again)

Categories : Android



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