comparison win/dw.c @ 247:c097ffe6cfeb

Implemented dw_window_from_id() on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 19 Feb 2003 08:46:50 +0000
parents 3c1e39905f2f
children 0f9a185deeb6
comparison
equal deleted inserted replaced
246:bdaaa06285fd 247:c097ffe6cfeb
4485 void API dw_window_enable(HWND handle) 4485 void API dw_window_enable(HWND handle)
4486 { 4486 {
4487 EnableWindow(handle, TRUE); 4487 EnableWindow(handle, TRUE);
4488 } 4488 }
4489 4489
4490 static HWND _dw_wfid_hwnd = NULL;
4491
4492 BOOL CALLBACK _wfid(HWND handle, LPARAM lParam)
4493 {
4494 if(GetWindowLong(handle, GWL_ID) == lParam)
4495 {
4496 _dw_wfid_hwnd = handle;
4497 return FALSE;
4498 }
4499 return TRUE;
4500 }
4501
4490 /* 4502 /*
4491 * Gets the child window handle with specified ID. 4503 * Gets the child window handle with specified ID.
4492 * Parameters: 4504 * Parameters:
4493 * handle: Handle to the parent window. 4505 * handle: Handle to the parent window.
4494 * id: Integer ID of the child. 4506 * id: Integer ID of the child.
4495 */ 4507 */
4496 HWND API dw_window_from_id(HWND handle, int id) 4508 HWND API dw_window_from_id(HWND handle, int id)
4497 { 4509 {
4498 return 0L; 4510 _dw_wfid_hwnd = NULL;
4511 EnumChildWindows(handle, _wfid, (LPARAM)id);
4512 return _dw_wfid_hwnd;
4499 } 4513 }
4500 /* 4514 /*
4501 * Pack windows (widgets) into a box from the start (or top). 4515 * Pack windows (widgets) into a box from the start (or top).
4502 * Parameters: 4516 * Parameters:
4503 * box: Window handle of the box to be packed into. 4517 * box: Window handle of the box to be packed into.