Hadnling windows messages when in big loop

  • Thread starter Thread starter Fred Flintstone
  • Start date Start date
F

Fred Flintstone

I have a project, that loops through a lot of wmi queries, and while its
looping, the window will not repaint, I can't move or size the window.
I remember having a similar problem back in an excel macro, and I ran a
command that told the application to process windows messages.
Is there such a thing in vb.net, or is there a way to make sure windows
messages get processed in big cpu greedy loops?

Also, Is it a big deal to make code multy threaded? Where should a person
start looking for info regarding multitreaded programming in vb.net?
 
Hey Fred,

My first answer will help with repainting but not with moving the window.
Sorry I missed that requirement on my first read.

Any easy way to use threading is to get started with asynchronous delegates.

Here is a good article:
http://msdn.microsoft.com/msdnmag/issues/04/01/BasicInstincts/default.aspx

Once you create a Delegate through which to call the method with your big
loop, repainting, moving, and other user interface actions will work while
the big loop is processing your wmi queries.


--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
 
Thanks, that was just the sort of answer I was looking for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top