- Joined
- Nov 24, 2022
- Messages
- 92
- Reaction score
- 7
Hi.
Have a small problem when I want to hide edit window when I'm pressing enter button
What I'm doing wrong.
Everything runs before switch() expression.
All I want is on dblclick mouse on listbox element, move edit3 window (at the bottom of picture) to the position of listbox selected element and to be shown. Then write sth into it, press eneter ,copy value to listbox (replace current element) and hide this edit3 window.
```
// hWndList - handle to a ListBox window
if ((HWND)lParam == hWndList) {
if (message == (INT)WM_LBUTTONUP | (INT)WM_COMMAND) { /* works correctly */ }
// the one below works always (makes beeep every time) and I want it to be run only when I make double click on this listbox window
if ((HWND)lParam == hWndList) {
if (message == (INT)WM_LBUTTONDBLCLK | (INT)WM_COMMAND) { MessageBeep(1); } }
// here I expect to hide edit window when I press enter button
if ((HWND)lParam == hEdit3 ) {
if (wParam == IDOK) { ShowWindow(hEdit3,SW_HIDE);} }
// this one never runs
if ((HWND)lParam == hEdit3 ) {
if(message == WM_LBUTTONDOWN){ }}
Have a small problem when I want to hide edit window when I'm pressing enter button
What I'm doing wrong.
Everything runs before switch() expression.
All I want is on dblclick mouse on listbox element, move edit3 window (at the bottom of picture) to the position of listbox selected element and to be shown. Then write sth into it, press eneter ,copy value to listbox (replace current element) and hide this edit3 window.
```
// hWndList - handle to a ListBox window
if ((HWND)lParam == hWndList) {
if (message == (INT)WM_LBUTTONUP | (INT)WM_COMMAND) { /* works correctly */ }
// the one below works always (makes beeep every time) and I want it to be run only when I make double click on this listbox window
if ((HWND)lParam == hWndList) {
if (message == (INT)WM_LBUTTONDBLCLK | (INT)WM_COMMAND) { MessageBeep(1); } }
// here I expect to hide edit window when I press enter button
if ((HWND)lParam == hEdit3 ) {
if (wParam == IDOK) { ShowWindow(hEdit3,SW_HIDE);} }
// this one never runs
if ((HWND)lParam == hEdit3 ) {
if(message == WM_LBUTTONDOWN){ }}