Hundreds of created and destroyed windows

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Wielage Dirk
Version: 4.0.0253
Avatar
Hi,

when moving around the cursor in the editor the “Winspector” Window log shows that massively windows are created and destroyed.

The Window log look like:

Window 00123456, class WindowsForms10.Window.0.app.0.378734a, created
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, destroyed
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, created
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, destroyed
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, created
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, destroyed
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, created
Window 00123456, class WindowsForms10.Window.0.app.0.378734a, destroyed

You can find hundreds upon hundreds of them in the log.
Is there probably a bottleneck which could be optimized?

We currently don’t have any problems with that but I was just wondering.

Dirk

Comments (5)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We're not aware of any windows that are created like that as you move around. Could it be an IME-related thing? Can you figure out how to show them with Spy++? We tried using Spy++ to find them but didn't see anything out of the ordinary.


Actipro Software Support

Posted 12 years ago by Wielage Dirk
Avatar
Try “Winspector” see http://www.windows-spy.com/ there you can download it for free! If you have installed activate the "Window log" see menu "View"

In the "Window log" you will see all created and destoyed windows been logged.

As far as I know spy++ isn't able to do that! If you are using spy++ give "Winspector" a try. There are some really cool feature build in.

Dirk
Posted 12 years ago by Wielage Dirk
Avatar
The Window which is created seems something to do with timers.

If you have installed "Winspector" you should see the logs as mentioned above! Right click one of them and choose "Add window to watch...“. Then choose messages to be watched!

After that step for each created window "Winspector" will automatically log also the messages in the window.

These are mostly WM_TIMER messages which seems to belong to the cursor (caret)

But moving cursor up and down one line will destroy and recreate a new window (I think for timer purposes)

Again! Currently it's not a problem for us and there might be some reasons to that the way you did it. But you know it also could be optimized.

Dirk
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We've done the tracing. It's a Windows Forms Timer that is being stopped and started for the caret and other things. Note that the timer is not being created/destroyed by us. We only call the IsEnabled = false and then true. So unfortunately there's nothing we can do here since the messages you see are done behind the scenes by the Timer class whenever it stops and starts.

Also we can't use the other Timer class that is available because that is for multi-thread scenarios and we want single-thread.


Actipro Software Support

Posted 11 years ago by Max Kosenko
Avatar
Hello.

Use System.Threading.Timer (it's actually not using a lot of resources inside even if there are a lot of instances of it and btw, WF Timer is also using threads)
(or single separate thread for all instances of controls with scheduling of events)

+ control.Invoke()
(or SynchronizationContext.Current instance passed from main thread if you don't have a handle on the control yet).

That will help.
Enabled property or Start/Stop methods on WF Timer - not a good choice for frequent calls.

[Modified at 05/03/2008 08:05 AM]
The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.