5 #define INCL_WINSWITCHLIST
6 #define INCL_WINWINDOWMGR
17 constant(char *name, int arg)
20 if (name[0] == 'P' && name[1] == '_') {
21 if (strEQ(name, "P_BACKGROUND"))
27 if (strEQ(name, "P_DEBUG"))
33 if (strEQ(name, "P_DEFAULT"))
39 if (strEQ(name, "P_DETACH"))
45 if (strEQ(name, "P_FOREGROUND"))
51 if (strEQ(name, "P_FULLSCREEN"))
57 if (strEQ(name, "P_MAXIMIZE"))
63 if (strEQ(name, "P_MINIMIZE"))
69 if (strEQ(name, "P_NOCLOSE"))
75 if (strEQ(name, "P_NOSESSION"))
81 if (strEQ(name, "P_NOWAIT"))
87 if (strEQ(name, "P_OVERLAY"))
93 if (strEQ(name, "P_PM"))
99 if (strEQ(name, "P_QUOTE"))
105 if (strEQ(name, "P_SESSION"))
111 if (strEQ(name, "P_TILDE"))
117 if (strEQ(name, "P_UNRELATED"))
123 if (strEQ(name, "P_WAIT"))
129 if (strEQ(name, "P_WINDOWED"))
135 } else if (name[0] == 'T' && name[1] == '_') {
136 if (strEQ(name, "FAPPTYP_NOTSPEC"))
137 #ifdef FAPPTYP_NOTSPEC
138 return FAPPTYP_NOTSPEC;
142 if (strEQ(name, "T_NOTWINDOWCOMPAT"))
143 #ifdef FAPPTYP_NOTWINDOWCOMPAT
144 return FAPPTYP_NOTWINDOWCOMPAT;
148 if (strEQ(name, "T_WINDOWCOMPAT"))
149 #ifdef FAPPTYP_WINDOWCOMPAT
150 return FAPPTYP_WINDOWCOMPAT;
154 if (strEQ(name, "T_WINDOWAPI"))
155 #ifdef FAPPTYP_WINDOWAPI
156 return FAPPTYP_WINDOWAPI;
160 if (strEQ(name, "T_BOUND"))
162 return FAPPTYP_BOUND;
166 if (strEQ(name, "T_DLL"))
172 if (strEQ(name, "T_DOS"))
178 if (strEQ(name, "T_PHYSDRV"))
179 #ifdef FAPPTYP_PHYSDRV
180 return FAPPTYP_PHYSDRV;
184 if (strEQ(name, "T_VIRTDRV"))
185 #ifdef FAPPTYP_VIRTDRV
186 return FAPPTYP_VIRTDRV;
190 if (strEQ(name, "T_PROTDLL"))
191 #ifdef FAPPTYP_PROTDLL
192 return FAPPTYP_PROTDLL;
196 if (strEQ(name, "T_32BIT"))
198 return FAPPTYP_32BIT;
212 const char* const ptypes[] = { "FS", "DOS", "VIO", "PM", "DETACH" };
221 if (!(_emx_env & 0x200)) return (char*)ptypes[1]; /* not OS/2. */
222 if (CheckOSError(DosGetInfoBlocks(&tib, &pib)))
225 return (pib->pib_ultype <= 4 ? (char*)ptypes[pib->pib_ultype] : "UNKNOWN");
229 file_type(char *path)
234 if (!(_emx_env & 0x200))
235 croak("file_type not implemented on DOS"); /* not OS/2. */
236 if (CheckOSError(DosQueryAppType(path, &apptype))) {
237 if (rc == ERROR_INVALID_EXE_SIGNATURE)
238 croak("Invalid EXE signature");
239 else if (rc == ERROR_EXE_MARKED_INVALID) {
240 croak("EXE marked invalid");
242 croak("DosQueryAppType err %ld", rc);
248 DeclFuncByORD(HSWITCH, myWinQuerySwitchHandle, ORD_WinQuerySwitchHandle,
249 (HWND hwnd, PID pid), (hwnd, pid))
250 DeclFuncByORD(ULONG, myWinQuerySwitchEntry, ORD_WinQuerySwitchEntry,
251 (HSWITCH hsw, PSWCNTRL pswctl), (hsw, pswctl))
252 DeclFuncByORD(ULONG, myWinSetWindowText, ORD_WinSetWindowText,
253 (HWND hwnd, char* text), (hwnd, text))
254 DeclFuncByORD(BOOL, myWinQueryWindowProcess, ORD_WinQueryWindowProcess,
255 (HWND hwnd, PPID ppid, PTID ptid), (hwnd, ppid, ptid))
257 DeclFuncByORD(ULONG, XmyWinSwitchToProgram, ORD_WinSwitchToProgram,
258 (HSWITCH hsw), (hsw))
259 #define myWinSwitchToProgram(hsw) (!CheckOSError(XmyWinSwitchToProgram(hsw)))
261 DeclFuncByORD(HWND, myWinQueryActiveWindow, ORD_WinQueryActiveWindow,
265 ULONG (*pWinQuerySwitchList) (HAB hab, PSWBLOCK pswblk, ULONG usDataLength);
266 ULONG (*pWinChangeSwitchEntry) (HSWITCH hsw, __const__ SWCNTRL *pswctl);
268 HWND (*pWinQueryWindow) (HWND hwnd, LONG cmd);
269 BOOL (*pWinQueryWindowPos) (HWND hwnd, PSWP pswp);
270 LONG (*pWinQueryWindowText) (HWND hwnd, LONG cchBufferMax, PCH pchBuffer);
271 LONG (*pWinQueryWindowTextLength) (HWND hwnd);
272 LONG (*pWinQueryClassName) (HWND hwnd, LONG cchMax, PCH pch);
273 HWND (*pWinQueryFocus) (HWND hwndDesktop);
274 BOOL (*pWinSetFocus) (HWND hwndDesktop, HWND hwndFocus);
275 BOOL (*pWinShowWindow) (HWND hwnd, BOOL fShow);
276 BOOL (*pWinPostMsg) (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
277 BOOL (*pWinSetWindowPos) (HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y,
278 LONG cx, LONG cy, ULONG fl);
279 HENUM (*pWinBeginEnumWindows) (HWND hwnd);
280 BOOL (*pWinEndEnumWindows) (HENUM henum);
281 HWND (*pWinGetNextWindow) (HENUM henum);
282 BOOL (*pWinIsWindow) (HAB hab, HWND hwnd);
283 HWND (*pWinQueryWindow) (HWND hwnd, LONG cmd);
285 DeclWinFuncByORD(HWND, IsChild, ORD_WinIsChild,
286 (HWND hwnd, HWND hwndParent), (hwnd, hwndParent))
287 DeclWinFuncByORD(HWND, WindowFromId, ORD_WinWindowFromId,
288 (HWND hwnd, ULONG id), (hwnd, id))
290 HWND (*pWinWindowFromPoint)(HWND hwnd, __const__ POINTL *pptl, BOOL fChildren);
292 DeclWinFuncByORD(HWND, EnumDlgItem, ORD_WinEnumDlgItem,
293 (HWND hwndDlg, HWND hwnd, ULONG code), (hwndDlg, hwnd, code));
296 WindowText_set(HWND hwnd, char* text)
298 return !CheckWinError(myWinSetWindowText(hwnd, text));
302 QueryWindowTextLength(HWND hwnd)
306 if (!pWinQueryWindowTextLength)
307 AssignFuncPByORD(pWinQueryWindowTextLength, ORD_WinQueryWindowTextLength);
308 ret = pWinQueryWindowTextLength(hwnd);
309 CheckWinError(ret); /* May put false positive */
314 QueryWindowText(HWND hwnd)
316 LONG l = QueryWindowTextLength(hwnd);
317 SV *sv = newSVpvn("", 0);
323 if (!pWinQueryWindowText)
324 AssignFuncPByORD(pWinQueryWindowText, ORD_WinQueryWindowText);
325 CheckWinError(l = pWinQueryWindowText(hwnd, l + 1, SvPV_force(sv, n_a)));
331 QueryWindowSWP_(HWND hwnd)
335 if (!pWinQueryWindowPos)
336 AssignFuncPByORD(pWinQueryWindowPos, ORD_WinQueryWindowPos);
337 if (CheckWinError(pWinQueryWindowPos(hwnd, &swp)))
338 croak("WinQueryWindowPos() error");
343 QueryWindowSWP(HWND hwnd)
345 SWP swp = QueryWindowSWP_(hwnd);
347 return newSVpvn((char*)&swp, sizeof(swp));
351 QueryClassName(HWND hwnd)
353 SV *sv = newSVpvn("",0);
354 STRLEN l = 46, len = 0, n_a;
356 if (!pWinQueryClassName)
357 AssignFuncPByORD(pWinQueryClassName, ORD_WinQueryClassName);
358 while (l + 1 >= len) {
360 len = 2*len + 10; /* Grow quick */
364 l = pWinQueryClassName(hwnd, len, SvPV_force(sv, n_a));
372 QueryFocusWindow(HWND hwndDesktop)
377 AssignFuncPByORD(pWinQueryFocus, ORD_WinQueryFocus);
378 ret = pWinQueryFocus(hwndDesktop);
384 FocusWindow_set(HWND hwndFocus, HWND hwndDesktop)
387 AssignFuncPByORD(pWinSetFocus, ORD_WinSetFocus);
388 return !CheckWinError(pWinSetFocus(hwndDesktop, hwndFocus));
392 ShowWindow(HWND hwnd, BOOL fShow)
395 AssignFuncPByORD(pWinShowWindow, ORD_WinShowWindow);
396 return !CheckWinError(pWinShowWindow(hwnd, fShow));
400 PostMsg(HWND hwnd, ULONG msg, ULONG mp1, ULONG mp2)
403 AssignFuncPByORD(pWinPostMsg, ORD_WinPostMsg);
404 return !CheckWinError(pWinPostMsg(hwnd, msg, (MPARAM)mp1, (MPARAM)mp2));
408 WindowPos_set(HWND hwnd, LONG x, LONG y, ULONG fl, LONG cx, LONG cy,
409 HWND hwndInsertBehind)
411 if (!pWinSetWindowPos)
412 AssignFuncPByORD(pWinSetWindowPos, ORD_WinSetWindowPos);
413 return !CheckWinError(pWinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl));
417 BeginEnumWindows(HWND hwnd)
419 if (!pWinBeginEnumWindows)
420 AssignFuncPByORD(pWinBeginEnumWindows, ORD_WinBeginEnumWindows);
421 return SaveWinError(pWinBeginEnumWindows(hwnd));
425 EndEnumWindows(HENUM henum)
427 if (!pWinEndEnumWindows)
428 AssignFuncPByORD(pWinEndEnumWindows, ORD_WinEndEnumWindows);
429 return !CheckWinError(pWinEndEnumWindows(henum));
433 GetNextWindow(HENUM henum)
435 if (!pWinGetNextWindow)
436 AssignFuncPByORD(pWinGetNextWindow, ORD_WinGetNextWindow);
437 return SaveWinError(pWinGetNextWindow(henum));
441 IsWindow(HWND hwnd, HAB hab)
444 AssignFuncPByORD(pWinIsWindow, ORD_WinIsWindow);
445 return !CheckWinError(pWinIsWindow(hab, hwnd));
449 QueryWindow(HWND hwnd, LONG cmd)
451 if (!pWinQueryWindow)
452 AssignFuncPByORD(pWinQueryWindow, ORD_WinQueryWindow);
453 return !CheckWinError(pWinQueryWindow(hwnd, cmd));
457 WindowFromPoint(long x, long y, HWND hwnd, BOOL fChildren)
461 ppl.x = x; ppl.y = y;
462 if (!pWinWindowFromPoint)
463 AssignFuncPByORD(pWinWindowFromPoint, ORD_WinWindowFromPoint);
464 return SaveWinError(pWinWindowFromPoint(hwnd, &ppl, fChildren));
468 fill_swentry(SWENTRY *swentryp, HWND hwnd, PID pid)
473 if (!(_emx_env & 0x200))
474 croak("switch_entry not implemented on DOS"); /* not OS/2. */
475 if (CheckWinError(hSwitch =
476 myWinQuerySwitchHandle(hwnd, pid)))
477 croak("WinQuerySwitchHandle err %ld", Perl_rc);
478 swentryp->hswitch = hSwitch;
479 if (CheckOSError(myWinQuerySwitchEntry(hSwitch, &swentryp->swctl)))
480 croak("WinQuerySwitchEntry err %ld", rc);
484 fill_swentry_default(SWENTRY *swentryp)
486 fill_swentry(swentryp, NULLHANDLE, getpid());
489 /* static ULONG (* APIENTRY16 pDosSmSetTitle)(ULONG, PSZ); */
490 ULONG _THUNK_FUNCTION(DosSmSetTitle)(ULONG, PSZ);
492 #if 0 /* Does not work. */
493 static ULONG (*pDosSmSetTitle)(ULONG, PSZ);
496 sesmgr_title_set(char *s)
499 static HMODULE hdosc = 0;
503 fill_swentry_default(&swentry);
504 if (!pDosSmSetTitle || !hdosc) {
505 if (CheckOSError(DosLoadModule(buf, sizeof buf, "sesmgr", &hdosc)))
506 croak("Cannot load SESMGR: no `%s'", buf);
507 if (CheckOSError(DosQueryProcAddr(hdosc, 0, "DOSSMSETTITLE",
508 (PFN*)&pDosSmSetTitle)))
509 croak("Cannot load SESMGR.DOSSMSETTITLE, err=%ld", rc);
511 /* (pDosSmSetTitle)(swcntrl.idSession,s); */
513 (_THUNK_PROLOG (2+4);
514 _THUNK_SHORT (swcntrl.idSession);
516 _THUNK_CALLI (*pDosSmSetTitle)));
517 if (CheckOSError(rc))
518 warn("*DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x, *paddr=%x",
519 rc, swcntrl.idSession, &_THUNK_FUNCTION(DosSmSetTitle),
526 sesmgr_title_set(char *s)
531 fill_swentry_default(&swentry);
533 (_THUNK_PROLOG (2+4);
534 _THUNK_SHORT (swentry.swctl.idSession);
536 _THUNK_CALL (DosSmSetTitle)));
538 if (CheckOSError(rc))
539 warn("DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x",
540 rc, swcntrl.idSession, _THUNK_FUNCTION(DosSmSetTitle));
542 return !CheckOSError(rc);
546 #if 0 /* Does not work. */
547 USHORT _THUNK_FUNCTION(Win16SetTitle) ();
557 _THUNK_CALL (Win16SetTitle)));
558 if (CheckWinError(rc))
559 warn("Win16SetTitle: err=%ld", rc);
564 process_swentry(unsigned long pid, unsigned long hwnd)
568 if (!(_emx_env & 0x200))
569 croak("process_swentry not implemented on DOS"); /* not OS/2. */
570 fill_swentry(&swentry, hwnd, pid);
571 return newSVpvn((char*)&swentry, sizeof(swentry));
580 SV *sv = newSVpvn("",0);
582 if (!(_emx_env & 0x200))
583 croak("swentries_list not implemented on DOS"); /* not OS/2. */
584 if (!pWinQuerySwitchList)
585 AssignFuncPByORD(pWinQuerySwitchList, ORD_WinQuerySwitchList);
586 num = pWinQuerySwitchList(0, NULL, 0); /* HAB is not required */
588 croak("(Unknown) error during WinQuerySwitchList()");
589 /* Allow one extra entry to allow overflow detection (may happen
590 if the list has been changed). */
595 n = 2*num + 10; /* Enlarge quickly */
596 SvGROW(sv, sizeof(ULONG) + sizeof(SWENTRY) * n + 1);
597 pswblk = (PSWBLOCK) SvPV_force(sv, n_a);
598 num = pWinQuerySwitchList(0, pswblk, SvLEN(sv));
600 SvCUR_set(sv, sizeof(ULONG) + sizeof(SWENTRY) * num);
606 swentry( char *title, HWND sw_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
607 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
608 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
612 strncpy(e.swctl.szSwtitle, title, MAXNAMEL);
613 e.swctl.szSwtitle[60] = 0;
614 e.swctl.hwnd = sw_hwnd;
615 e.swctl.hwndIcon = icon_hwnd;
616 e.swctl.hprog = owner_phandle;
617 e.swctl.idProcess = owner_pid;
618 e.swctl.idSession = owner_sid;
619 e.swctl.uchVisibility = ((visible ? SWL_VISIBLE : SWL_INVISIBLE)
620 | (nonswitchable ? SWL_GRAYED : 0));
621 e.swctl.fbJump = (jumpable ? SWL_JUMPABLE : 0);
622 e.swctl.bProgType = ptype;
623 e.hswitch = sw_entry;
628 create_swentry( char *title, HWND owner_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
629 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
630 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
632 SWENTRY e = swentry(title, owner_hwnd, icon_hwnd, owner_phandle, owner_pid,
633 owner_sid, visible, nonswitchable, jumpable, ptype,
636 return newSVpvn((char*)&e, sizeof(e));
640 change_swentrysw(SWENTRY *sw)
642 ULONG rc; /* For CheckOSError */
644 if (!(_emx_env & 0x200))
645 croak("change_entry() not implemented on DOS"); /* not OS/2. */
646 if (!pWinChangeSwitchEntry)
647 AssignFuncPByORD(pWinChangeSwitchEntry, ORD_WinChangeSwitchEntry);
648 return !CheckOSError(pWinChangeSwitchEntry(sw->hswitch, &sw->swctl));
652 change_swentry(SV *sv)
655 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
657 if (l != sizeof(SWENTRY))
658 croak("Wrong structure size %ld!=%ld in change_swentry()", (long)l, (long)sizeof(SWENTRY));
659 return change_swentrysw(pswentry);
663 #define swentry_size() (sizeof(SWENTRY))
666 getscrsize(int *wp, int *hp)
675 /* Force vio to not cross 64K-boundary: */
676 #define VIO_FROM_VIOB \
678 if (!_THUNK_PTR_STRUCT_OK(vio)) \
682 scrsize_set(int w, int h)
684 VIOMODEINFO viob[2], *vio;
691 vio->cb = sizeof(*vio);
692 if (CheckOSError(VioGetMode( vio, 0 )))
696 vio->col = (USHORT)w;
699 vio->row = (USHORT)h;
702 if (CheckOSError(VioSetMode( vio, 0 )))
708 cursor(int *sp, int *ep, int *wp, int *ap)
710 VIOCURSORINFO viob[2], *vio;
715 if (CheckOSError(VioGetCurType( vio, 0 )))
716 croak("VioGetCurType() error");
729 cursor(&s, &e, &w, &a);
737 cursor_set(int s, int e, int w, int a)
739 VIOCURSORINFO viob[2], *vio;
748 return !CheckOSError(VioSetCurType( vio, 0 ));
755 VIOMODEINFO viob[2], *vio;
760 vio->cb = sizeof(*vio);
761 if (CheckOSError(VioGetMode( vio, 0 )))
762 croak("Can't get size of buffer for screen");
763 #if 0 /* buf=323552247, full=1118455, partial=0 */
764 croak("Lengths: buf=%d, full=%d, partial=%d",vio->buf_length,vio->full_length,vio->partial_length);
765 return newSVpvn((char*)vio->buf_addr, vio->full_length);
767 return vio->col * vio->row * 2; /* How to get bytes/cell? 2 or 4? */
780 USHORT bufl = bufsize();
781 char b[(1<<16) * 3]; /* This/3 is enough for 16-bit calls, we need
782 2x overhead due to 2 vs 4 issue, and extra
783 64K due to alignment logic */
786 if (((ULONG)buf) & 0xFFFF)
787 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
788 if ((sizeof(b) - (buf - b)) < 2*bufl)
789 croak("panic: VIO buffer allocation");
790 if (CheckOSError(VioReadCellStr( buf, &bufl, 0, 0, 0 )))
792 return newSVpvn(buf,bufl);
799 STRLEN l = SvCUR(sv), bufl = bufsize();
800 char b[(1<<16) * 2]; /* This/2 is enough for 16-bit calls, we need
801 extra 64K due to alignment logic */
804 if (((ULONG)buf) & 0xFFFF)
805 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
806 if (!SvPOK(sv) || ((l != bufl) && (l != 2*bufl)))
807 croak("Wrong size %d of saved screen data", SvCUR(sv));
808 if ((sizeof(b) - (buf - b)) < l)
809 croak("panic: VIO buffer allocation");
810 Copy(SvPV(sv,l), buf, bufl, char);
811 if (CheckOSError(VioWrtCellStr( buf, bufl, 0, 0, 0 )))
819 ULONG cps[4], cp, rc;
821 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &cp )))
822 croak("DosQueryCp() error");
831 if (CheckOSError(VioGetCp( 0, &cp, 0 )))
832 croak("VioGetCp() error");
837 out_codepage_set(int cp)
841 return !(CheckOSError(VioSetCp( 0, cp, 0 )));
849 if (CheckOSError(KbdGetCp( 0, &cp, 0 )))
850 croak("KbdGetCp() error");
855 in_codepage_set(int cp)
859 return !(CheckOSError(KbdSetCp( 0, cp, 0 )));
863 process_codepage_set(int cp)
867 return !(CheckOSError(DosSetProcessCp( cp )));
878 psi = get_sysinfo(pid, QSS_PROCESS);
881 ppid = psi->procdata->ppid;
894 psi = get_sysinfo(pid, QSS_PROCESS);
897 sid = psi->procdata->sessid;
902 MODULE = OS2::Process PACKAGE = OS2::Process
918 swentry_expand( SV *sv )
922 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
924 if (l != sizeof(SWENTRY))
925 croak("Wrong structure size %ld!=%ld in swentry_expand()", (long)l, (long)sizeof(SWENTRY));
927 PUSHs(sv_2mortal(newSVpv(pswentry->swctl.szSwtitle, 0)));
928 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwnd)));
929 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwndIcon)));
930 PUSHs(sv_2mortal(newSViv(pswentry->swctl.hprog)));
931 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idProcess)));
932 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idSession)));
933 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_VISIBLE)));
934 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_GRAYED)));
935 PUSHs(sv_2mortal(newSViv(pswentry->swctl.fbJump == SWL_JUMPABLE)));
936 PUSHs(sv_2mortal(newSViv(pswentry->swctl.bProgType)));
937 PUSHs(sv_2mortal(newSViv(pswentry->hswitch)));
941 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)
944 change_swentry( SV *sv )
951 process_swentry(unsigned long pid = getpid(), unsigned long hwnd = NULLHANDLE);
960 WindowText_set(unsigned long hwndFrame, char *title)
963 FocusWindow_set(unsigned long hwndFocus, unsigned long hwndDesktop = HWND_DESKTOP)
966 ShowWindow(unsigned long hwnd, bool fShow = TRUE)
969 PostMsg(unsigned long hwnd, unsigned long msg, unsigned long mp1 = 0, unsigned long mp2 = 0)
972 WindowPos_set(unsigned long hwnd, long x, long y, unsigned long fl = SWP_MOVE, long cx = 0, long cy = 0, unsigned long hwndInsertBehind = HWND_TOP)
975 BeginEnumWindows(unsigned long hwnd)
978 EndEnumWindows(unsigned long henum)
981 GetNextWindow(unsigned long henum)
984 IsWindow(unsigned long hwnd, unsigned long hab = Acquire_hab())
987 QueryWindow(unsigned long hwnd, long cmd)
990 IsChild(unsigned long hwnd, unsigned long hwndParent)
993 WindowFromId(unsigned long hwndParent, unsigned long id)
996 WindowFromPoint(long x, long y, unsigned long hwnd, bool fChildren = 0)
999 EnumDlgItem(unsigned long hwndDlg, unsigned long code, unsigned long hwnd = NULLHANDLE)
1000 C_ARGS: hwndDlg, hwnd, code
1006 out_codepage_set(int cp)
1012 in_codepage_set(int cp)
1024 ULONG cps[4], c, i = 0, rc;
1026 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &c )))
1032 PUSHs(sv_2mortal(newSViv(cps[i++])));
1036 process_codepage_set(int cp)
1038 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = Query
1041 QueryFocusWindow(unsigned long hwndDesktop = HWND_DESKTOP)
1044 QueryWindowTextLength(unsigned long hwnd)
1047 QueryWindowText(unsigned long hwnd)
1050 QueryWindowSWP(unsigned long hwnd)
1053 QueryClassName(unsigned long hwnd)
1055 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWin
1058 myWinQueryWindowProcess(unsigned long hwnd, OUTLIST unsigned long pid, OUTLIST unsigned long tid)
1060 if (CheckWinError(RETVAL))
1061 croak("QueryWindowProcess() error");
1064 cursor(OUTLIST int stp, OUTLIST int ep, OUTLIST int wp, OUTLIST int ap)
1067 cursor_set(int s, int e, int w = cursor__(0), int a = cursor__(1))
1070 myWinSwitchToProgram(unsigned long hsw)
1075 myWinQueryActiveWindow(unsigned long hwnd = HWND_DESKTOP)
1077 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = get
1083 ppidOf(int pid = getpid())
1086 sidOf(int pid = getpid())
1089 getscrsize(OUTLIST int wp, OUTLIST int hp)
1092 scrsize_set(int w_or_h, int h = -9999)