• Advertisement

Archived

This topic is now archived and is closed to further replies.

Edit box won't respond. Any ideas?

This topic is 5514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I compile this simple program, the edit box won''t respond to input, ie: whatever I type, the cursor just sits there! I can still get/set the window text, this is the only problem.... LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM w, LPARAM l){ if(message == WM_CLOSE)PostQuitMessage(0); return DefWindowProc(hwnd, message, w, l); } int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { WNDCLASSEX winclass; memset(&winclass, 0, sizeof(WNDCLASSEX)); winclass.hInstance = GetModuleHandle(NULL); winclass.lpszClassName = "_Some_Application_"; winclass.lpfnWndProc = WindowProcedure; winclass.style = CS_DBLCLKS; winclass.cbSize = sizeof(WNDCLASSEX); winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); winclass.hCursor = LoadCursor(NULL, IDC_ARROW); winclass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH); if(!RegisterClassEx(&winclass)) { return 0; } HWND hwnd = CreateWindowEx(0, winclass.lpszClassName, "Welcome", WS_OVERLAPPEDWINDOWWS_VISIBLE, 0, 0, 500, 500, HWND_DESKTOP, 0, GetModuleHandle(NULL), 0); HWND edit = CreateWindowEx(0, "EDIT", "Text", WS_CHILDWS_VISIBLE, 0, 0, 200, 200, hwnd, 0, GetModuleHandle(NULL), 0); MSG msg; while(GetMessage(&msg, 0, 0, 0) > 0) { DispatchMessage(&msg); } return 0; }

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
TranslateMessage

Share this post


Link to post
Share on other sites

  • Advertisement