5 #define INCL_WINSWITCHLIST
6 #define INCL_WINWINDOWMGR
10 #define INCL_WINCLIPBOARD
19 constant(char *name, int arg)
22 if (name[0] == 'P' && name[1] == '_') {
23 if (strEQ(name, "P_BACKGROUND"))
29 if (strEQ(name, "P_DEBUG"))
35 if (strEQ(name, "P_DEFAULT"))
41 if (strEQ(name, "P_DETACH"))
47 if (strEQ(name, "P_FOREGROUND"))
53 if (strEQ(name, "P_FULLSCREEN"))
59 if (strEQ(name, "P_MAXIMIZE"))
65 if (strEQ(name, "P_MINIMIZE"))
71 if (strEQ(name, "P_NOCLOSE"))
77 if (strEQ(name, "P_NOSESSION"))
83 if (strEQ(name, "P_NOWAIT"))
89 if (strEQ(name, "P_OVERLAY"))
95 if (strEQ(name, "P_PM"))
101 if (strEQ(name, "P_QUOTE"))
107 if (strEQ(name, "P_SESSION"))
113 if (strEQ(name, "P_TILDE"))
119 if (strEQ(name, "P_UNRELATED"))
125 if (strEQ(name, "P_WAIT"))
131 if (strEQ(name, "P_WINDOWED"))
137 } else if (name[0] == 'T' && name[1] == '_') {
138 if (strEQ(name, "FAPPTYP_NOTSPEC"))
139 #ifdef FAPPTYP_NOTSPEC
140 return FAPPTYP_NOTSPEC;
144 if (strEQ(name, "T_NOTWINDOWCOMPAT"))
145 #ifdef FAPPTYP_NOTWINDOWCOMPAT
146 return FAPPTYP_NOTWINDOWCOMPAT;
150 if (strEQ(name, "T_WINDOWCOMPAT"))
151 #ifdef FAPPTYP_WINDOWCOMPAT
152 return FAPPTYP_WINDOWCOMPAT;
156 if (strEQ(name, "T_WINDOWAPI"))
157 #ifdef FAPPTYP_WINDOWAPI
158 return FAPPTYP_WINDOWAPI;
162 if (strEQ(name, "T_BOUND"))
164 return FAPPTYP_BOUND;
168 if (strEQ(name, "T_DLL"))
174 if (strEQ(name, "T_DOS"))
180 if (strEQ(name, "T_PHYSDRV"))
181 #ifdef FAPPTYP_PHYSDRV
182 return FAPPTYP_PHYSDRV;
186 if (strEQ(name, "T_VIRTDRV"))
187 #ifdef FAPPTYP_VIRTDRV
188 return FAPPTYP_VIRTDRV;
192 if (strEQ(name, "T_PROTDLL"))
193 #ifdef FAPPTYP_PROTDLL
194 return FAPPTYP_PROTDLL;
198 if (strEQ(name, "T_32BIT"))
200 return FAPPTYP_32BIT;
214 const char* const ptypes[] = { "FS", "DOS", "VIO", "PM", "DETACH" };
223 if (!(_emx_env & 0x200)) return (char*)ptypes[1]; /* not OS/2. */
224 if (CheckOSError(DosGetInfoBlocks(&tib, &pib)))
227 return (pib->pib_ultype <= 4 ? (char*)ptypes[pib->pib_ultype] : "UNKNOWN");
231 file_type(char *path)
236 if (!(_emx_env & 0x200))
237 croak("file_type not implemented on DOS"); /* not OS/2. */
238 if (CheckOSError(DosQueryAppType(path, &apptype))) {
240 if (rc == ERROR_INVALID_EXE_SIGNATURE)
241 croak("Invalid EXE signature");
242 else if (rc == ERROR_EXE_MARKED_INVALID) {
243 croak("EXE marked invalid");
246 croak_with_os2error("DosQueryAppType");
252 /* These use different type of wrapper. Good to check wrappers. ;-) */
253 /* XXXX This assumes DOS type return type, without SEVERITY?! */
254 DeclFuncByORD(HSWITCH, myWinQuerySwitchHandle, ORD_WinQuerySwitchHandle,
255 (HWND hwnd, PID pid), (hwnd, pid))
256 DeclFuncByORD(ULONG, myWinQuerySwitchEntry, ORD_WinQuerySwitchEntry,
257 (HSWITCH hsw, PSWCNTRL pswctl), (hsw, pswctl))
258 DeclFuncByORD(ULONG, myWinSetWindowText, ORD_WinSetWindowText,
259 (HWND hwnd, char* text), (hwnd, text))
260 DeclFuncByORD(BOOL, myWinQueryWindowProcess, ORD_WinQueryWindowProcess,
261 (HWND hwnd, PPID ppid, PTID ptid), (hwnd, ppid, ptid))
262 DeclFuncByORD(ULONG, XmyWinSwitchToProgram, ORD_WinSwitchToProgram,
263 (HSWITCH hsw), (hsw))
264 #define myWinSwitchToProgram(hsw) (!CheckOSError(XmyWinSwitchToProgram(hsw)))
267 /* These function croak if the return value is 0. */
268 DeclWinFunc_CACHE(HWND, QueryWindow, (HWND hwnd, LONG cmd), (hwnd, cmd))
269 DeclWinFunc_CACHE(BOOL, QueryWindowPos, (HWND hwnd, PSWP pswp),
271 DeclWinFunc_CACHE(LONG, QueryWindowText,
272 (HWND hwnd, LONG cchBufferMax, PCH pchBuffer),
273 (hwnd, cchBufferMax, pchBuffer))
274 DeclWinFunc_CACHE(LONG, QueryClassName, (HWND hwnd, LONG cchMax, PCH pch),
276 DeclWinFunc_CACHE(HWND, QueryFocus, (HWND hwndDesktop), (hwndDesktop))
277 DeclWinFunc_CACHE(BOOL, SetFocus, (HWND hwndDesktop, HWND hwndFocus),
278 (hwndDesktop, hwndFocus))
279 DeclWinFunc_CACHE(BOOL, ShowWindow, (HWND hwnd, BOOL fShow), (hwnd, fShow))
280 DeclWinFunc_CACHE(BOOL, EnableWindow, (HWND hwnd, BOOL fEnable),
282 DeclWinFunc_CACHE(BOOL, SetWindowPos,
283 (HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y,
284 LONG cx, LONG cy, ULONG fl),
285 (hwnd, hwndInsertBehind, x, y, cx, cy, fl))
286 DeclWinFunc_CACHE(HENUM, BeginEnumWindows, (HWND hwnd), (hwnd))
287 DeclWinFunc_CACHE(BOOL, EndEnumWindows, (HENUM henum), (henum))
288 DeclWinFunc_CACHE(BOOL, EnableWindowUpdate, (HWND hwnd, BOOL fEnable),
290 DeclWinFunc_CACHE(BOOL, SetWindowBits,
291 (HWND hwnd, LONG index, ULONG flData, ULONG flMask),
292 (hwnd, index, flData, flMask))
293 DeclWinFunc_CACHE(BOOL, SetWindowPtr, (HWND hwnd, LONG index, PVOID p),
295 DeclWinFunc_CACHE(BOOL, SetWindowULong, (HWND hwnd, LONG index, ULONG ul),
297 DeclWinFunc_CACHE(BOOL, SetWindowUShort, (HWND hwnd, LONG index, USHORT us),
299 DeclWinFunc_CACHE(HWND, IsChild, (HWND hwnd, HWND hwndParent),
301 DeclWinFunc_CACHE(HWND, WindowFromId, (HWND hwnd, ULONG id), (hwnd, id))
302 DeclWinFunc_CACHE(HWND, EnumDlgItem, (HWND hwndDlg, HWND hwnd, ULONG code),
303 (hwndDlg, hwnd, code))
304 DeclWinFunc_CACHE(HWND, QueryDesktopWindow, (HAB hab, HDC hdc), (hab, hdc));
305 DeclWinFunc_CACHE(BOOL, SetActiveWindow, (HWND hwndDesktop, HWND hwnd),
306 (hwndDesktop, hwnd));
307 DeclWinFunc_CACHE(BOOL, QueryActiveDesktopPathname, (PSZ pszPathName, ULONG ulSize),
308 (pszPathName, ulSize));
309 DeclWinFunc_CACHE(BOOL, InvalidateRect,
310 (HWND hwnd, /*RECTL*/ char *prcl, BOOL fIncludeChildren),
311 (hwnd, prcl, fIncludeChildren));
312 DeclWinFunc_CACHE(BOOL, CreateFrameControls,
313 (HWND hwndFrame, /*PFRAMECDATA*/ char* pfcdata, PCSZ pszTitle),
314 (hwndFrame, pfcdata, pszTitle));
315 DeclWinFunc_CACHE(BOOL, OpenClipbrd, (HAB hab), (hab));
316 DeclWinFunc_CACHE(BOOL, EmptyClipbrd, (HAB hab), (hab));
317 DeclWinFunc_CACHE(BOOL, CloseClipbrd, (HAB hab), (hab));
318 DeclWinFunc_CACHE(HWND, QueryClipbrdViewer, (HAB hab), (hab));
319 DeclWinFunc_CACHE(HWND, QueryClipbrdOwner, (HAB hab), (hab));
320 DeclWinFunc_CACHE(BOOL, QueryClipbrdFmtInfo, (HAB hab, ULONG fmt, PULONG prgfFmtInfo), (hab, fmt, prgfFmtInfo));
321 DeclWinFunc_CACHE(ULONG, QueryClipbrdData, (HAB hab, ULONG fmt), (hab, fmt));
322 DeclWinFunc_CACHE(HWND, SetClipbrdViewer, (HAB hab, HWND hwnd), (hab, hwnd));
323 DeclWinFunc_CACHE(HWND, SetClipbrdOwner, (HAB hab, HWND hwnd), (hab, hwnd));
324 DeclWinFunc_CACHE(ULONG, EnumClipbrdFmts, (HAB hab, ULONG fmt), (hab, fmt));
325 DeclWinFunc_CACHE(ATOM, AddAtom, (HATOMTBL hAtomTbl, PCSZ pszAtomName),
326 (hAtomTbl, pszAtomName));
327 DeclWinFunc_CACHE(ATOM, FindAtom, (HATOMTBL hAtomTbl, PCSZ pszAtomName),
328 (hAtomTbl, pszAtomName));
329 DeclWinFunc_CACHE(ATOM, DeleteAtom, (HATOMTBL hAtomTbl, PCSZ pszAtomName),
330 (hAtomTbl, pszAtomName));
331 DeclWinFunc_CACHE(ULONG, QueryAtomUsage, (HATOMTBL hAtomTbl, ATOM atom),
333 DeclWinFunc_CACHE(ULONG, QueryAtomLength, (HATOMTBL hAtomTbl, ATOM atom),
335 DeclWinFunc_CACHE(ULONG, QueryAtomName,
336 (HATOMTBL hAtomTbl, ATOM atom, PSZ pchBuffer, ULONG cchBufferMax),
337 (hAtomTbl, atom, pchBuffer, cchBufferMax));
338 DeclWinFunc_CACHE(HATOMTBL, QuerySystemAtomTable, (VOID), ());
339 DeclWinFunc_CACHE(HATOMTBL, CreateAtomTable, (ULONG initial, ULONG buckets),
341 DeclWinFunc_CACHE(HATOMTBL, DestroyAtomTable, (HATOMTBL hAtomTbl), (hAtomTbl));
342 DeclWinFunc_CACHE(ULONG, MessageBox, (HWND hwndParent, HWND hwndOwner, PCSZ pszText, PCSZ pszCaption, ULONG idWindow, ULONG flStyle), (hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle));
343 DeclWinFunc_CACHE(ULONG, MessageBox2,
344 (HWND hwndParent, HWND hwndOwner, PCSZ pszText,
345 PCSZ pszCaption, ULONG idWindow, PMB2INFO pmb2info),
346 (hwndParent, hwndOwner, pszText, pszCaption, idWindow, pmb2info));
347 DeclWinFunc_CACHE(HPOINTER, LoadPointer,
348 (HWND hwndDesktop, HMODULE hmod, ULONG idres),
349 (hwndDesktop, hmod, idres));
350 DeclWinFunc_CACHE(HPOINTER, QuerySysPointer,
351 (HWND hwndDesktop, LONG lId, BOOL fCopy),
352 (hwndDesktop, lId, fCopy));
353 DeclWinFunc_CACHE(BOOL, Alarm, (HWND hwndDesktop, ULONG rgfType), (hwndDesktop, rgfType));
354 DeclWinFunc_CACHE(BOOL, FlashWindow, (HWND hwndFrame, BOOL fFlash), (hwndFrame, fFlash));
357 /* These functions do not croak on error */
358 DeclWinFunc_CACHE_survive(BOOL, SetClipbrdData,
359 (HAB hab, ULONG ulData, ULONG fmt, ULONG rgfFmtInfo),
360 (hab, ulData, fmt, rgfFmtInfo));
362 #define get_InvalidateRect InvalidateRect
363 #define get_CreateFrameControls CreateFrameControls
365 /* These functions may return 0 on success; check $^E/Perl_rc on res==0: */
366 DeclWinFunc_CACHE_resetError(PVOID, QueryWindowPtr, (HWND hwnd, LONG index),
368 DeclWinFunc_CACHE_resetError(ULONG, QueryWindowULong, (HWND hwnd, LONG index),
370 DeclWinFunc_CACHE_resetError(SHORT, QueryWindowUShort, (HWND hwnd, LONG index),
372 DeclWinFunc_CACHE_resetError(LONG, QueryWindowTextLength, (HWND hwnd), (hwnd))
373 DeclWinFunc_CACHE_resetError(HWND, QueryActiveWindow, (HWND hwnd), (hwnd))
374 DeclWinFunc_CACHE_resetError(BOOL, PostMsg,
375 (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2),
376 (hwnd, msg, mp1, mp2))
377 DeclWinFunc_CACHE_resetError(HWND, GetNextWindow, (HENUM henum), (henum))
378 DeclWinFunc_CACHE_resetError(BOOL, IsWindowEnabled, (HWND hwnd), (hwnd))
379 DeclWinFunc_CACHE_resetError(BOOL, IsWindowVisible, (HWND hwnd), (hwnd))
380 DeclWinFunc_CACHE_resetError(BOOL, IsWindowShowing, (HWND hwnd), (hwnd))
382 /* No die()ing on error */
383 DeclWinFunc_CACHE_survive(BOOL, IsWindow, (HAB hab, HWND hwnd), (hab, hwnd))
385 /* These functions are called frow complicated wrappers: */
386 ULONG (*pWinQuerySwitchList) (HAB hab, PSWBLOCK pswblk, ULONG usDataLength);
387 ULONG (*pWinChangeSwitchEntry) (HSWITCH hsw, __const__ SWCNTRL *pswctl);
388 HWND (*pWinWindowFromPoint)(HWND hwnd, __const__ POINTL *pptl, BOOL fChildren);
391 /* These functions have different names/signatures than what is
393 #define QueryFocusWindow QueryFocus
394 #define FocusWindow_set(hwndFocus, hwndDesktop) SetFocus(hwndDesktop, hwndFocus)
395 #define WindowPos_set(hwnd, x, y, fl, cx, cy, hwndInsertBehind) \
396 SetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl)
397 #define myWinQueryWindowPtr(hwnd, i) ((ULONG)QueryWindowPtr(hwnd, i))
398 #define _ClipbrdData_set SetClipbrdData
399 #define ClipbrdOwner_set SetClipbrdOwner
400 #define ClipbrdViewer_set SetClipbrdViewer
403 WindowText_set(HWND hwnd, char* text)
405 return !CheckWinError(myWinSetWindowText(hwnd, text));
409 myQueryWindowText(HWND hwnd)
411 LONG l = QueryWindowTextLength(hwnd), len;
416 if (Perl_rc) /* Last error */
420 sv = newSVpvn("", 0);
422 len = QueryWindowText(hwnd, l + 1, SvPV_force(sv, n_a));
425 croak("WinQueryWindowText() uncompatible with WinQueryWindowTextLength()");
432 QueryWindowSWP_(HWND hwnd)
436 if (!QueryWindowPos(hwnd, &swp))
437 croak("WinQueryWindowPos() error");
442 QueryWindowSWP(HWND hwnd)
444 SWP swp = QueryWindowSWP_(hwnd);
446 return newSVpvn((char*)&swp, sizeof(swp));
450 myQueryClassName(HWND hwnd)
452 SV *sv = newSVpvn("",0);
453 STRLEN l = 46, len = 0, n_a;
455 while (l + 1 >= len) {
457 len = 2*len + 10; /* Grow quick */
461 l = QueryClassName(hwnd, len, SvPV_force(sv, n_a));
468 WindowFromPoint(long x, long y, HWND hwnd, BOOL fChildren)
472 ppl.x = x; ppl.y = y;
473 if (!pWinWindowFromPoint)
474 AssignFuncPByORD(pWinWindowFromPoint, ORD_WinWindowFromPoint);
475 return SaveWinError(pWinWindowFromPoint(hwnd, &ppl, fChildren));
479 switch_of(HWND hwnd, PID pid)
483 if (!(_emx_env & 0x200))
484 croak("switch_entry not implemented on DOS"); /* not OS/2. */
485 if (CheckWinError(hSwitch =
486 myWinQuerySwitchHandle(hwnd, pid)))
487 croak_with_os2error("WinQuerySwitchHandle");
493 fill_swentry(SWENTRY *swentryp, HWND hwnd, PID pid)
496 HSWITCH hSwitch = switch_of(hwnd, pid);
498 swentryp->hswitch = hSwitch;
499 if (CheckOSError(myWinQuerySwitchEntry(hSwitch, &swentryp->swctl)))
500 croak_with_os2error("WinQuerySwitchEntry");
504 fill_swentry_default(SWENTRY *swentryp)
506 fill_swentry(swentryp, NULLHANDLE, getpid());
510 myWinQueryActiveDesktopPathname()
512 SV *buf = newSVpv("",0);
515 SvGROW(buf, MAXPATHLEN);
516 QueryActiveDesktopPathname(SvPV(buf,n_a), MAXPATHLEN);
517 SvCUR_set(buf, strlen(SvPV(buf, n_a)));
522 myWinQueryAtomName(ATOM atom, HATOMTBL hAtomTbl)
524 ULONG len = QueryAtomLength(hAtomTbl, atom);
525 SV *sv = newSVpvn("",0);
529 QueryAtomName(hAtomTbl, atom, SvPV(sv, n_a), len);
535 #define myWinQueryClipbrdFmtInfo QueryClipbrdFmtInfo
537 /* Put data into shared memory, then call SetClipbrdData */
539 ClipbrdData_set(SV *sv, int convert_nl, unsigned long fmt, unsigned long rgfFmtInfo, HAB hab)
542 char *buf = SvPV_force(sv, len);
543 char *pByte = 0, *s = buf, c;
548 if (c == '\r' && *s == '\n')
555 if (CheckOSError(DosAllocSharedMem((PPVOID)&pByte, 0, len + nls + 1,
556 PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE | OBJ_GETTABLE)))
557 croak_with_os2error("ClipbrdData_set: DosAllocSharedMem error");
560 memcpy(pByte, buf, len + 1);
562 char *t = pByte, *e = buf + len;
566 if (c == '\n' && (t == pByte + 1 || t[-2] != '\r'))
567 t[-1] = '\r', *t++ = '\n';
571 if (!SetClipbrdData(hab, (ULONG)pByte, fmt, rgfFmtInfo)) {
572 DosFreeMem((PPVOID)&pByte);
573 croak_with_os2error("ClipbrdData_set: WinSetClipbrdData error");
580 myWinMessageBox(HWND hwndParent, HWND hwndOwner, PCSZ pszText, PCSZ pszCaption, ULONG idWindow, ULONG flStyle)
582 ULONG rc = MessageBox(hwndParent, hwndOwner, pszText, pszCaption,
585 if (rc == MBID_ERROR)
587 if (CheckWinError(rc))
588 croak_with_os2error("MessageBox");
593 myWinMessageBox2(HWND hwndParent, HWND hwndOwner, PCSZ pszText,
594 PCSZ pszCaption, ULONG idWindow, PMB2INFO pmb2info)
596 ULONG rc = MessageBox2(hwndParent, hwndOwner, pszText, pszCaption, idWindow, pmb2info);
598 if (rc == MBID_ERROR)
600 if (CheckWinError(rc))
601 croak_with_os2error("MessageBox2");
606 /* static ULONG (* APIENTRY16 pDosSmSetTitle)(ULONG, PSZ); */
607 ULONG _THUNK_FUNCTION(DosSmSetTitle)(ULONG, PSZ);
609 #if 0 /* Does not work. */
610 static ULONG (*pDosSmSetTitle)(ULONG, PSZ);
613 sesmgr_title_set(char *s)
616 static HMODULE hdosc = 0;
620 fill_swentry_default(&swentry);
621 if (!pDosSmSetTitle || !hdosc) {
622 if (CheckOSError(DosLoadModule(buf, sizeof buf, "sesmgr", &hdosc)))
623 croak("Cannot load SESMGR: no `%s'", buf);
624 if (CheckOSError(DosQueryProcAddr(hdosc, 0, "DOSSMSETTITLE",
625 (PFN*)&pDosSmSetTitle)))
626 croak("Cannot load SESMGR.DOSSMSETTITLE, err=%ld", rc);
628 /* (pDosSmSetTitle)(swcntrl.idSession,s); */
630 (_THUNK_PROLOG (2+4);
631 _THUNK_SHORT (swcntrl.idSession);
633 _THUNK_CALLI (*pDosSmSetTitle)));
634 if (CheckOSError(rc))
635 warn("*DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x, *paddr=%x",
636 rc, swcntrl.idSession, &_THUNK_FUNCTION(DosSmSetTitle),
643 sesmgr_title_set(char *s)
648 fill_swentry_default(&swentry);
650 (_THUNK_PROLOG (2+4);
651 _THUNK_SHORT (swentry.swctl.idSession);
653 _THUNK_CALL (DosSmSetTitle)));
655 if (CheckOSError(rc))
656 warn("DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x",
657 rc, swcntrl.idSession, _THUNK_FUNCTION(DosSmSetTitle));
659 return !CheckOSError(rc);
663 #if 0 /* Does not work. */
664 USHORT _THUNK_FUNCTION(Win16SetTitle) ();
674 _THUNK_CALL (Win16SetTitle)));
675 if (CheckWinError(rc))
676 warn("Win16SetTitle: err=%ld", rc);
681 process_swentry(unsigned long pid, HWND hwnd)
685 if (!(_emx_env & 0x200))
686 croak("process_swentry not implemented on DOS"); /* not OS/2. */
687 fill_swentry(&swentry, hwnd, pid);
688 return newSVpvn((char*)&swentry, sizeof(swentry));
697 SV *sv = newSVpvn("",0);
699 if (!(_emx_env & 0x200))
700 croak("swentries_list not implemented on DOS"); /* not OS/2. */
701 if (!pWinQuerySwitchList)
702 AssignFuncPByORD(pWinQuerySwitchList, ORD_WinQuerySwitchList);
703 num = pWinQuerySwitchList(0, NULL, 0); /* HAB is not required */
705 croak("(Unknown) error during WinQuerySwitchList()");
706 /* Allow one extra entry to allow overflow detection (may happen
707 if the list has been changed). */
712 n = 2*num + 10; /* Enlarge quickly */
713 SvGROW(sv, sizeof(ULONG) + sizeof(SWENTRY) * n + 1);
714 pswblk = (PSWBLOCK) SvPV_force(sv, n_a);
715 num = pWinQuerySwitchList(0, pswblk, SvLEN(sv));
717 SvCUR_set(sv, sizeof(ULONG) + sizeof(SWENTRY) * num);
723 swentry( char *title, HWND sw_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
724 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
725 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
729 strncpy(e.swctl.szSwtitle, title, MAXNAMEL);
730 e.swctl.szSwtitle[60] = 0;
731 e.swctl.hwnd = sw_hwnd;
732 e.swctl.hwndIcon = icon_hwnd;
733 e.swctl.hprog = owner_phandle;
734 e.swctl.idProcess = owner_pid;
735 e.swctl.idSession = owner_sid;
736 e.swctl.uchVisibility = ((visible ? SWL_VISIBLE : SWL_INVISIBLE)
737 | (nonswitchable ? SWL_GRAYED : 0));
738 e.swctl.fbJump = (jumpable ? SWL_JUMPABLE : 0);
739 e.swctl.bProgType = ptype;
740 e.hswitch = sw_entry;
745 create_swentry( char *title, HWND owner_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
746 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
747 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
749 SWENTRY e = swentry(title, owner_hwnd, icon_hwnd, owner_phandle, owner_pid,
750 owner_sid, visible, nonswitchable, jumpable, ptype,
753 return newSVpvn((char*)&e, sizeof(e));
757 change_swentrysw(SWENTRY *sw)
759 ULONG rc; /* For CheckOSError */
761 if (!(_emx_env & 0x200))
762 croak("change_entry() not implemented on DOS"); /* not OS/2. */
763 if (!pWinChangeSwitchEntry)
764 AssignFuncPByORD(pWinChangeSwitchEntry, ORD_WinChangeSwitchEntry);
765 return !CheckOSError(pWinChangeSwitchEntry(sw->hswitch, &sw->swctl));
769 change_swentry(SV *sv)
772 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
774 if (l != sizeof(SWENTRY))
775 croak("Wrong structure size %ld!=%ld in change_swentry()", (long)l, (long)sizeof(SWENTRY));
776 return change_swentrysw(pswentry);
780 #define swentry_size() (sizeof(SWENTRY))
783 getscrsize(int *wp, int *hp)
792 /* Force vio to not cross 64K-boundary: */
793 #define VIO_FROM_VIOB \
795 if (!_THUNK_PTR_STRUCT_OK(vio)) \
799 scrsize_set(int w, int h)
801 VIOMODEINFO viob[2], *vio;
808 vio->cb = sizeof(*vio);
809 if (CheckOSError(VioGetMode( vio, 0 )))
813 vio->col = (USHORT)w;
816 vio->row = (USHORT)h;
819 if (CheckOSError(VioSetMode( vio, 0 )))
825 cursor(int *sp, int *ep, int *wp, int *ap)
827 VIOCURSORINFO viob[2], *vio;
832 if (CheckOSError(VioGetCurType( vio, 0 )))
833 croak_with_os2error("VioGetCurType() error");
846 cursor(&s, &e, &w, &a);
854 cursor_set(int s, int e, int w, int a)
856 VIOCURSORINFO viob[2], *vio;
865 return !CheckOSError(VioSetCurType( vio, 0 ));
872 VIOMODEINFO viob[2], *vio;
877 vio->cb = sizeof(*vio);
878 if (CheckOSError(VioGetMode( vio, 0 )))
879 croak_with_os2error("Can't get size of buffer for screen");
880 #if 0 /* buf=323552247, full=1118455, partial=0 */
881 croak("Lengths: buf=%d, full=%d, partial=%d",vio->buf_length,vio->full_length,vio->partial_length);
882 return newSVpvn((char*)vio->buf_addr, vio->full_length);
884 return vio->col * vio->row * 2; /* How to get bytes/cell? 2 or 4? */
894 _kbdChar(unsigned int nowait, int handle)
896 KBDKEYINFO viob[2], *vio;
902 croak("unexpected nowait");
903 if (CheckOSError(nowait == 2
904 ? KbdPeek( vio, handle )
905 : KbdCharIn( vio, nowait == 1, handle )))
906 croak_with_os2error("Can't _kbdChar");
907 return newSVpvn((char*)vio, sizeof(*vio));
911 _kbdStatus(int handle)
913 KBDINFO viob[2], *vio;
918 vio->cb = sizeof(*vio);
919 if (CheckOSError(KbdGetStatus( vio, handle )))
920 croak_with_os2error("Can't _kbdStatus");
921 return newSVpvn((char*)vio, sizeof(*vio));
925 _kbdStatus_set(SV* sv, int handle)
927 KBDINFO viob[2], *vio;
930 char *s = SvPV(sv, l);
934 if (l != sizeof(*vio))
935 croak("unexpected datasize");
936 Copy((KBDINFO*)s, vio, 1, KBDINFO);
937 if (vio->cb != sizeof(*vio))
938 croak("unexpected datasize");
939 if (CheckOSError(KbdSetStatus( vio, handle )))
940 croak_with_os2error("Can't kbdStatus_set()");
944 _vioConfig(int which, int handle)
946 struct {VIOCONFIGINFO i; short a[20];} viob[2], *vio;
952 if (CheckOSError(VioGetConfig( which, &vio->i, handle )))
953 croak_with_os2error("Can't get VIO config size");
954 if (vio->i.cb > sizeof(*vio))
955 vio->i.cb = sizeof(*vio);
956 if (CheckOSError(VioGetConfig( which, &vio->i, handle )))
957 croak_with_os2error("Can't get VIO config");
958 return newSVpvn((char*)vio, vio->i.cb);
964 VIOMODEINFO viob[2], *vio;
969 vio->cb = sizeof(*vio);
970 if (CheckOSError(VioGetMode( vio, 0 )))
971 croak_with_os2error("Can't get VIO mode");
972 return newSVpvn((char*)vio, sizeof(*vio));
978 VIOMODEINFO viob[2], *vio;
981 char *s = SvPV(sv, l);
985 Copy((VIOMODEINFO*)s, vio, 1, VIOMODEINFO);
986 if (vio->cb != sizeof(*vio) || l != vio->cb)
987 croak("unexpected datasize");
988 if (CheckOSError(VioSetMode( vio, 0 )))
989 croak_with_os2error("Can't set VIO mode");
993 vioFont(int type, int *w, int *h) /* 0 for actual RAM font, 1 for ROM font */
995 VIOFONTINFO viob[2], *vio;
1003 /* Should not cross 64K boundaries too: */
1004 if (((ULONG)buf) & 0xFFFF)
1005 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1007 vio->cb = sizeof(*vio);
1008 vio->type = type; /* BIOS or the loaded font. */
1009 vio->cbData = 0xFFFF; /* How large is my buffer? */
1010 vio->pbData = _emx_32to16(buf); /* Wants an 16:16 pointer */
1011 if (CheckOSError(VioGetFont( vio, 0 )))
1012 croak_with_os2error("Can't get VIO font");
1015 return newSVpvn(buf,vio->cbData);
1019 vioFont_set(SV *sv, int cellwidth, int cellheight, int type)
1021 VIOFONTINFO viob[2], *vio;
1026 char *s = SvPV(sv, l);
1030 /* Should not cross 64K boundaries too: */
1031 if (((ULONG)buf) & 0xFFFF)
1032 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1035 croak("length overflow of VIO font");
1036 if (l != (cellwidth + 7)/8 * cellheight * 256)
1037 warn("unexpected length of VIO font");
1038 vio->cb = sizeof(*vio);
1039 vio->type = type; /* BIOS or the loaded font. */
1040 vio->cbData = l; /* How large is my buffer? */
1041 vio->pbData = _emx_32to16(buf); /* Wants an 16:16 pointer */
1042 vio->cxCell = cellwidth;
1043 vio->cyCell = cellheight;
1044 Copy(s, buf, l, char);
1046 if (CheckOSError(VioSetFont( vio, 0 )))
1047 croak_with_os2error("Can't set VIO font");
1051 uses use32,os2def,os2base,crt,defs;
1053 const Pal :VioPalState=(Cb:sizeof(VioPalState);rType:0;iFirst:0;
1054 Acolor:($FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF));
1055 CReg:VioColorReg=(Cb:sizeof(VioColorReg);rType:3;FirstColorReg:0;
1056 NumColorRegs:256; ColorRegAddr:@Plt);
1060 Pal.Acolor[09]:=$0F;
1062 Pal.Acolor[13]:=$2F;
1063 VioSetState(Pal,0); // ce smena EGA registrov
1069 CReg.ColorRegAddr:=ii;
1070 VioGetState(CReg,0);
1074 VioSetState(CReg,0); // a ce - VGA registrov
1080 struct { VIOPALSTATE pal; USHORT a[15]; } pal_padded;
1081 VIOOVERSCAN overscan;
1082 VIOINTENSITY intensity;
1083 VIOCOLORREG colorreg;
1084 struct { VIOCOLORREG reg; char rgb[3*256]; } colorreg_padded;
1085 VIOSETULINELOC lineloc;
1086 VIOSETTARGET target;
1090 vio_state_size(int what)
1092 static const char sizes[] = {
1093 sizeof(VIOPALSTATE),
1094 sizeof(VIOOVERSCAN),
1095 sizeof(VIOINTENSITY),
1096 sizeof(VIOCOLORREG),
1097 6, /* Random number: Reserved entry */
1098 sizeof(VIOSETULINELOC),
1099 sizeof(VIOSETTARGET)
1101 if (what < 0 || what >= sizeof(sizes))
1102 croak("Unexpected VIO state type");
1107 _vioState(int what, int first, int count)
1109 my_VIOSTATE viob[2], *vio;
1110 ULONG rc, size = vio_state_size(what);
1115 vio->pal.type = what;
1117 vio->pal.iFirst = first;
1118 if (first < 0 || first >= 16)
1119 croak("unexpected palette start value");
1120 if (count < 0 || count > 16)
1121 croak("unexpected palette count");
1122 vio->pal.cb = (size += (count - 1) * sizeof(short));
1123 } else if (what == 3) {
1124 /* Wants an 16:16 pointer */
1125 if (count < 0 || count > 256)
1126 croak("unexpected palette count");
1127 vio->colorreg.colorregaddr = (PCH)_emx_32to16(vio->colorreg_padded.rgb);
1128 vio->colorreg.numcolorregs = count; /* 256 is max */
1129 vio->colorreg.firstcolorreg = first;
1132 if (CheckOSError(VioGetState( (void*)vio, 0 )))
1133 croak_with_os2error("Can't get VIO state");
1134 return newSVpvn((char*)vio, size);
1138 _vioState_set(SV *sv)
1140 my_VIOSTATE viob[2], *ovio = (my_VIOSTATE*)SvPV_nolen(sv), *vio = ovio;
1141 int what = ovio->pal.type, cb = ovio->pal.cb;
1142 ULONG rc, size = vio_state_size(what);
1144 char *s = SvPV(sv, l);
1150 if ( cb < size || cb > size + 15*sizeof(SHORT) || l != cb)
1151 croak("unexpected datasize");
1155 if (l != cb + 3 * ovio->colorreg.numcolorregs || cb != size)
1156 croak("unexpected datasize");
1160 if (l != cb || l != size )
1161 croak("unexpected datasize");
1164 Copy(s, (char*)vio, size, char);
1165 if (what == 3) /* We expect colors put after VIOCOLORREG */
1166 vio->colorreg.colorregaddr = (PCH)_emx_32to16(vio->colorreg_padded.rgb);
1168 if (CheckOSError(VioSetState( (void*)vio, 0 )))
1169 croak_with_os2error("Can't set VIO state");
1176 USHORT bufl = bufsize();
1177 char b[(1<<16) * 3]; /* This/3 is enough for 16-bit calls, we need
1178 2x overhead due to 2 vs 4 issue, and extra
1179 64K due to alignment logic */
1182 if (((ULONG)buf) & 0xFFFF)
1183 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1184 if ((sizeof(b) - (buf - b)) < 2*bufl)
1185 croak("panic: VIO buffer allocation");
1186 if (CheckOSError(VioReadCellStr( buf, &bufl, 0, 0, 0 )))
1187 return &PL_sv_undef;
1188 return newSVpvn(buf,bufl);
1195 STRLEN l = SvCUR(sv), bufl = bufsize();
1196 char b[(1<<16) * 2]; /* This/2 is enough for 16-bit calls, we need
1197 extra 64K due to alignment logic */
1200 if (((ULONG)buf) & 0xFFFF)
1201 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1202 if (!SvPOK(sv) || ((l != bufl) && (l != 2*bufl)))
1203 croak("Wrong size %d of saved screen data", SvCUR(sv));
1204 if ((sizeof(b) - (buf - b)) < l)
1205 croak("panic: VIO buffer allocation");
1206 Copy(SvPV(sv,l), buf, bufl, char);
1207 if (CheckOSError(VioWrtCellStr( buf, bufl, 0, 0, 0 )))
1215 ULONG cps[4], cp, rc;
1217 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &cp )))
1218 croak_with_os2error("DosQueryCp()");
1227 if (CheckOSError(VioGetCp( 0, &cp, 0 )))
1228 croak_with_os2error("VioGetCp()");
1233 out_codepage_set(int cp)
1237 return !(CheckOSError(VioSetCp( 0, cp, 0 )));
1245 if (CheckOSError(KbdGetCp( 0, &cp, 0 )))
1246 croak_with_os2error("KbdGetCp()");
1251 in_codepage_set(int cp)
1255 return !(CheckOSError(KbdSetCp( 0, cp, 0 )));
1259 process_codepage_set(int cp)
1263 return !(CheckOSError(DosSetProcessCp( cp )));
1274 psi = get_sysinfo(pid, QSS_PROCESS);
1277 ppid = psi->procdata->ppid;
1290 psi = get_sysinfo(pid, QSS_PROCESS);
1293 sid = psi->procdata->sessid;
1298 #define ulMPFROMSHORT(i) ((unsigned long)MPFROMSHORT(i))
1299 #define ulMPVOID() ((unsigned long)MPVOID)
1300 #define ulMPFROMCHAR(i) ((unsigned long)MPFROMCHAR(i))
1301 #define ulMPFROM2SHORT(x1,x2) ((unsigned long)MPFROM2SHORT(x1,x2))
1302 #define ulMPFROMSH2CH(s, c1, c2) ((unsigned long)MPFROMSH2CH(s, c1, c2))
1303 #define ulMPFROMLONG(x) ((unsigned long)MPFROMLONG(x))
1305 #define _MessageBox MessageBox
1306 #define _MessageBox2 MessageBox2
1308 MODULE = OS2::Process PACKAGE = OS2::Process
1325 swentry_expand( SV *sv )
1329 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
1331 if (l != sizeof(SWENTRY))
1332 croak("Wrong structure size %ld!=%ld in swentry_expand()", (long)l, (long)sizeof(SWENTRY));
1334 PUSHs(sv_2mortal(newSVpv(pswentry->swctl.szSwtitle, 0)));
1335 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwnd)));
1336 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwndIcon)));
1337 PUSHs(sv_2mortal(newSViv(pswentry->swctl.hprog)));
1338 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idProcess)));
1339 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idSession)));
1340 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_VISIBLE)));
1341 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_GRAYED)));
1342 PUSHs(sv_2mortal(newSViv(pswentry->swctl.fbJump == SWL_JUMPABLE)));
1343 PUSHs(sv_2mortal(newSViv(pswentry->swctl.bProgType)));
1344 PUSHs(sv_2mortal(newSViv(pswentry->hswitch)));
1348 create_swentry( char *title, unsigned long sw_hwnd, unsigned long icon_hwnd, unsigned long owner_phandle, unsigned long owner_pid, unsigned long owner_sid, unsigned long visible, unsigned long switchable, unsigned long jumpable, unsigned long ptype, unsigned long sw_entry)
1352 change_swentry( SV *sv )
1359 process_swentry(unsigned long pid = getpid(), HWND hwnd = NULLHANDLE);
1372 WindowText_set(HWND hwndFrame, char *title)
1375 FocusWindow_set(HWND hwndFocus, HWND hwndDesktop = HWND_DESKTOP)
1378 ShowWindow(HWND hwnd, bool fShow = TRUE)
1381 EnableWindow(HWND hwnd, bool fEnable = TRUE)
1384 PostMsg(HWND hwnd, unsigned long msg, unsigned long mp1 = 0, unsigned long mp2 = 0)
1385 C_ARGS: hwnd, msg, (MPARAM)mp1, (MPARAM)mp2
1388 WindowPos_set(HWND hwnd, long x, long y, unsigned long fl = SWP_MOVE, long cx = 0, long cy = 0, HWND hwndInsertBehind = HWND_TOP)
1392 BeginEnumWindows(HWND hwnd)
1395 EndEnumWindows(unsigned long henum)
1398 GetNextWindow(unsigned long henum)
1401 IsWindowVisible(HWND hwnd)
1404 IsWindowEnabled(HWND hwnd)
1407 IsWindowShowing(HWND hwnd)
1410 QueryWindow(HWND hwnd, long cmd)
1413 IsChild(HWND hwnd, HWND hwndParent)
1416 WindowFromId(HWND hwndParent, unsigned long id)
1419 WindowFromPoint(long x, long y, HWND hwnd = HWND_DESKTOP, bool fChildren = TRUE)
1423 EnumDlgItem(HWND hwndDlg, unsigned long code, HWND hwnd = NULLHANDLE)
1424 C_ARGS: hwndDlg, hwnd, code
1427 EnableWindowUpdate(HWND hwnd, bool fEnable = TRUE)
1430 SetWindowBits(HWND hwnd, long index, unsigned long flData, unsigned long flMask)
1433 SetWindowPtr(HWND hwnd, long index, unsigned long p)
1434 C_ARGS: hwnd, index, (PVOID)p
1437 SetWindowULong(HWND hwnd, long index, unsigned long i)
1440 SetWindowUShort(HWND hwnd, long index, unsigned short i)
1443 IsWindow(HWND hwnd, HAB hab = Acquire_hab())
1447 ActiveWindow_set(HWND hwnd, HWND hwndDesktop = HWND_DESKTOP)
1449 RETVAL = SetActiveWindow(hwndDesktop, hwnd);
1452 LoadPointer(unsigned long idres, unsigned long hmod = 0, HWND hwndDesktop = HWND_DESKTOP)
1453 C_ARGS: hwndDesktop, hmod, idres
1459 out_codepage_set(int cp)
1465 in_codepage_set(int cp)
1477 ULONG cps[4], c, i = 0, rc;
1479 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &c )))
1485 PUSHs(sv_2mortal(newSViv(cps[i++])));
1489 process_codepage_set(int cp)
1492 cursor(OUTLIST int stp, OUTLIST int ep, OUTLIST int wp, OUTLIST int ap)
1496 cursor_set(int s, int e, int w = cursor__(0), int a = cursor__(1))
1499 _kbdChar(int nowait = 0, int handle = 0)
1502 _kbdStatus(int handle = 0)
1505 _kbdStatus_set(SV *sv, int handle = 0)
1508 _vioConfig(int which = 0, int handle = 0)
1514 _vioMode_set(SV *buffer)
1517 _vioState(int what, int first = -1, int count = -1)
1520 _vioState_set(SV *buffer)
1523 vioFont( int type = 0, OUTLIST int w, OUTLIST int h)
1526 vioFont_set(SV *buffer, int cellwidth, int cellheight, int type = 0)
1529 _ClipbrdData_set(unsigned long ulData, unsigned long fmt = CF_TEXT, unsigned long rgfFmtInfo = ((fmt == CF_TEXT || fmt == CF_DSPTEXT) ? CFI_POINTER : CFI_HANDLE), HAB hab = perl_hab_GET())
1531 C_ARGS: hab, ulData, fmt, rgfFmtInfo
1533 if (CheckWinError(RETVAL))
1534 croak_with_os2error("_ClipbrdData_set() error");
1537 ClipbrdData_set(SV *text, int convert_nl = 1, unsigned long fmt = CF_TEXT, unsigned long rgfFmtInfo = ((fmt == CF_TEXT || fmt == CF_DSPTEXT) ? CFI_POINTER : CFI_HANDLE), HAB hab = perl_hab_GET())
1541 ClipbrdOwner_set(HWND hwnd, HAB hab = perl_hab_GET())
1545 ClipbrdViewer_set(HWND hwnd, HAB hab = perl_hab_GET())
1549 EnumClipbrdFmts(unsigned long fmt = 0, HAB hab = perl_hab_GET())
1553 AddAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1554 C_ARGS: hAtomTbl, pszAtomName
1557 FindAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1558 C_ARGS: hAtomTbl, pszAtomName
1561 DeleteAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1562 C_ARGS: hAtomTbl, pszAtomName
1565 Alarm(unsigned long rgfType = WA_ERROR, HWND hwndDesktop = HWND_DESKTOP)
1566 C_ARGS: hwndDesktop, rgfType
1569 FlashWindow(HWND hwndFrame, bool fFlash)
1571 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myQuery
1574 myQueryWindowText(HWND hwnd)
1577 myQueryClassName(HWND hwnd)
1579 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = Query
1582 QueryFocusWindow(HWND hwndDesktop = HWND_DESKTOP)
1585 QueryWindowTextLength(HWND hwnd)
1588 QueryWindowSWP(HWND hwnd)
1591 QueryWindowULong(HWND hwnd, long index)
1594 QueryWindowUShort(HWND hwnd, long index)
1597 QueryActiveWindow(HWND hwnd = HWND_DESKTOP)
1600 QueryDesktopWindow(HAB hab = Acquire_hab(), unsigned long hdc = NULLHANDLE)
1603 QueryClipbrdData(unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET())
1608 QueryClipbrdViewer(HAB hab = perl_hab_GET())
1611 QueryClipbrdOwner(HAB hab = perl_hab_GET())
1614 CloseClipbrd(HAB hab = perl_hab_GET())
1617 EmptyClipbrd(HAB hab = perl_hab_GET())
1620 OpenClipbrd(HAB hab = perl_hab_GET())
1623 QueryAtomUsage(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1624 C_ARGS: hAtomTbl, atom
1627 QueryAtomLength(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1628 C_ARGS: hAtomTbl, atom
1631 QuerySystemAtomTable()
1634 QuerySysPointer(long lId, bool fCopy = 1, HWND hwndDesktop = HWND_DESKTOP)
1635 C_ARGS: hwndDesktop, lId, fCopy
1638 CreateAtomTable(unsigned long initial = 0, unsigned long buckets = 0)
1641 DestroyAtomTable(HATOMTBL hAtomTbl)
1644 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
1647 myWinQueryWindowPtr(HWND hwnd, long index)
1650 myWinQueryWindowProcess(HWND hwnd, OUTLIST unsigned long pid, OUTLIST unsigned long tid)
1653 if (CheckWinError(RETVAL))
1654 croak_with_os2error("WindowProcess() error");
1657 myWinQueryActiveDesktopPathname()
1660 myWinQueryClipbrdFmtInfo(OUTLIST unsigned long prgfFmtInfo, unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET())
1661 C_ARGS: hab, fmt, &prgfFmtInfo
1664 myWinQueryAtomName(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1666 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWin
1669 myWinSwitchToProgram(HSWITCH hsw = switch_of(NULLHANDLE, getpid()))
1676 myWinMessageBox(unsigned long pszText, char* pszCaption = "Perl script error", unsigned long flStyle = MB_CANCEL | MB_ICONHAND, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = HWND_DESKTOP, unsigned long idWindow = 0)
1677 C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle
1682 _MessageBox(char* pszText, char* pszCaption = "Perl script error", unsigned long flStyle = MB_CANCEL | MB_INFORMATION | MB_MOVEABLE, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0)
1683 C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle
1685 if (RETVAL == MBID_ERROR)
1689 _MessageBox2(char *pszText, char* pmb2info, char *pszCaption, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0)
1690 C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, (PMB2INFO)pmb2info
1692 if (RETVAL == MBID_ERROR)
1695 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
1697 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = get
1703 ppidOf(int pid = getpid())
1706 sidOf(int pid = getpid())
1709 getscrsize(OUTLIST int wp, OUTLIST int hp)
1713 scrsize_set(int w_or_h, int h = -9999)
1716 get_InvalidateRect(HWND hwnd, char *prcl, bool fIncludeChildren)
1719 get_CreateFrameControls(HWND hwndFrame, char *pfcdata, char* pszTitle)
1721 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = ul
1724 ulMPFROMSHORT(unsigned short i)
1730 ulMPFROMCHAR(unsigned char i)
1733 ulMPFROM2SHORT(unsigned short x1, unsigned short x2)
1737 ulMPFROMSH2CH(unsigned short s, unsigned char c1, unsigned char c2)
1741 ulMPFROMLONG(unsigned long x)