Foro de elhacker.net

Programación => Programación C/C++ => Mensaje iniciado por: mataliebres en 17 Marzo 2015, 19:39 pm



Título: api de windows
Publicado por: mataliebres en 17 Marzo 2015, 19:39 pm
buenas, estoy intentando aprender la api de windows pero no me entero de mucho, en la funcion CreateWindowEx   en que variable se guarda el texto que pongo para poder hacer calculos con el?


Título: Re: api de windows
Publicado por: Eternal Idol en 18 Marzo 2015, 01:27 am
¿Que le estas pasando como lpClassName?

CreateWindowEx function (https://msdn.microsoft.com/en-us/library/windows/desktop/ms632680%28v=vs.85%29.aspx)


Título: Re: api de windows
Publicado por: mataliebres en 18 Marzo 2015, 18:56 pm
esto L"EDIT"


Título: Re: api de windows
Publicado por: Eternal Idol en 18 Marzo 2015, 19:04 pm
Edit Control (https://msdn.microsoft.com/en-us/library/windows/desktop/bb775458%28v=vs.85%29.aspx)

Edit Control Text Operations (https://msdn.microsoft.com/en-us/library/windows/desktop/bb775460(v=vs.85).aspx)

Cita de: msdn
Setting and Retrieving Text

An application can set the text of an edit control by using the SetWindowText function, the SetDlgItemText function, or by sending the contol a WM_SETTEXT message.

To retrieve all text from an edit control, first use the GetWindowTextLength function or the WM_GETTEXTLENGTH message to determine the size of buffer needed to contain the text. Next, retrieve the text by using the GetWindowText function, the GetDlgItemText function, or the WM_GETTEXT message.


Título: Re: api de windows
Publicado por: mataliebres en 18 Marzo 2015, 19:18 pm
El problema es que esta todo en ingles y traducido con el traductor de google tampoco me entero de mucho, podrias poner un ejemplo de codigo y explicarme en que variable se guarda? te lo agradeceria mucho


Título: Re: api de windows
Publicado por: Eternal Idol en 18 Marzo 2015, 20:17 pm
Si lo que queres es OBTENER el valor de un Edit - que es una cadena de caracteres ANSI o Unicode - podes hacerlo asi (ej. ANSI):

Código
  1. char szBuf[80] = { 0 };
  2. SendMessage(hwnd, WM_GETTEXT, sizeof(szBuf), (LPARAM)szBuf);