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(BOOL, QueryClipbrdFmtInfo, (HAB hab, ULONG fmt, PULONG prgfFmtInfo), (hab, fmt, prgfFmtInfo));
319 DeclWinFunc_CACHE(ULONG, QueryClipbrdData, (HAB hab, ULONG fmt), (hab, fmt));
320 DeclWinFunc_CACHE(HWND, SetClipbrdViewer, (HAB hab, HWND hwnd), (hab, hwnd));
321 DeclWinFunc_CACHE(HWND, SetClipbrdOwner, (HAB hab, HWND hwnd), (hab, hwnd));
322 DeclWinFunc_CACHE(ULONG, EnumClipbrdFmts, (HAB hab, ULONG fmt), (hab, fmt));
323 DeclWinFunc_CACHE(ATOM, AddAtom, (HATOMTBL hAtomTbl, PCSZ pszAtomName),
324 (hAtomTbl, pszAtomName));
325 DeclWinFunc_CACHE(ULONG, QueryAtomUsage, (HATOMTBL hAtomTbl, ATOM atom),
327 DeclWinFunc_CACHE(ULONG, QueryAtomLength, (HATOMTBL hAtomTbl, ATOM atom),
329 DeclWinFunc_CACHE(ULONG, QueryAtomName,
330 (HATOMTBL hAtomTbl, ATOM atom, PSZ pchBuffer, ULONG cchBufferMax),
331 (hAtomTbl, atom, pchBuffer, cchBufferMax));
332 DeclWinFunc_CACHE(HATOMTBL, QuerySystemAtomTable, (VOID), ());
333 DeclWinFunc_CACHE(HATOMTBL, CreateAtomTable, (ULONG initial, ULONG buckets),
335 DeclWinFunc_CACHE(ULONG, MessageBox, (HWND hwndParent, HWND hwndOwner, PCSZ pszText, PCSZ pszCaption, ULONG idWindow, ULONG flStyle), (hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle));
336 DeclWinFunc_CACHE(ULONG, MessageBox2,
337 (HWND hwndParent, HWND hwndOwner, PCSZ pszText,
338 PCSZ pszCaption, ULONG idWindow, PMB2INFO pmb2info),
339 (hwndParent, hwndOwner, pszText, pszCaption, idWindow, pmb2info));
340 DeclWinFunc_CACHE(HPOINTER, LoadPointer,
341 (HWND hwndDesktop, HMODULE hmod, ULONG idres),
342 (hwndDesktop, hmod, idres));
343 DeclWinFunc_CACHE(HPOINTER, QuerySysPointer,
344 (HWND hwndDesktop, LONG lId, BOOL fCopy),
345 (hwndDesktop, lId, fCopy));
346 DeclWinFunc_CACHE(BOOL, Alarm, (HWND hwndDesktop, ULONG rgfType), (hwndDesktop, rgfType));
347 DeclWinFunc_CACHE(BOOL, FlashWindow, (HWND hwndFrame, BOOL fFlash), (hwndFrame, fFlash));
349 #if 0 /* Need to have the entry points described in the parent */
350 DeclWinFunc_CACHE(BOOL, QueryClassInfo, (HAB hab, char* pszClassName, PCLASSINFO pClassInfo), (hab, pszClassName, pClassInfo));
352 #define _QueryClassInfo(hab, pszClassName, pClassInfo) \
353 QueryClassInfo(hab, pszClassName, (PCLASSINFO)pClassInfo)
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))
381 DeclWinFunc_CACHE_resetError(ATOM, FindAtom, (HATOMTBL hAtomTbl, PCSZ pszAtomName),
382 (hAtomTbl, pszAtomName));
383 DeclWinFunc_CACHE_resetError(ATOM, DeleteAtom, (HATOMTBL hAtomTbl, ATOM atom),
385 DeclWinFunc_CACHE_resetError(HATOMTBL, DestroyAtomTable, (HATOMTBL hAtomTbl), (hAtomTbl));
386 DeclWinFunc_CACHE_resetError(HWND, QueryClipbrdViewer, (HAB hab), (hab));
387 DeclWinFunc_CACHE_resetError(HWND, QueryClipbrdOwner, (HAB hab), (hab));
389 #define _DeleteAtom DeleteAtom
390 #define _DestroyAtomTable DestroyAtomTable
392 /* No die()ing on error */
393 DeclWinFunc_CACHE_survive(BOOL, IsWindow, (HAB hab, HWND hwnd), (hab, hwnd))
395 /* These functions are called frow complicated wrappers: */
396 ULONG (*pWinQuerySwitchList) (HAB hab, PSWBLOCK pswblk, ULONG usDataLength);
397 ULONG (*pWinChangeSwitchEntry) (HSWITCH hsw, __const__ SWCNTRL *pswctl);
398 HWND (*pWinWindowFromPoint)(HWND hwnd, __const__ POINTL *pptl, BOOL fChildren);
401 /* These functions have different names/signatures than what is
403 #define QueryFocusWindow QueryFocus
404 #define FocusWindow_set(hwndFocus, hwndDesktop) SetFocus(hwndDesktop, hwndFocus)
405 #define WindowPos_set(hwnd, x, y, fl, cx, cy, hwndInsertBehind) \
406 SetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl)
407 #define myWinQueryWindowPtr(hwnd, i) ((ULONG)QueryWindowPtr(hwnd, i))
408 #define _ClipbrdData_set SetClipbrdData
409 #define ClipbrdOwner_set SetClipbrdOwner
410 #define ClipbrdViewer_set SetClipbrdViewer
413 WindowText_set(HWND hwnd, char* text)
415 return !CheckWinError(myWinSetWindowText(hwnd, text));
419 myQueryWindowText(HWND hwnd)
421 LONG l = QueryWindowTextLength(hwnd), len;
426 if (Perl_rc) /* Last error */
430 sv = newSVpvn("", 0);
432 len = QueryWindowText(hwnd, l + 1, SvPV_force(sv, n_a));
435 croak("WinQueryWindowText() uncompatible with WinQueryWindowTextLength()");
442 QueryWindowSWP_(HWND hwnd)
446 if (!QueryWindowPos(hwnd, &swp))
447 croak("WinQueryWindowPos() error");
452 QueryWindowSWP(HWND hwnd)
454 SWP swp = QueryWindowSWP_(hwnd);
456 return newSVpvn((char*)&swp, sizeof(swp));
460 myQueryClassName(HWND hwnd)
462 SV *sv = newSVpvn("",0);
463 STRLEN l = 46, len = 0, n_a;
465 while (l + 1 >= len) {
467 len = 2*len + 10; /* Grow quick */
471 l = QueryClassName(hwnd, len, SvPV_force(sv, n_a));
478 WindowFromPoint(long x, long y, HWND hwnd, BOOL fChildren)
482 ppl.x = x; ppl.y = y;
483 if (!pWinWindowFromPoint)
484 AssignFuncPByORD(pWinWindowFromPoint, ORD_WinWindowFromPoint);
485 return SaveWinError(pWinWindowFromPoint(hwnd, &ppl, fChildren));
489 switch_of(HWND hwnd, PID pid)
493 if (!(_emx_env & 0x200))
494 croak("switch_entry not implemented on DOS"); /* not OS/2. */
495 if (CheckWinError(hSwitch =
496 myWinQuerySwitchHandle(hwnd, pid)))
497 croak_with_os2error("WinQuerySwitchHandle");
503 fill_swentry(SWENTRY *swentryp, HWND hwnd, PID pid)
506 HSWITCH hSwitch = switch_of(hwnd, pid);
508 swentryp->hswitch = hSwitch;
509 if (CheckOSError(myWinQuerySwitchEntry(hSwitch, &swentryp->swctl)))
510 croak_with_os2error("WinQuerySwitchEntry");
514 fill_swentry_default(SWENTRY *swentryp)
516 fill_swentry(swentryp, NULLHANDLE, getpid());
520 myWinQueryActiveDesktopPathname()
522 SV *buf = newSVpv("",0);
525 SvGROW(buf, MAXPATHLEN);
526 QueryActiveDesktopPathname(SvPV(buf,n_a), MAXPATHLEN);
527 SvCUR_set(buf, strlen(SvPV(buf, n_a)));
532 myWinQueryAtomName(ATOM atom, HATOMTBL hAtomTbl)
534 ULONG len = QueryAtomLength(hAtomTbl, atom);
536 if (len) { /* Probably always so... */
537 SV *sv = newSVpvn("",0);
541 len = QueryAtomName(hAtomTbl, atom, SvPV(sv, n_a), len + 1);
542 if (len) { /* Probably always so... */
552 #define myWinQueryClipbrdFmtInfo QueryClipbrdFmtInfo
554 /* Put data into shared memory, then call SetClipbrdData */
556 ClipbrdData_set(SV *sv, int convert_nl, unsigned long fmt, unsigned long rgfFmtInfo, HAB hab)
560 char *pByte = 0, *s, c;
561 ULONG nls = 0, rc, handle;
563 if (rgfFmtInfo & CFI_POINTER) {
564 s = buf = SvPV_force(sv, len);
567 if (c == '\r' && *s == '\n')
574 if (CheckOSError(DosAllocSharedMem((PPVOID)&pByte, 0, len + nls + 1,
575 PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE | OBJ_GETTABLE)))
576 croak_with_os2error("ClipbrdData_set: DosAllocSharedMem error");
579 memcpy(pByte, buf, len + 1);
581 char *t = pByte, *e = buf + len;
585 if (c == '\n' && (t == pByte + 1 || t[-2] != '\r'))
586 t[-1] = '\r', *t++ = '\n';
589 handle = (ULONG)pByte;
591 handle = (ULONG)SvUV(sv);
594 if (!SetClipbrdData(hab, handle, fmt, rgfFmtInfo)) {
595 if (fmt & CFI_POINTER)
596 DosFreeMem((PPVOID)&pByte);
597 croak_with_os2error("ClipbrdData_set: WinSetClipbrdData error");
602 QueryMemoryRegionSize(ULONG addr, ULONG *flagp, ULONG len, I32 interrupt)
604 ULONG l, f; /* Modifiable copy */
609 rc = DosQueryMem((void *)addr, &l, &f);
610 } while ( interrupt ? 0 : rc == ERROR_INTERRUPT );
612 /* We assume this is not about addr */
614 if (rc == ERROR_INVALID_ADDRESS)
617 os2cp_croak(rc,"QueryMemoryRegionSize");
624 default_fmtInfo(ULONG fmt)
627 case CF_PALETTE: /* Actually, fmtInfo not documented for palette... */
641 myWinMessageBox(HWND hwndParent, HWND hwndOwner, PCSZ pszText, PCSZ pszCaption, ULONG idWindow, ULONG flStyle)
643 ULONG rc = MessageBox(hwndParent, hwndOwner, pszText, pszCaption,
646 if (rc == MBID_ERROR)
648 if (CheckWinError(rc))
649 croak_with_os2error("MessageBox");
654 myWinMessageBox2(HWND hwndParent, HWND hwndOwner, PCSZ pszText,
655 PCSZ pszCaption, ULONG idWindow, PMB2INFO pmb2info)
657 ULONG rc = MessageBox2(hwndParent, hwndOwner, pszText, pszCaption, idWindow, pmb2info);
659 if (rc == MBID_ERROR)
661 if (CheckWinError(rc))
662 croak_with_os2error("MessageBox2");
667 /* static ULONG (* APIENTRY16 pDosSmSetTitle)(ULONG, PSZ); */
668 ULONG _THUNK_FUNCTION(DosSmSetTitle)(ULONG, PSZ);
670 #if 0 /* Does not work. */
671 static ULONG (*pDosSmSetTitle)(ULONG, PSZ);
674 sesmgr_title_set(char *s)
677 static HMODULE hdosc = 0;
681 fill_swentry_default(&swentry);
682 if (!pDosSmSetTitle || !hdosc) {
683 if (CheckOSError(DosLoadModule(buf, sizeof buf, "sesmgr", &hdosc)))
684 croak("Cannot load SESMGR: no `%s'", buf);
685 if (CheckOSError(DosQueryProcAddr(hdosc, 0, "DOSSMSETTITLE",
686 (PFN*)&pDosSmSetTitle)))
687 croak("Cannot load SESMGR.DOSSMSETTITLE, err=%ld", rc);
689 /* (pDosSmSetTitle)(swcntrl.idSession,s); */
691 (_THUNK_PROLOG (2+4);
692 _THUNK_SHORT (swcntrl.idSession);
694 _THUNK_CALLI (*pDosSmSetTitle)));
695 if (CheckOSError(rc))
696 warn("*DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x, *paddr=%x",
697 rc, swcntrl.idSession, &_THUNK_FUNCTION(DosSmSetTitle),
704 sesmgr_title_set(char *s)
709 fill_swentry_default(&swentry);
711 (_THUNK_PROLOG (2+4);
712 _THUNK_SHORT (swentry.swctl.idSession);
714 _THUNK_CALL (DosSmSetTitle)));
716 if (CheckOSError(rc))
717 warn("DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x",
718 rc, swcntrl.idSession, _THUNK_FUNCTION(DosSmSetTitle));
720 return !CheckOSError(rc);
724 #if 0 /* Does not work. */
725 USHORT _THUNK_FUNCTION(Win16SetTitle) ();
735 _THUNK_CALL (Win16SetTitle)));
736 if (CheckWinError(rc))
737 warn("Win16SetTitle: err=%ld", rc);
742 process_swentry(unsigned long pid, HWND hwnd)
746 if (!(_emx_env & 0x200))
747 croak("process_swentry not implemented on DOS"); /* not OS/2. */
748 fill_swentry(&swentry, hwnd, pid);
749 return newSVpvn((char*)&swentry, sizeof(swentry));
758 SV *sv = newSVpvn("",0);
760 if (!(_emx_env & 0x200))
761 croak("swentries_list not implemented on DOS"); /* not OS/2. */
762 if (!pWinQuerySwitchList)
763 AssignFuncPByORD(pWinQuerySwitchList, ORD_WinQuerySwitchList);
764 num = pWinQuerySwitchList(0, NULL, 0); /* HAB is not required */
766 croak("(Unknown) error during WinQuerySwitchList()");
767 /* Allow one extra entry to allow overflow detection (may happen
768 if the list has been changed). */
773 n = 2*num + 10; /* Enlarge quickly */
774 SvGROW(sv, sizeof(ULONG) + sizeof(SWENTRY) * n + 1);
775 pswblk = (PSWBLOCK) SvPV_force(sv, n_a);
776 num = pWinQuerySwitchList(0, pswblk, SvLEN(sv));
778 SvCUR_set(sv, sizeof(ULONG) + sizeof(SWENTRY) * num);
784 swentry( char *title, HWND sw_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
785 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
786 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
790 strncpy(e.swctl.szSwtitle, title, MAXNAMEL);
791 e.swctl.szSwtitle[60] = 0;
792 e.swctl.hwnd = sw_hwnd;
793 e.swctl.hwndIcon = icon_hwnd;
794 e.swctl.hprog = owner_phandle;
795 e.swctl.idProcess = owner_pid;
796 e.swctl.idSession = owner_sid;
797 e.swctl.uchVisibility = ((visible ? SWL_VISIBLE : SWL_INVISIBLE)
798 | (nonswitchable ? SWL_GRAYED : 0));
799 e.swctl.fbJump = (jumpable ? SWL_JUMPABLE : 0);
800 e.swctl.bProgType = ptype;
801 e.hswitch = sw_entry;
806 create_swentry( char *title, HWND owner_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
807 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
808 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
810 SWENTRY e = swentry(title, owner_hwnd, icon_hwnd, owner_phandle, owner_pid,
811 owner_sid, visible, nonswitchable, jumpable, ptype,
814 return newSVpvn((char*)&e, sizeof(e));
818 change_swentrysw(SWENTRY *sw)
820 ULONG rc; /* For CheckOSError */
822 if (!(_emx_env & 0x200))
823 croak("change_entry() not implemented on DOS"); /* not OS/2. */
824 if (!pWinChangeSwitchEntry)
825 AssignFuncPByORD(pWinChangeSwitchEntry, ORD_WinChangeSwitchEntry);
826 return !CheckOSError(pWinChangeSwitchEntry(sw->hswitch, &sw->swctl));
830 change_swentry(SV *sv)
833 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
835 if (l != sizeof(SWENTRY))
836 croak("Wrong structure size %ld!=%ld in change_swentry()", (long)l, (long)sizeof(SWENTRY));
837 return change_swentrysw(pswentry);
841 #define swentry_size() (sizeof(SWENTRY))
844 getscrsize(int *wp, int *hp)
853 /* Force vio to not cross 64K-boundary: */
854 #define VIO_FROM_VIOB \
856 if (!_THUNK_PTR_STRUCT_OK(vio)) \
860 scrsize_set(int w, int h)
862 VIOMODEINFO viob[2], *vio;
869 vio->cb = sizeof(*vio);
870 if (CheckOSError(VioGetMode( vio, 0 )))
874 vio->col = (USHORT)w;
877 vio->row = (USHORT)h;
880 if (CheckOSError(VioSetMode( vio, 0 )))
886 cursor(int *sp, int *ep, int *wp, int *ap)
888 VIOCURSORINFO viob[2], *vio;
893 if (CheckOSError(VioGetCurType( vio, 0 )))
894 croak_with_os2error("VioGetCurType() error");
907 cursor(&s, &e, &w, &a);
915 cursor_set(int s, int e, int w, int a)
917 VIOCURSORINFO viob[2], *vio;
926 return !CheckOSError(VioSetCurType( vio, 0 ));
933 VIOMODEINFO viob[2], *vio;
938 vio->cb = sizeof(*vio);
939 if (CheckOSError(VioGetMode( vio, 0 )))
940 croak_with_os2error("Can't get size of buffer for screen");
941 #if 0 /* buf=323552247, full=1118455, partial=0 */
942 croak("Lengths: buf=%d, full=%d, partial=%d",vio->buf_length,vio->full_length,vio->partial_length);
943 return newSVpvn((char*)vio->buf_addr, vio->full_length);
945 return vio->col * vio->row * 2; /* How to get bytes/cell? 2 or 4? */
955 _kbdChar(unsigned int nowait, int handle)
957 KBDKEYINFO viob[2], *vio;
963 croak("unexpected nowait");
964 if (CheckOSError(nowait == 2
965 ? KbdPeek( vio, handle )
966 : KbdCharIn( vio, nowait == 1, handle )))
967 croak_with_os2error("Can't _kbdChar");
968 return newSVpvn((char*)vio, sizeof(*vio));
972 _kbdStatus(int handle)
974 KBDINFO viob[2], *vio;
979 vio->cb = sizeof(*vio);
980 if (CheckOSError(KbdGetStatus( vio, handle )))
981 croak_with_os2error("Can't _kbdStatus");
982 return newSVpvn((char*)vio, sizeof(*vio));
986 _kbdStatus_set(SV* sv, int handle)
988 KBDINFO viob[2], *vio;
991 char *s = SvPV(sv, l);
995 if (l != sizeof(*vio))
996 croak("unexpected datasize");
997 Copy((KBDINFO*)s, vio, 1, KBDINFO);
998 if (vio->cb != sizeof(*vio))
999 croak("unexpected datasize");
1000 if (CheckOSError(KbdSetStatus( vio, handle )))
1001 croak_with_os2error("Can't kbdStatus_set()");
1005 _vioConfig(int which, int handle)
1007 struct {VIOCONFIGINFO i; short a[20];} viob[2], *vio;
1013 if (CheckOSError(VioGetConfig( which, &vio->i, handle )))
1014 croak_with_os2error("Can't get VIO config size");
1015 if (vio->i.cb > sizeof(*vio))
1016 vio->i.cb = sizeof(*vio);
1017 if (CheckOSError(VioGetConfig( which, &vio->i, handle )))
1018 croak_with_os2error("Can't get VIO config");
1019 return newSVpvn((char*)vio, vio->i.cb);
1025 VIOMODEINFO viob[2], *vio;
1030 vio->cb = sizeof(*vio);
1031 if (CheckOSError(VioGetMode( vio, 0 )))
1032 croak_with_os2error("Can't get VIO mode");
1033 return newSVpvn((char*)vio, sizeof(*vio));
1037 _vioMode_set(SV* sv)
1039 VIOMODEINFO viob[2], *vio;
1042 char *s = SvPV(sv, l);
1046 Copy((VIOMODEINFO*)s, vio, 1, VIOMODEINFO);
1047 if (vio->cb != sizeof(*vio) || l != vio->cb)
1048 croak("unexpected datasize");
1049 if (CheckOSError(VioSetMode( vio, 0 )))
1050 croak_with_os2error("Can't set VIO mode");
1054 vioFont(int type, int *w, int *h) /* 0 for actual RAM font, 1 for ROM font */
1056 VIOFONTINFO viob[2], *vio;
1064 /* Should not cross 64K boundaries too: */
1065 if (((ULONG)buf) & 0xFFFF)
1066 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1068 vio->cb = sizeof(*vio);
1069 vio->type = type; /* BIOS or the loaded font. */
1070 vio->cbData = 0xFFFF; /* How large is my buffer? */
1071 vio->pbData = _emx_32to16(buf); /* Wants an 16:16 pointer */
1072 if (CheckOSError(VioGetFont( vio, 0 )))
1073 croak_with_os2error("Can't get VIO font");
1076 return newSVpvn(buf,vio->cbData);
1080 vioFont_set(SV *sv, int cellwidth, int cellheight, int type)
1082 VIOFONTINFO viob[2], *vio;
1087 char *s = SvPV(sv, l);
1091 /* Should not cross 64K boundaries too: */
1092 if (((ULONG)buf) & 0xFFFF)
1093 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1096 croak("length overflow of VIO font");
1097 if (l != (cellwidth + 7)/8 * cellheight * 256)
1098 warn("unexpected length of VIO font");
1099 vio->cb = sizeof(*vio);
1100 vio->type = type; /* BIOS or the loaded font. */
1101 vio->cbData = l; /* How large is my buffer? */
1102 vio->pbData = _emx_32to16(buf); /* Wants an 16:16 pointer */
1103 vio->cxCell = cellwidth;
1104 vio->cyCell = cellheight;
1105 Copy(s, buf, l, char);
1107 if (CheckOSError(VioSetFont( vio, 0 )))
1108 croak_with_os2error("Can't set VIO font");
1112 uses use32,os2def,os2base,crt,defs;
1114 const Pal :VioPalState=(Cb:sizeof(VioPalState);rType:0;iFirst:0;
1115 Acolor:($FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF));
1116 CReg:VioColorReg=(Cb:sizeof(VioColorReg);rType:3;FirstColorReg:0;
1117 NumColorRegs:256; ColorRegAddr:@Plt);
1121 Pal.Acolor[09]:=$0F;
1123 Pal.Acolor[13]:=$2F;
1124 VioSetState(Pal,0); // ce smena EGA registrov
1130 CReg.ColorRegAddr:=ii;
1131 VioGetState(CReg,0);
1135 VioSetState(CReg,0); // a ce - VGA registrov
1141 struct { VIOPALSTATE pal; USHORT a[15]; } pal_padded;
1142 VIOOVERSCAN overscan;
1143 VIOINTENSITY intensity;
1144 VIOCOLORREG colorreg;
1145 struct { VIOCOLORREG reg; char rgb[3*256]; } colorreg_padded;
1146 VIOSETULINELOC lineloc;
1147 VIOSETTARGET target;
1151 vio_state_size(int what)
1153 static const char sizes[] = {
1154 sizeof(VIOPALSTATE),
1155 sizeof(VIOOVERSCAN),
1156 sizeof(VIOINTENSITY),
1157 sizeof(VIOCOLORREG),
1158 6, /* Random number: Reserved entry */
1159 sizeof(VIOSETULINELOC),
1160 sizeof(VIOSETTARGET)
1162 if (what < 0 || what >= sizeof(sizes))
1163 croak("Unexpected VIO state type");
1168 _vioState(int what, int first, int count)
1170 my_VIOSTATE viob[2], *vio;
1171 ULONG rc, size = vio_state_size(what);
1176 vio->pal.type = what;
1178 vio->pal.iFirst = first;
1179 if (first < 0 || first >= 16)
1180 croak("unexpected palette start value");
1181 if (count < 0 || count > 16)
1182 croak("unexpected palette count");
1183 vio->pal.cb = (size += (count - 1) * sizeof(short));
1184 } else if (what == 3) {
1185 /* Wants an 16:16 pointer */
1186 if (count < 0 || count > 256)
1187 croak("unexpected palette count");
1188 vio->colorreg.colorregaddr = (PCH)_emx_32to16(vio->colorreg_padded.rgb);
1189 vio->colorreg.numcolorregs = count; /* 256 is max */
1190 vio->colorreg.firstcolorreg = first;
1193 if (CheckOSError(VioGetState( (void*)vio, 0 )))
1194 croak_with_os2error("Can't get VIO state");
1195 return newSVpvn((char*)vio, size);
1199 _vioState_set(SV *sv)
1201 my_VIOSTATE viob[2], *ovio = (my_VIOSTATE*)SvPV_nolen(sv), *vio = ovio;
1202 int what = ovio->pal.type, cb = ovio->pal.cb;
1203 ULONG rc, size = vio_state_size(what);
1205 char *s = SvPV(sv, l);
1211 if ( cb < size || cb > size + 15*sizeof(SHORT) || l != cb)
1212 croak("unexpected datasize");
1216 if (l != cb + 3 * ovio->colorreg.numcolorregs || cb != size)
1217 croak("unexpected datasize");
1221 if (l != cb || l != size )
1222 croak("unexpected datasize");
1225 Copy(s, (char*)vio, size, char);
1226 if (what == 3) /* We expect colors put after VIOCOLORREG */
1227 vio->colorreg.colorregaddr = (PCH)_emx_32to16(vio->colorreg_padded.rgb);
1229 if (CheckOSError(VioSetState( (void*)vio, 0 )))
1230 croak_with_os2error("Can't set VIO state");
1237 USHORT bufl = bufsize();
1238 char b[(1<<16) * 3]; /* This/3 is enough for 16-bit calls, we need
1239 2x overhead due to 2 vs 4 issue, and extra
1240 64K due to alignment logic */
1243 if (((ULONG)buf) & 0xFFFF)
1244 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1245 if ((sizeof(b) - (buf - b)) < 2*bufl)
1246 croak("panic: VIO buffer allocation");
1247 if (CheckOSError(VioReadCellStr( buf, &bufl, 0, 0, 0 )))
1248 return &PL_sv_undef;
1249 return newSVpvn(buf,bufl);
1256 STRLEN l = SvCUR(sv), bufl = bufsize();
1257 char b[(1<<16) * 2]; /* This/2 is enough for 16-bit calls, we need
1258 extra 64K due to alignment logic */
1261 if (((ULONG)buf) & 0xFFFF)
1262 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
1263 if (!SvPOK(sv) || ((l != bufl) && (l != 2*bufl)))
1264 croak("Wrong size %d of saved screen data", SvCUR(sv));
1265 if ((sizeof(b) - (buf - b)) < l)
1266 croak("panic: VIO buffer allocation");
1267 Copy(SvPV(sv,l), buf, bufl, char);
1268 if (CheckOSError(VioWrtCellStr( buf, bufl, 0, 0, 0 )))
1276 ULONG cps[4], cp, rc;
1278 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &cp )))
1279 croak_with_os2error("DosQueryCp()");
1288 if (CheckOSError(VioGetCp( 0, &cp, 0 )))
1289 croak_with_os2error("VioGetCp()");
1294 out_codepage_set(int cp)
1298 return !(CheckOSError(VioSetCp( 0, cp, 0 )));
1306 if (CheckOSError(KbdGetCp( 0, &cp, 0 )))
1307 croak_with_os2error("KbdGetCp()");
1312 in_codepage_set(int cp)
1316 return !(CheckOSError(KbdSetCp( 0, cp, 0 )));
1320 process_codepage_set(int cp)
1324 return !(CheckOSError(DosSetProcessCp( cp )));
1335 psi = get_sysinfo(pid, QSS_PROCESS);
1338 ppid = psi->procdata->ppid;
1351 psi = get_sysinfo(pid, QSS_PROCESS);
1354 sid = psi->procdata->sessid;
1360 StrLen(ULONG addr, ULONG lim, I32 unitsize)
1365 char *s = (char *)addr;
1366 char *s1 = s, *e = (char *)(addr + lim);
1375 short *s = (short *)addr;
1376 short *s1 = s, *e = (short *)(addr + lim);
1380 return (char*)s - (char*)s1;
1385 int *s = (int *)addr;
1386 int *s1 = s, *e = (int *)(addr + lim);
1390 return (char*)s - (char*)s1;
1395 long long *s = (long long *)addr;
1396 long long *s1 = s, *e = (long long *)(addr + lim);
1400 return (char*)s - (char*)s1;
1404 croak("StrLen: unknown unitsize %d", (int)unitsize);
1408 #define ulMPFROMSHORT(i) ((unsigned long)MPFROMSHORT(i))
1409 #define ulMPVOID() ((unsigned long)MPVOID)
1410 #define ulMPFROMCHAR(i) ((unsigned long)MPFROMCHAR(i))
1411 #define ulMPFROM2SHORT(x1,x2) ((unsigned long)MPFROM2SHORT(x1,x2))
1412 #define ulMPFROMSH2CH(s, c1, c2) ((unsigned long)MPFROMSH2CH(s, c1, c2))
1413 #define ulMPFROMLONG(x) ((unsigned long)MPFROMLONG(x))
1415 #define _MessageBox MessageBox
1416 #define _MessageBox2 MessageBox2
1418 MODULE = OS2::Process PACKAGE = OS2::Process
1435 swentry_expand( SV *sv )
1439 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
1441 if (l != sizeof(SWENTRY))
1442 croak("Wrong structure size %ld!=%ld in swentry_expand()", (long)l, (long)sizeof(SWENTRY));
1444 PUSHs(sv_2mortal(newSVpv(pswentry->swctl.szSwtitle, 0)));
1445 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwnd)));
1446 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwndIcon)));
1447 PUSHs(sv_2mortal(newSViv(pswentry->swctl.hprog)));
1448 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idProcess)));
1449 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idSession)));
1450 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_VISIBLE)));
1451 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_GRAYED)));
1452 PUSHs(sv_2mortal(newSViv(pswentry->swctl.fbJump == SWL_JUMPABLE)));
1453 PUSHs(sv_2mortal(newSViv(pswentry->swctl.bProgType)));
1454 PUSHs(sv_2mortal(newSViv(pswentry->hswitch)));
1458 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)
1462 change_swentry( SV *sv )
1469 process_swentry(unsigned long pid = getpid(), HWND hwnd = NULLHANDLE);
1484 WindowText_set(HWND hwndFrame, char *title)
1487 FocusWindow_set(HWND hwndFocus, HWND hwndDesktop = HWND_DESKTOP)
1490 ShowWindow(HWND hwnd, bool fShow = TRUE)
1493 EnableWindow(HWND hwnd, bool fEnable = TRUE)
1496 PostMsg(HWND hwnd, unsigned long msg, unsigned long mp1 = 0, unsigned long mp2 = 0)
1497 C_ARGS: hwnd, msg, (MPARAM)mp1, (MPARAM)mp2
1500 WindowPos_set(HWND hwnd, long x, long y, unsigned long fl = SWP_MOVE, long cx = 0, long cy = 0, HWND hwndInsertBehind = HWND_TOP)
1504 BeginEnumWindows(HWND hwnd)
1507 EndEnumWindows(unsigned long henum)
1510 GetNextWindow(unsigned long henum)
1513 IsWindowVisible(HWND hwnd)
1516 IsWindowEnabled(HWND hwnd)
1519 IsWindowShowing(HWND hwnd)
1522 QueryWindow(HWND hwnd, long cmd)
1525 IsChild(HWND hwnd, HWND hwndParent)
1528 WindowFromId(HWND hwndParent, unsigned long id)
1531 WindowFromPoint(long x, long y, HWND hwnd = HWND_DESKTOP, bool fChildren = TRUE)
1535 EnumDlgItem(HWND hwndDlg, unsigned long code, HWND hwnd = NULLHANDLE)
1536 C_ARGS: hwndDlg, hwnd, code
1539 EnableWindowUpdate(HWND hwnd, bool fEnable = TRUE)
1542 SetWindowBits(HWND hwnd, long index, unsigned long flData, unsigned long flMask)
1545 SetWindowPtr(HWND hwnd, long index, unsigned long p)
1546 C_ARGS: hwnd, index, (PVOID)p
1549 SetWindowULong(HWND hwnd, long index, unsigned long i)
1552 SetWindowUShort(HWND hwnd, long index, unsigned short i)
1555 IsWindow(HWND hwnd, HAB hab = Acquire_hab())
1559 ActiveWindow_set(HWND hwnd, HWND hwndDesktop = HWND_DESKTOP)
1561 RETVAL = SetActiveWindow(hwndDesktop, hwnd);
1564 LoadPointer(unsigned long idres, unsigned long hmod = 0, HWND hwndDesktop = HWND_DESKTOP)
1565 C_ARGS: hwndDesktop, hmod, idres
1571 out_codepage_set(int cp)
1577 in_codepage_set(int cp)
1589 ULONG cps[4], c, i = 0, rc;
1591 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &c )))
1597 PUSHs(sv_2mortal(newSViv(cps[i++])));
1601 process_codepage_set(int cp)
1604 cursor(OUTLIST int stp, OUTLIST int ep, OUTLIST int wp, OUTLIST int ap)
1608 cursor_set(int s, int e, int w = cursor__(0), int a = cursor__(1))
1611 _kbdChar(int nowait = 0, int handle = 0)
1614 _kbdStatus(int handle = 0)
1617 _kbdStatus_set(SV *sv, int handle = 0)
1622 _vioConfig(int which = 0, int handle = 0)
1628 _vioMode_set(SV *buffer)
1633 _vioState(int what, int first = -1, int count = -1)
1636 _vioState_set(SV *buffer)
1641 vioFont( int type = 0, OUTLIST int w, OUTLIST int h)
1644 vioFont_set(SV *buffer, int cellwidth, int cellheight, int type = 0)
1649 _ClipbrdData_set(unsigned long ulData, unsigned long fmt = CF_TEXT, unsigned long rgfFmtInfo = default_fmtInfo(fmt), HAB hab = perl_hab_GET())
1651 C_ARGS: hab, ulData, fmt, rgfFmtInfo
1653 if (CheckWinError(RETVAL))
1654 croak_with_os2error("_ClipbrdData_set() error");
1658 ClipbrdData_set(SV *text, int convert_nl = 1, unsigned long fmt = CF_TEXT, unsigned long rgfFmtInfo = default_fmtInfo(fmt), HAB hab = perl_hab_GET())
1664 ClipbrdOwner_set(HWND hwnd, HAB hab = perl_hab_GET())
1670 ClipbrdViewer_set(HWND hwnd, HAB hab = perl_hab_GET())
1676 EnumClipbrdFmts(unsigned long fmt = 0, HAB hab = perl_hab_GET())
1680 AddAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1681 C_ARGS: hAtomTbl, pszAtomName
1684 FindAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1685 C_ARGS: hAtomTbl, pszAtomName
1688 _DeleteAtom(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1690 C_ARGS: hAtomTbl, atom
1695 WinDeleteAtom(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1696 C_ARGS: hAtomTbl, atom
1701 Alarm(unsigned long rgfType = WA_ERROR, HWND hwndDesktop = HWND_DESKTOP)
1702 C_ARGS: hwndDesktop, rgfType
1707 FlashWindow(HWND hwndFrame, bool fFlash)
1712 StrLen(ULONG addr, ULONG lim, I32 unitsize = 1)
1714 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myQuery
1717 myQueryWindowText(HWND hwnd)
1720 myQueryClassName(HWND hwnd)
1722 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = Query
1725 QueryFocusWindow(HWND hwndDesktop = HWND_DESKTOP)
1728 QueryWindowTextLength(HWND hwnd)
1731 QueryWindowSWP(HWND hwnd)
1734 QueryWindowULong(HWND hwnd, long index)
1737 QueryWindowUShort(HWND hwnd, long index)
1740 QueryActiveWindow(HWND hwnd = HWND_DESKTOP)
1743 QueryDesktopWindow(HAB hab = Acquire_hab(), unsigned long hdc = NULLHANDLE)
1746 QueryClipbrdData(unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET())
1751 QueryMemoryRegionSize(ULONG addr, OUTLIST ULONG flagp, ULONG len = 0xFFFFFFFF - addr, I32 interrupt = 1)
1754 QueryClipbrdViewer(HAB hab = perl_hab_GET())
1757 QueryClipbrdOwner(HAB hab = perl_hab_GET())
1760 CloseClipbrd(HAB hab = perl_hab_GET())
1765 EmptyClipbrd(HAB hab = perl_hab_GET())
1770 OpenClipbrd(HAB hab = perl_hab_GET())
1773 QueryAtomUsage(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1774 C_ARGS: hAtomTbl, atom
1777 QueryAtomLength(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1778 C_ARGS: hAtomTbl, atom
1784 QuerySystemAtomTable()
1787 QuerySysPointer(long lId, bool fCopy = 1, HWND hwndDesktop = HWND_DESKTOP)
1788 C_ARGS: hwndDesktop, lId, fCopy
1791 CreateAtomTable(unsigned long initial = 0, unsigned long buckets = 0)
1794 _DestroyAtomTable(HATOMTBL hAtomTbl)
1798 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
1801 myWinQueryWindowPtr(HWND hwnd, long index)
1804 myWinQueryWindowProcess(HWND hwnd, OUTLIST unsigned long pid, OUTLIST unsigned long tid)
1807 if (CheckWinError(RETVAL))
1808 croak_with_os2error("WindowProcess() error");
1811 myWinQueryActiveDesktopPathname()
1814 myWinQueryClipbrdFmtInfo(OUTLIST unsigned long prgfFmtInfo, unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET())
1815 C_ARGS: hab, fmt, &prgfFmtInfo
1818 myWinQueryAtomName(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
1820 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWin
1823 myWinSwitchToProgram(HSWITCH hsw = switch_of(NULLHANDLE, getpid()))
1830 myWinMessageBox(unsigned long pszText, char* pszCaption = "Perl script message", unsigned long flStyle = MB_CANCEL | MB_ICONHAND, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = HWND_DESKTOP, unsigned long idWindow = 0)
1831 C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle
1836 _MessageBox(char* pszText, char* pszCaption = "Perl script message", unsigned long flStyle = MB_CANCEL | MB_INFORMATION | MB_MOVEABLE, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0)
1837 C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle
1839 if (RETVAL == MBID_ERROR)
1843 _MessageBox2(char *pszText, char* pmb2info, char *pszCaption = "Perl script message", HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0)
1844 C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, (PMB2INFO)pmb2info
1846 if (RETVAL == MBID_ERROR)
1849 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
1851 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = get
1857 ppidOf(int pid = getpid())
1860 sidOf(int pid = getpid())
1863 getscrsize(OUTLIST int wp, OUTLIST int hp)
1867 scrsize_set(int w_or_h, int h = -9999)
1870 get_InvalidateRect(HWND hwnd, char *prcl, bool fIncludeChildren)
1873 get_CreateFrameControls(HWND hwndFrame, char *pfcdata, char* pszTitle)
1875 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = ul
1878 ulMPFROMSHORT(unsigned short i)
1884 ulMPFROMCHAR(unsigned char i)
1887 ulMPFROM2SHORT(unsigned short x1, unsigned short x2)
1891 ulMPFROMSH2CH(unsigned short s, unsigned char c1, unsigned char c2)
1895 ulMPFROMLONG(unsigned long x)