473,783 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Higher CPU Utilization on Windows form resize

I have created a windows application in which the form needs to be
resized on the MouseMove event. The windows resize function takes a lot
of CPU cycles. And as the resize function is called on the MouseMove,
the form is resized around a 30-100 times in one second. This leads to
a high CPU utilization and all other application comes to a stand
still.

The form does not have any controls i.e. buttons, text boxes etc. It is
completely empty. Its opacity in around 10%.

Now is there any way by which we can reduce all the amount of CPU taken
by the form on resize??

Or can I reduce the form resize calls on MouseMove event. i.e. some way
by which all the mouse move event don't lead to form resize.

Please help me out with this.

Nov 13 '06
11 3476
Given the added details you've provided, I'd say Mark's suggestion to run
the form on a different thread has merit. As long as you can keep the
transparent form on a different thread from the forms where the data updates
are occurring, hopefully performance in those other forms won't suffer so
much (and on a dual-proc computer, should not suffer in any noticeable way
IMHO).

That said, just in case here are answers to your other questions:

"Ajith Menon" <ko********@gma il.comwrote in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
[...]
How to set the form not to redraw during resize?
Set the ResizeRedraw property to false.
Also I got to know the higher processor is due to opacity=10%. The
foreground repaint as well as background repaintis called. In case if
opacticy is 100% background repaint is not called.
Sure...it makes sense that transparent redrawing would use more CPU than
opaque redrawing. It's not that you have no CPU use in the latter
case...it's just not as much.
>>You can block the painting of the form partially.

Be aware that this can give an elastic effect if you don't do it in short
steps.
And what is blocking the painting partially???
I assume that what Cor was suggesting was to override the OnPaint handler in
the form, and ignore some of the paint events that way. It's pretty much
the same solution that I suggested, except implemented from the other end.
Rather than limiting the paint events (as I suggested), you could simply
ignore some of the paint events (as Cor suggests).

Pete
Nov 13 '06 #11
Hi Mark,

Thank you very much for your solution.

Bye.

Nov 21 '06 #12

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

Similar topics

3
3760
by: Dathon | last post by:
I have a Windows service that's built with .NET. The process is meant to run in the background and not suck up too much CPU time. I set the thread priority for the various threads in the service to Below Normal, but I'm still getting reports that the service is making a noticable impact on overall machine performance. I stuck some Thread.Sleep calls in a various places in the code, but that doesn't help much, since the service makes...
3
1570
by: GoCMS | last post by:
Sorry about this newbie question. I added a few tabbed pages into windows form. How can I make tabbed pages to resizable according to the window itself? Now it's like when i resize the window, the tabbed page keeps the absolute position and size. Thanks!
0
1061
by: dtp | last post by:
This one has got me stumped. Is there a way to figure out the utilization of each processor in an MP system? (2P and above) Right now I use the NtQuerySystemInformation API to get busy and idle time of each processor in a system and this works most of the time except on 64-bit Windows 2003 server on some platforms. What makes me nervous is MS says it may drop support for this call in future OSes so I can't depend on it long term...
0
1069
by: Peter | last post by:
When my form loads I have 3 items perfectly aligned: '________________________________________________________ (Width, Height) Startup form name is "strForm" (w800, h570) Location(0, 0) Picture Box control = "picBackGround" (w800, h570) Location (picBackGround) Group Box Control gbBox(w330, h256) Location (38, 72) I have also written this code to rescale the Picturebox on form
3
16181
by: BrianDH | last post by:
Hi I have a windows form and with init I have a tab control. How can I get the tab control to resize, Min/Max as the windows form is resized? Thanks
2
3964
by: timnels | last post by:
I have been able to execute Notepad.exe in a Panel (set to Dock.Fill) on a Windows Form, like: ProcessStartInfo psi = new ProcessStartInfo("notepad"); p = Process.Start(psi); p.WaitForInputIdle(); SetParent(p.MainWindowHandle, uiAppPanel.Handle); ShowWindow(p.MainWindowHandle, (int)ShowCommands.SW_MAXIMIZE); int style = GetWindowLong(p.MainWindowHandle, GWL_STYLE); SetWindowLong(p.MainWindowHandle, GWL_STYLE, style & ~WS_CAPTION);
2
1786
by: Emre Sevinc | last post by:
Hello, I have a strange situation. I create a very simple Windows Forms application and place the code below however even though I place breakpoints in various event handling points VS.NET 2005 only enters the breakpoint for the button but not for the form. Am I missing something? Why don't the events for my form Form1 have any effect? Form1.cs:
0
2251
by: PRR | last post by:
with WMI class Win32_Process i can get most details of Processes running one Pc.. except CPU utilization... THe class for CPU utilization u need to use Win32_PerfFormattedData_PerfProc_Process However it doesnt work in Windows XP... i wanna know wat class to use to get CPU utilization in win xp... also Processid is to be compared to get CPU utilization for Process to get info from both classes?
1
6630
by: Kaheru | last post by:
memory utilization increase? This is because when i try to keep track of the CPU utilization and memory utilization of my FTP server process (ftpserver.exe), the CPU utilization increase, but the memory utilization decrease. Why is this happening? PS: CPU Utilization is taken from Process\% Processor Time Memory Utilization is taken from Process\Working Set (I want to measure the physical memory it uses) Any help is appreciated....
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.