dimanche 10 mai 2015

Trying to return a char*/string after button clicked with CreateWindow in windows.h

Using windows.h i have the following windows created:

I think there is no need to write the obvious things that WINAPI WinMain needs.

textToWrite = CreateWindow("EDIT",
"",
WS_BORDER | WS_CHILD | WS_VISIBLE,
290, 70, 165, 20,
hwnd, NULL, NULL, NULL
);

analize = CreateWindow("BUTTON",
"Analize",
WS_VISIBLE | WS_CHILD | WS_BORDER,
465, 70, 60, 20,
hwnd, NULL, NULL, NULL
);

Result = CreateWindow("STATIC",
getResultFromWritenText(),
WS_BORDER | WS_CHILD | WS_VISIBLE,
290, 100, 235, 20,
hwnd, NULL, NULL, NULL
);

I want that when "Analize" button is clicked, the "Result" static window returns something according to what the function getResultFromWritenText() returns. This is that i don't want the same text written as output (of textToWrite), but a new string/char* in base of an analysis of what was written by the user, knowing that getResultFromWritenText() function would know it and return it (whatever i want it to return) in the text field, not as a popup.

How can i do this? Thanks.

Aucun commentaire:

Enregistrer un commentaire