![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Professional Programmer
|
Disabling "Ok" button
After about a month of programming consoles, I have decided it's time to learn gui programming. I have been fooling around with gui's here and there, slowly getting used to what is what, i got the feel for how the gui's are coded basically, but as all newcomers to something, i have questions.. one for now though. I have been looking for about an hour now, found out quite a bit of useful tips and tutorials that are going to be alot of help, but don't quite help me with this thing im stuck on. I found
if (fError)
{
if (MessageBox(NULL, NULL, NULL, MB_OKCANCEL)==IDOK )
{
MessageBox( NULL, "hello", "ATTENTION!", NULL | MB_TOPMOST);
}
else
{
MessageBox( NULL, "hi", "NOOO1", NULL | MB_TOPMOST);
}
}in the msdn library.. thinking it was what i was looking for, but not quite. I am trying to find out how to disable the IDOK signal or MB_OK button and enable the button.. I am planning on making a wait time before the button can be pressed(like if you were to download a trial program, it would have a wait time of about 5 seconds before allowing you to run the program). I was positive i had it when i found this but no tutorials were helpful enough, and this only showed me how to make a certain button run a new task or something of the likes..
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
I don't know how to get the handle to the messagebox window, I'd just create a dialog, and set the WS_DISABLED state, then use a timer and send the WM_ENABLE message.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
You can't easily modify the MsgBox but instead you can make your own as nnxion said.
A suggestion: don't lose your time trying to learn how to create windows with win32 api, they are very difficult and not flexibile. Learn how to create dialogs with resources, they need much less lines of code! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|