|
-
December 12th, 2008, 06:59 AM
#1
[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 )
[Vb.NET 2008 (ex Express)]
-
December 12th, 2008, 07:04 AM
#2
Re: How to hide message box
Does the messagebox have a title?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
0100 1101 0110 1001 0110 0011 0110 1000 0110 0001 0110 0101 0110 1100 0010 0000 0100 0101 0110 1100 0110 1100 0110 0101 0111 0010
-
December 12th, 2008, 07:17 AM
#3
Re: How to hide message box
 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.
[Vb.NET 2008 (ex Express)]
-
December 12th, 2008, 07:51 AM
#4
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.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
0100 1101 0110 1001 0110 0011 0110 1000 0110 0001 0110 0101 0110 1100 0010 0000 0100 0101 0110 1100 0110 1100 0110 0101 0111 0010
-
December 12th, 2008, 07:56 AM
#5
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...
Last edited by HanneSThEGreaT; December 12th, 2008 at 08:06 AM.
-
December 12th, 2008, 09:17 AM
#6
Re: How to hide message box
 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
[Vb.NET 2008 (ex Express)]
-
December 12th, 2008, 09:40 AM
#7
Re: How to hide message box
 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.
 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.
 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??
No Idea
[Vb.NET 2008 (ex Express)]
-
December 12th, 2008, 12:09 PM
#8
Re: How to hide message box
[Vb.NET 2008 (ex Express)]
-
December 13th, 2008, 01:46 AM
#9
Re: How to hide message box
Glad you solved it! 
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|