[RESOLVED] How to hide message box
I need to do something crazy.
I need to fire a message box, but it should not be visible.
And I need to close that message box some time later, without user intervention.
I know is crazy and bad coding. Is only a nasty temporary patch until I discover what is wrong in my code.
(is related to this problem: http://www.codeguru.com/forum/showthread.php?t=467042 ):ehh:
Re: How to hide message box
Does the messagebox have a title?
Re: How to hide message box
Quote:
Originally Posted by
HairyMonkeyMan
Does the messagebox have a title?
The line is I don't care about it being a messagebox, or any other thing that does the work, until I discover what is going wrong with my code.
Re: How to hide message box
If the messagebox has a title, you can use apis to get the messagebox's window handle, then you can use other apis to hide the window, and destroy it with your timer.
Re: How to hide message box
No. No. No, Marraco
This will just make things worse than it is already. It makes absolutely no sense at all showing an invisible messagebox - just for something to finish, then lose that invisible messagebox. It is invisible, so that defeats its whole purpose. In the other thread you are refrring to Application.DoEvents - why doen't you wnt to use it, will it really save so much clock cycles ¿ Sorry for sounding frank, but an invsible messagebox is definitely not the way to go, at least in my opinion...
Re: How to hide message box
Quote:
Originally Posted by
HairyMonkeyMan
If the messagebox has a title, you can use apis to get the messagebox's window handle, then you can use other apis to hide the window, and destroy it with your timer.
Sounds promissing
Re: How to hide message box
Quote:
Originally Posted by
HanneSThEGreaT
This will just make things worse than it is already.
Sure. is temporary until I understand why the timer don't tick, and how to fix it.
Quote:
Originally Posted by
HanneSThEGreaT
It makes absolutely no sense at all showing an invisible messagebox - just for something to finish, then lose that invisible messagebox. It is invisible, so that defeats its whole purpose. In the other thread you are referring to Application.DoEvents - why doen't you wnt to use it, will it really save so much clock cycles
1-Yes, it would save clock cicles. At least I would remove an
Code:
If Condition...end If
avoiding it to be executed millions of times.
2-This way, I are sure, the progressBar, [and DoEvents] are updated, [and executed] only 2 times by second (the lap between Timer ticks is 500 ms), independently of the speed of the processor.
3-This way I can reuse this code for different tasks. Probably making an user control.
5-It removes clutter from my main code, making it easy to maintain.
4-Learning WHY &%·%$· it does not works, [and why the messagebox "fix" it] could be valuable.
Quote:
Originally Posted by
HanneSThEGreaT
¿ Sorry for sounding frank, but an invisible messagebox is definitely not the way to go, at least in my opinion...
I like when you sound frank.
I totally agree that an invisible messagebox is definitely not the way to go.
... It its only by chance that it makes my code run "the right" way. ¿Why starting a msgbox allows my timer to tick??:eek:
No Idea
Re: How to hide message box
Re: How to hide message box
Glad you solved it! :thumb:
Good luck! :wave: