473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Knowing which part of a Window is currently visible on the display

Dear Experts,
I have an application that has several graphical components on it.
The state of these components is decided by some data which is
available in some data store. The graphical components periodically go
to the data base to see if the data has changed and accordingly change
their display state. Now its wasteful for my application to update its
graphical state if a particular component is not being visible
(meaning that some other Window is hiding a part or full of my
applications Window). I am trying to figure out which part of my
applications Window is currently visible on my computers display. This
way, my components can decided if they have to update themselves or
not (they could sit idle if they are not visible or could periodically
update their state if they are visible).
Any idea on how I can check which region on my Window is
currently visible on the display? Thanks.

Regards,
Ganesh Okade
Sunlux Technologies Ltd.
Mar 12 '08 #1
1 1205
On Wed, 12 Mar 2008 07:50:40 -0700, Ganesh <ga*********@gmail.comwrote:
[...]
Any idea on how I can check which region on my Window is
currently visible on the display? Thanks.
Well, you can find out when your control/form is actually drawn by
checking the ClipRectangle in the PaintEventArgs. You could also just
compare the screen location with the screen boundary.

But IMHO this is not something you want to do. While I understand the
concern of not being "wasteful", in practice these sorts of optimizations
can lead to poor performance when the optimization can't be used (e.g. the
whole window is on-screen). I've been down that road, as well as know of
others who have, and it usually doesn't work out.

If there's a problem with performance when part of the window is
off-screen, then there's a problem with performance when none of the
window is off-screen. Your effort will be better invested addressing
performance in a more general way so that performance is acceptable
regardless of where the window is.

Pete
Mar 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: spam_me_ not | last post by:
I already understand that one cannot disable a browser's forward and back functions. This is a situation where I have code working in Mozilla V1.6 and would like something similar for Opera and...
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
3
by: Marcus Otmarsen | last post by:
During the last months I obeserved a growing number of web pages with popups inside a web page. I don't know the technique by which these in-page-windows are implemented (either Javascript or...
6
by: Mateo | last post by:
Hi! I tried to open page in new window with window.open(...) method. open() method supports fullscreeen mode, but I would like to open new maximized window with tiltle bar only.... Any idea...
6
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
4
by: vickeybird | last post by:
I want to know if it is possible to detect if Pop up Blocker is enabled without trying to open a Pop Up windows. I'm trying to create a web analytics script and visible Pop up in case of disabled...
1
by: vp.softverm | last post by:
hi all . Am facing problem with the date picker. when i click on date picker in a popup window. the date table is opened in the middle of the pop up window. and it is unable to scroll with...
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.