pmwin: Added a few WinIs* APIs.

This commit is contained in:
Ryan C. Gordon committed 2018-07-10 01:27:30 -04:00
1 parent e31492cc16
commit 8c5d43f997
3 files changed
+57

No files matched your search

+3
View File
@@ -18,6 +18,9 @@ LX_NATIVE_MODULE_INIT()
LX_NATIVE_EXPORT(WinFillRect, 743),
LX_NATIVE_EXPORT(WinGetLastError, 753),
LX_NATIVE_EXPORT(WinInitialize, 763),
LX_NATIVE_EXPORT(WinIsWindow, 772),
LX_NATIVE_EXPORT(WinIsWindowEnabled, 773),
LX_NATIVE_EXPORT(WinIsWindowVisible, 775),
LX_NATIVE_EXPORT(WinTerminate, 888),
LX_NATIVE_EXPORT(WinPostQueueMsg, 902),
LX_NATIVE_EXPORT(WinCreateStdWindow, 908),
+51
View File
@@ -78,6 +78,7 @@ typedef struct Window
LONG y;
LONG w;
LONG h;
BOOL enabled;
} Window;
typedef struct MessageQueueItem
@@ -1624,5 +1625,55 @@ BOOL WinFillRect(HPS hps, PRECTL prcl, LONG lColor)
return TRUE;
} // WinFillRect
BOOL WinIsWindow(HAB hab, HWND hwnd)
{
TRACE_NATIVE("WinIsWindow(%u, %u)", (uint) hab, (uint) hwnd);
FIXME("this 'get the anchor, get the window, set errors' code is repeated a lot");
AnchorBlock *anchor = getAnchorBlockNoHAB();
if (!anchor) {
SET_WIN_ERROR_AND_RETURN(anchor, PMERR_INVALID_HWND, FALSE);
}
Window *win = getWindowFromHWND(anchor, hwnd);
if (!win) {
SET_WIN_ERROR_AND_RETURN(anchor, PMERR_INVALID_HWND, FALSE);
}
return TRUE;
} // WinIsWindow
BOOL WinIsWindowEnabled(HWND hwnd)
{
TRACE_NATIVE("WinIsWindowEnabled(%u)", (uint) hwnd);
AnchorBlock *anchor = getAnchorBlockNoHAB();
if (!anchor) {
SET_WIN_ERROR_AND_RETURN(anchor, PMERR_INVALID_HWND, FALSE);
}
Window *win = getWindowFromHWND(anchor, hwnd);
if (!win) {
SET_WIN_ERROR_AND_RETURN(anchor, PMERR_INVALID_HWND, FALSE);
}
return win->enabled;
} // WinIsWindowEnabled
BOOL WinIsWindowVisible(HWND hwnd)
{
TRACE_NATIVE("WinIsWindowVisible(%u)", (uint) hwnd);
AnchorBlock *anchor = getAnchorBlockNoHAB();
if (!anchor) {
SET_WIN_ERROR_AND_RETURN(anchor, PMERR_INVALID_HWND, FALSE);
}
Window *win = getWindowFromHWND(anchor, hwnd);
if (!win) {
SET_WIN_ERROR_AND_RETURN(anchor, PMERR_INVALID_HWND, FALSE);
}
return ((win->style & WS_VISIBLE) == WS_VISIBLE) ? TRUE : FALSE;
} // WinIsWindowVisible
// end of pmwin.c ...
+3
View File
@@ -894,6 +894,9 @@ OS2EXPORT BOOL OS2API WinPostQueueMsg(HMQ hmq, ULONG msg, MPARAM mp1, MPARAM mp2
OS2EXPORT HPS OS2API WinBeginPaint(HWND hwnd, HPS hps, PRECTL prclPaint) OS2APIINFO(703);
OS2EXPORT BOOL OS2API WinEndPaint(HPS hps) OS2APIINFO(738);
OS2EXPORT BOOL OS2API WinFillRect(HPS hps, PRECTL prcl, LONG lColor) OS2APIINFO(743);
OS2EXPORT BOOL OS2API WinIsWindow(HAB hab, HWND hwnd) OS2APIINFO(772);
OS2EXPORT BOOL OS2API WinIsWindowEnabled(HWND hwnd) OS2APIINFO(773);
OS2EXPORT BOOL OS2API WinIsWindowVisible(HWND hwnd) OS2APIINFO(775);
#ifdef __cplusplus
}