I got the window setup the way I wanted, but when I use RegisterHotKey for the second textbox and tested it out, it didn't work. What did I do wrong? Or is there a better way to check when the user presses return/enter in the text boxes?Code:LRESULT CALLBACK WndProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_CREATE: { HWND hWindow = FindWindow("Untitled Window Class", "Untitled Window Name"); if (hWindow == NULL) { MessageBox(hwnd, "Error", "", MB_ICONEXCLAMATION | MB_OK); //PostMessage(hwnd, WM_QUIT, NULL, NULL); } RECT rWindow; GetWindowRect(hwnd, &rWindow); hEdit1 = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL, 0, 0, rWindow.right - rWindow.left - 5, rWindow.bottom - 150, hwnd, (HMENU)IDC_EDIT1_BOX, GetModuleHandle(NULL), NULL); hEdit2 = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL, 0, rWindow.bottom - 150, rWindow.right - rWindow.left - 5, 150, hwnd, (HMENU)IDC_EDIT2_BOX, GetModuleHandle(NULL), NULL); RegisterHotKey(hEdit2, VK_RETURN, NULL, 2000); } break; case WM_HOTKEY: switch (LOWORD(wParam)) { case 2000: MessageBox(hwnd, "It Worked", "It Worked", MB_OK); break; } break; case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, Msg, wParam, lParam); }
Also In the text boxes, when I type to the bottom of the box it will auto scroll down, but it will is one 1 short of that...
This is what it looks when when I use the auto scrolling.
Is there a way to fix that too?Code:Text Text Text -----------------End Of the Text Box----------------- End of Text



LinkBack URL
About LinkBacks



