Nadir Van Thielen
asked on
C++ EDIT CreateWindow
Hallo,
When i, wane add a new EDIT child window which the user can type text from the keyboard.
a normal text box works, but when I challenge CreateWindowExW( EDIT ..)
and BUILD and run the program from my compute noting happens.
Do i miss the paint code or something.
When i, wane add a new EDIT child window which the user can type text from the keyboard.
a normal text box works, but when I challenge CreateWindowExW( EDIT ..)
and BUILD and run the program from my compute noting happens.
Do i miss the paint code or something.
// Add a new TEXT imput box
//CreateWindow(TEXT("EDIT"),TEXT ("VALEU"), WS_VISIBLE | WS_CHILD | WS_BORDER ,10,10 ,200,25,hWnd, (HMENU) NULL,NULL,NULL );
// Add a new TEXT edit window
CreateWindowExW(WS_EX_CLIENTEDGE, TEXT("Edit"), NULL, WS_CHILD, 10, 10, 200, 25, hWnd, (HMENU) NULL,NULL,NULL );
Untitled.jpg
ASKER
I , understand your solution Sara,
but don't understand where i need to call hwndEdit in the code ,
where this you get "hwndEdit" from.
but don't understand where i need to call hwndEdit in the code ,
where this you get "hwndEdit" from.
CreateWindowExW(WS_EX_CLIENTEDGE, TEXT("Edit"), NULL, WS_CHILD, 10, 10, 200, 25, hWnd, (HMENU) NULL,NULL,NULL );
ShowWindow(hwndEdit, SW_SHOW);
Hi,
CreateWindow returns it:
hwndEdit = CreateWindowExW(WS_EX_CLIE NTEDGE, TEXT("Edit"), NULL, WS_CHILD, 10, 10, 200, 25, hWnd, (HMENU) NULL,NULL,NULL );
ShowWindow(hwndEdit, SW_SHOW);
-FA
CreateWindow returns it:
hwndEdit = CreateWindowExW(WS_EX_CLIE
ShowWindow(hwndEdit, SW_SHOW);
-FA
from your code i see that you have created an mfc application.
if that is true you might consider to use a dialog-based mfc app rather than an SDI application with self-created controls.
you easily can test this option by creating a new mfc application project - say YopaWordEditor - and choose dialog-based as option. the generated mfc code already would generate a dialog resource for you and you easily could design a dialog form by using the resource editor.
Sara
if that is true you might consider to use a dialog-based mfc app rather than an SDI application with self-created controls.
you easily can test this option by creating a new mfc application project - say YopaWordEditor - and choose dialog-based as option. the generated mfc code already would generate a dialog resource for you and you easily could design a dialog form by using the resource editor.
Sara
ASKER
I understand dialog-based mfc app ,
but i wanna LOW-LEVEL programming in the distend future build it in a intel FPGA micro controller.
And it's easier to write a c++ kernel
but i wanna LOW-LEVEL programming in the distend future build it in a intel FPGA micro controller.
And it's easier to write a c++ kernel
HWND hwndEdit;
...
..
hwndEdit = CreateWindowExW(WS_EX_CLIENTEDGE, TEXT("Edit"), NULL, WS_CHILD, 10, 10, 200, 25, hWnd, (HMENU) NULL,NULL,NULL ); ShowWindow(hwndEdit, SW_SHOW);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
if you provide a parent window (you did with 'hwnd') and a valid ID (as HMENU) to the Create function, you would be able to retrieve the window handle of the edit box by calling
Open in new window
where ctrlID is the ID that you passed as HMENU to the CreateWindowEx function.
Sara