Feature #12040
WIN32 API emulation: additional user32, gdi32 and wtsapi32 entry points
0%
History
#1 Updated by Greg Shah about 1 month ago
WIN32 API emulation: additional user32, gdi32 and wtsapi32 entry points¶
Project: User Interface
Problem¶
FWD emulates a set of Win32 entry points that GUI applications call through PROCEDURE ... EXTERNAL, in util/NativeAPIEmulation.java: among them LockWindowUpdate, PostMessageA, ShowScrollBar, GetWindowRect, GetParent, ScreenToClient, GetCursorPos, GetSystemMetrics, DisableProcessWindowsGhosting, GetComputerNameA and the wsock32 host name calls. The handle they receive is the FWD widget id that HWND returns.
Several entry points that real applications use are missing or only partly supported. A call to one of them reaches UnimplementedFeature or does nothing.
Work¶
Add the following to NativeAPIEmulation, each acting on the client where the user is:
SendMessageA, which today handles onlyWM_HSCROLL,WM_VSCROLLand 516/517:WM_LBUTTONDOWN/WM_LBUTTONUP(513/514), through the existingapplyMessageApath, asPostMessageAalready does;CB_SHOWDROPDOWN(335), which opens or closes a combo box drop-down.
GetDC,ReleaseDCand gdi32GetDeviceCaps: return the client's logical DPI forLOGPIXELSX/LOGPIXELSY(88/90). Applications use this to scale mouse coordinates for ActiveX hit testing.GetSysColor, which today handles indices 15, 16 and 20: addCOLOR_MENU(4) and the other common indices, from the theme palette.- Borderless window:
GetWindowLongA/SetWindowLongAonGWL_STYLE,AdjustWindowRect, andSetWindowPoswithSWP_FRAMECHANGED, mapped onto window attributes: no title bar, thin border, and the requested position. Applications typically combine the style bits through helper DLL functions (for example bit removal and bitwise OR in a "proextra" library loaded withLoadLibraryA), so those calls need handling too. - System menu:
GetSystemMenu,GetMenuItemCount,RemoveMenuandDrawMenuBar, so that an application can disable a window's close button. WTSQuerySessionInformationAfor classes 10, 14 and 26 (client name, client address, session information), answered from the FWD client's identity.- Inactivity:
GetLastInputInfofrom the client's input timestamps, andWaitForInputIdleas a no-op.
Each entry point needs testcases that compare the result with Windows OpenEdge.
#2 Updated by Greg Shah 7 days ago
One more case for the wsock32 entry points. We have a project with 4GL SMTP code that runs as a batch or appserver process and calls gethostname (after WSAStartup) to get the local host name for the SMTP HELO / EHLO command.
The emulation answers gethostname, gethostbyname and inet_ntoa for the client machine, which is right for interactive code that wants to identify the user's PC. For server-side code the SMTP server needs the name of the machine that actually connects to it, which is the FWD server.
Please define which side answers these calls in each kind of session: the client machine for interactive sessions, and the server for batch processes and appserver agents, which have no user's PC behind them. If a project needs the other answer in a given case, provide a way to get it (for example a configuration setting, or a documented alternative such as OS-GETENV("HOSTNAME") on the server).
Testcases: gethostname / gethostbyname / inet_ntoa in an interactive web client session, a batch client, and an appserver agent, checking which host each returns.