![]() |
| | #1 |
| Registered User Join Date: Feb 2010
Posts: 34
| Child window handle not known Code: for(i = 3; i < 13; i++) hwndEdit[i] = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("edit"), TEXT(""), WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOHSCROLL, 2*cxChar, (6+(2+7/4)*i)*cyChar, 10*cxChar, 7*cyChar/4, hwnd, (HMENU) i+3, ((LPCREATESTRUCT) lParam) -> hInstance, NULL);
Code: hChild = GetDlgItem(hwnd, 8);
if(hChild) MessageBox(NULL, TEXT("A handle is returned"), TEXT("Warning!"), MB_OK | MB_ICONINFORMATION);
|
| mvanrijnbach is offline | |
| | #2 |
| Registered User Join Date: Feb 2010
Posts: 34
| Actually I think I should use hChild = GetDlgItem(GetParent(hwnd), 8), because hwnd is the handle to the Dialog Window. The child window with ID 8 also has the parent of the Dialog Window as its parent. |
| mvanrijnbach is offline | |
| | #3 |
| Registered User Join Date: Feb 2010
Posts: 34
| hmmm, still this doesn't work though.... |
| mvanrijnbach is offline | |
| | #4 |
| Registered User Join Date: Feb 2010
Posts: 34
| ok, this is pretty stupid. I fixed it myself The 'i+3' after (HMENU) in CreateWindow has to be in between brackets, otherwise only the handle to ID equal to 3 is known. |
| mvanrijnbach is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting other processes class names | Hawkin | Windows Programming | 3 | 03-20-2008 04:02 PM |
| Posting a message to a child window | axr0284 | Windows Programming | 6 | 01-27-2005 09:35 AM |
| problem with open gl engine. | gell10 | Game Programming | 1 | 08-21-2003 04:10 AM |
| OpenGL and Windows | sean345 | Game Programming | 5 | 06-24-2002 10:14 PM |
| opengl code not working | Unregistered | Windows Programming | 4 | 02-14-2002 10:01 PM |