how to Get a handle of edit controle

G

Guest

H

How can i get a handle of edit controle
Any help would be apprecaited
Thank

-Begin cod

LRESULT CALLBACK LOGIN_WmdProc (HWND hWnd,
UINT message
WPARAM wParam,
LPARAM lParam


switch(message

case WM_CREATE:

HWND hButton, hTextBox, hLabel1
hLabel1 = CreateWindowEx(0, "STATIC", "Enter Name Here:", WS_CHILD
0, 13, 119, 18, hWnd, NULL, MyAppInstance, NULL)
hTextBox = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "",
WS_CHILD | ES_AUTOHSCROLL | WS_BORDER,115, 10,
290, 22, hWnd, (HMENU) TXTLOGIN, MyAppInstance ,
NULL)
hButton =::CreateWindowEx(0, "Button", "Add to list box", WS_CHILD |
BS_DEFPUSHBUTTON, 0, 35, 115, 25, hWnd,(HMENU)
CMDLOGIN, MyAppInstance, NULL)
ShowWindow(hLabel1, SW_SHOWNORMAL)
ShowWindow(hTextBox, SW_SHOWNORMAL)
ShowWindow(hButton, SW_SHOWNORMAL)

SetFocus(hTextBox)
break

case WM_COMMAND
switch (wParam

case CMDLOGIN://a string resourc

char sText[20]
::GetWindowText((HWND)
TXTLOGIN,sText,GetWindowTextLength((HWND
TXTLOGIN) + 1)
//****here i wanna get the edit controle's text but i dont
//****have it is handle and i dont want to make a global
//***variabl
::MessageBox(hWnd,sText,0,0);

break
case WM_QUERYENDSESSION
case WM_CLOSE
if (IDOK != MessageBox (hWnd, TEXT ("Are Sure do you want to
close this window\nPlease check your data")
TEXT ("Attention"),
MB_ICONQUESTION | MB_OKCANCEL)
return 0
break
case WM_DESTROY
break

return DefMDIChildProc(hWnd, message, wParam, lParam); //note: MDI client


-End Cod

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top