Hi,
I have few problems, so I hope someone will help me :) I started with win32 API yesterday and I really like it, but I need little help :)
#1 edit: I already fixed this :P
#2 I created small "login" application, after user press "login" it should get his username and password and copy it into arrays, and then check if "username" is "lal", if yes, then open message box with "OK" msg, else, open msg box with "error" msg, I'm still getting error msg box, even if I have "lal" in username
code:
case IDC_CONNECT1:
{
char Username[256];
char Password[256];
SendMessage(hUsername, WM_GETTEXT, sizeof(Username)/sizeof(Username[0]), reinterpret_cast<LPARAM>(Username));
SendMessage(hPassword, WM_GETTEXT, sizeof(Password)/sizeof(Password[0]), reinterpret_cast<LPARAM>(Password));
if(Username == "lal")
{
MessageBox(hWnd, "OK", NULL, MB_OK);
}
else
{
MessageBox(hWnd, "Error!", NULL, MB_OK);
}
break;
}
#3 this one is for both, chat and login application, when I type something into edit box (username/password - login, message - chat) and press enter, it will just play that error beep or something, so I need to click on send/login manually, BUT, it works if I click on menu or something (I will type something into edit box, then I press file in menu, close menu, and then when I press enter it will send that message...), so I need to "deactivate" edit box or something
code: (chat client)
case WM_KEYDOWN:
{
switch(wParam)
{
case VK_RETURN:
{
char buffer[256];
SendMessage(hEdit, WM_GETTEXT, sizeof(buffer)/sizeof(buffer[0]), reinterpret_cast<LPARAM>(buffer));
MessageBox(hEdit, buffer, "Information", MB_ICONINFORMATION);
}
break;
}
break;
}
#4 what can I use like handler for messages?
something like this
-------------------------------
| Text from input field |
| when the user clicked |
| 'send' |
| |
| |
-------------------------------
| |
| Enter Text Here |
| |
-------------------------------
| SEND|
I need that window at top :P