what is the key words and library to exercute a box that require the user to click as an input??
p.s i mean what should i #include in my programme
what is the key words and library to exercute a box that require the user to click as an input??
p.s i mean what should i #include in my programme
Last edited by raynon; 04-01-2010 at 11:01 PM.
What library?
MessageBox()
Code:#include <windows.h>
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
as cpjust says, you need MessageBox.
here is a working example:MessageBox(NULL, YourStringTextHere, YourStringTitleHere, MB_OK);
/* Sample of a messagebox */
however, if you want a messagebox which popups and only closes when#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Hi!", "Message: ", MB_OK);
}
you click anywhere in it. you have to look for Dialogs in Windows programming.
what should i do if i wan 2 clickable box??
what do you mean by that? do you mean two buttons in a box or
something else?
You need to be more specific. No one is going to tell you how to do A or B. Try something and come back,
i mean something looks like when you are having more than 1 tab, when you try to close the explorer, it shows a dialog box having "close current tab" and "close all tabs"
first, learn Dialog Windows Programming (EFNet #Winprog).
second, here is the algorithm:
the first button (Close all Tabs) is created only if you have more than oneif Tabs > 1 then
Make a Button with the text "Close all Tabs"
end if
Make a Button with the text "Close Current Tab"
tab. the second one (Close Current Tab) is created, with or without the first
button. if hope this algorithm helps.
UltraKing227, whenever someone gives advice on how to do 'some' windows type stuff, I perk up. But your example does not work for me. I get a:
"error C2664: 'MessageBoxW': cannot convert parameter 2 from 'const char [4]' to 'LPCWSTR'.
I never have luck with any examples given in books either. There is something magical they never tell you about - some special way to set up the 'project' or some check-box in the 'properties'. I give up trying anymore and stick with "console" error messages and real 'C' code that doesn't have illegally named main procedures. Sorry, I get all dinosaury when I see this stuff and it never compiles right for me.
Last edited by nonoob; 04-06-2010 at 03:38 PM.
Quick fix: change "strings" to L"strings" (with the L in front). ("LPCWSTR" is the gobbledygook for pointer to wide characters, interpreted as a string, or something like that, so you'll have to be using wchar_t and Long strings.)
(I suppose the longer fix would be to find the Unicode setting and change it.)