Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 9th, 2006, 12:49 AM   #1
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
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:
Originally Posted by Mohamed Jihad
Durka durka!
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!
jayme is offline   Reply With Quote
Old Jan 9th, 2006, 3:40 AM   #2
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Old Jan 9th, 2006, 4:50 AM   #3
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
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!
ivan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:02 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC