|
Hi,when I Write files ,I want a carton show to let user know a data is performing.
I want to use a work thread in background to writing file,when the file finish ,it may be send a message to main window destroy the carton,but I dont't know how to do it ,please help me
|
|
|
|
|
Use an event. With MFC, check out CEvent . I talk about this briefly in this article.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Use PostMessage()[^].... make sure you know how to catch the message on your receiving window as well. MSDN usually has good tutorials. It's easier if you're using MFC since the message map is easily defined.
|
|
|
|
|
Hi,
cherry729 wrote: I want to use a work thread in background to writing file,when the file finish ,it may be send a message to main window destroy the carton,but I dont't know how to do it ,please help me
If you want to save some time and avoid re-inventing the wheel then you might be interested in using the old Animation Window class[^]. If you are using the MFC library... this basic window class is represented in the CAnimateCtrl Class[^]. You can open, start, stop and pause the animation by simply sending window messages from any thread in your application.
Best Wishes,
-David Delaune
|
|
|
|