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 /* These use different type of wrapper. Good to check wrappers. ;-) */
249 /* XXXX This assumes DOS type return type, without SEVERITY?! */
250 DeclFuncByORD(HSWITCH, myWinQuerySwitchHandle, ORD_WinQuerySwitchHandle,
251 (HWND hwnd, PID pid), (hwnd, pid))
252 DeclFuncByORD(ULONG, myWinQuerySwitchEntry, ORD_WinQuerySwitchEntry,
253 (HSWITCH hsw, PSWCNTRL pswctl), (hsw, pswctl))
254 DeclFuncByORD(ULONG, myWinSetWindowText, ORD_WinSetWindowText,
255 (HWND hwnd, char* text), (hwnd, text))
256 DeclFuncByORD(BOOL, myWinQueryWindowProcess, ORD_WinQueryWindowProcess,
257 (HWND hwnd, PPID ppid, PTID ptid), (hwnd, ppid, ptid))
258 DeclFuncByORD(ULONG, XmyWinSwitchToProgram, ORD_WinSwitchToProgram,
259 (HSWITCH hsw), (hsw))
260 #define myWinSwitchToProgram(hsw) (!CheckOSError(XmyWinSwitchToProgram(hsw)))
264 DeclWinFunc_CACHE(HWND, QueryWindow, (HWND hwnd, LONG cmd), (hwnd, cmd))
265 DeclWinFunc_CACHE(BOOL, QueryWindowPos, (HWND hwnd, PSWP pswp),
267 DeclWinFunc_CACHE(LONG, QueryWindowText,
268 (HWND hwnd, LONG cchBufferMax, PCH pchBuffer),
269 (hwnd, cchBufferMax, pchBuffer))
270 DeclWinFunc_CACHE(LONG, QueryClassName, (HWND hwnd, LONG cchMax, PCH pch),
272 DeclWinFunc_CACHE(HWND, QueryFocus, (HWND hwndDesktop), (hwndDesktop))
273 DeclWinFunc_CACHE(BOOL, SetFocus, (HWND hwndDesktop, HWND hwndFocus),
274 (hwndDesktop, hwndFocus))
275 DeclWinFunc_CACHE(BOOL, ShowWindow, (HWND hwnd, BOOL fShow), (hwnd, fShow))
276 DeclWinFunc_CACHE(BOOL, EnableWindow, (HWND hwnd, BOOL fEnable),
278 DeclWinFunc_CACHE(BOOL, SetWindowPos,
279 (HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y,
280 LONG cx, LONG cy, ULONG fl),
281 (hwnd, hwndInsertBehind, x, y, cx, cy, fl))
282 DeclWinFunc_CACHE(HENUM, BeginEnumWindows, (HWND hwnd), (hwnd))
283 DeclWinFunc_CACHE(BOOL, EndEnumWindows, (HENUM henum), (henum))
284 DeclWinFunc_CACHE(BOOL, EnableWindowUpdate, (HWND hwnd, BOOL fEnable),
286 DeclWinFunc_CACHE(BOOL, SetWindowBits,
287 (HWND hwnd, LONG index, ULONG flData, ULONG flMask),
288 (hwnd, index, flData, flMask))
289 DeclWinFunc_CACHE(BOOL, SetWindowPtr, (HWND hwnd, LONG index, PVOID p),
291 DeclWinFunc_CACHE(BOOL, SetWindowULong, (HWND hwnd, LONG index, ULONG ul),
293 DeclWinFunc_CACHE(BOOL, SetWindowUShort, (HWND hwnd, LONG index, USHORT us),
295 DeclWinFunc_CACHE(HWND, IsChild, (HWND hwnd, HWND hwndParent),
297 DeclWinFunc_CACHE(HWND, WindowFromId, (HWND hwnd, ULONG id), (hwnd, id))
298 DeclWinFunc_CACHE(HWND, EnumDlgItem, (HWND hwndDlg, HWND hwnd, ULONG code),
299 (hwndDlg, hwnd, code))
300 DeclWinFunc_CACHE(HWND, QueryDesktopWindow, (HAB hab, HDC hdc), (hab, hdc));
301 DeclWinFunc_CACHE(BOOL, SetActiveWindow, (HWND hwndDesktop, HWND hwnd),
302 (hwndDesktop, hwnd));
304 /* These functions may return 0 on success; check $^E/Perl_rc on res==0: */
305 DeclWinFunc_CACHE_resetError(PVOID, QueryWindowPtr, (HWND hwnd, LONG index),
307 DeclWinFunc_CACHE_resetError(ULONG, QueryWindowULong, (HWND hwnd, LONG index),
309 DeclWinFunc_CACHE_resetError(SHORT, QueryWindowUShort, (HWND hwnd, LONG index),
311 DeclWinFunc_CACHE_resetError(LONG, QueryWindowTextLength, (HWND hwnd), (hwnd))
312 DeclWinFunc_CACHE_resetError(HWND, QueryActiveWindow, (HWND hwnd), (hwnd))
313 DeclWinFunc_CACHE_resetError(BOOL, PostMsg,
314 (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2),
315 (hwnd, msg, mp1, mp2))
316 DeclWinFunc_CACHE_resetError(HWND, GetNextWindow, (HENUM henum), (henum))
317 DeclWinFunc_CACHE_resetError(BOOL, IsWindowEnabled, (HWND hwnd), (hwnd))
318 DeclWinFunc_CACHE_resetError(BOOL, IsWindowVisible, (HWND hwnd), (hwnd))
319 DeclWinFunc_CACHE_resetError(BOOL, IsWindowShowing, (HWND hwnd), (hwnd))
321 /* No die()ing on error */
322 DeclWinFunc_CACHE_survive(BOOL, IsWindow, (HAB hab, HWND hwnd), (hab, hwnd))
324 /* These functions are called frow complicated wrappers: */
325 ULONG (*pWinQuerySwitchList) (HAB hab, PSWBLOCK pswblk, ULONG usDataLength);
326 ULONG (*pWinChangeSwitchEntry) (HSWITCH hsw, __const__ SWCNTRL *pswctl);
327 HWND (*pWinWindowFromPoint)(HWND hwnd, __const__ POINTL *pptl, BOOL fChildren);
330 /* These functions have different names/signatures than what is
332 #define QueryFocusWindow QueryFocus
333 #define FocusWindow_set(hwndFocus, hwndDesktop) SetFocus(hwndDesktop, hwndFocus)
334 #define WindowPos_set(hwnd, x, y, fl, cx, cy, hwndInsertBehind) \
335 SetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl)
336 #define myWinQueryWindowPtr(hwnd, i) ((ULONG)QueryWindowPtr(hwnd, i))
339 WindowText_set(HWND hwnd, char* text)
341 return !CheckWinError(myWinSetWindowText(hwnd, text));
345 myQueryWindowText(HWND hwnd)
347 LONG l = QueryWindowTextLength(hwnd), len;
352 if (Perl_rc) /* Last error */
356 sv = newSVpvn("", 0);
358 len = WinQueryWindowText(hwnd, l + 1, SvPV_force(sv, n_a));
361 croak("WinQueryWindowText() uncompatible with WinQueryWindowTextLength()");
368 QueryWindowSWP_(HWND hwnd)
372 if (!QueryWindowPos(hwnd, &swp))
373 croak("WinQueryWindowPos() error");
378 QueryWindowSWP(HWND hwnd)
380 SWP swp = QueryWindowSWP_(hwnd);
382 return newSVpvn((char*)&swp, sizeof(swp));
386 myQueryClassName(HWND hwnd)
388 SV *sv = newSVpvn("",0);
389 STRLEN l = 46, len = 0, n_a;
391 while (l + 1 >= len) {
393 len = 2*len + 10; /* Grow quick */
397 l = QueryClassName(hwnd, len, SvPV_force(sv, n_a));
404 WindowFromPoint(long x, long y, HWND hwnd, BOOL fChildren)
408 ppl.x = x; ppl.y = y;
409 if (!pWinWindowFromPoint)
410 AssignFuncPByORD(pWinWindowFromPoint, ORD_WinWindowFromPoint);
411 return SaveWinError(pWinWindowFromPoint(hwnd, &ppl, fChildren));
415 fill_swentry(SWENTRY *swentryp, HWND hwnd, PID pid)
420 if (!(_emx_env & 0x200))
421 croak("switch_entry not implemented on DOS"); /* not OS/2. */
422 if (CheckWinError(hSwitch =
423 myWinQuerySwitchHandle(hwnd, pid)))
424 croak("WinQuerySwitchHandle: %s", os2error(Perl_rc));
425 swentryp->hswitch = hSwitch;
426 if (CheckOSError(myWinQuerySwitchEntry(hSwitch, &swentryp->swctl)))
427 croak("WinQuerySwitchEntry err %ld", rc);
431 fill_swentry_default(SWENTRY *swentryp)
433 fill_swentry(swentryp, NULLHANDLE, getpid());
436 /* static ULONG (* APIENTRY16 pDosSmSetTitle)(ULONG, PSZ); */
437 ULONG _THUNK_FUNCTION(DosSmSetTitle)(ULONG, PSZ);
439 #if 0 /* Does not work. */
440 static ULONG (*pDosSmSetTitle)(ULONG, PSZ);
443 sesmgr_title_set(char *s)
446 static HMODULE hdosc = 0;
450 fill_swentry_default(&swentry);
451 if (!pDosSmSetTitle || !hdosc) {
452 if (CheckOSError(DosLoadModule(buf, sizeof buf, "sesmgr", &hdosc)))
453 croak("Cannot load SESMGR: no `%s'", buf);
454 if (CheckOSError(DosQueryProcAddr(hdosc, 0, "DOSSMSETTITLE",
455 (PFN*)&pDosSmSetTitle)))
456 croak("Cannot load SESMGR.DOSSMSETTITLE, err=%ld", rc);
458 /* (pDosSmSetTitle)(swcntrl.idSession,s); */
460 (_THUNK_PROLOG (2+4);
461 _THUNK_SHORT (swcntrl.idSession);
463 _THUNK_CALLI (*pDosSmSetTitle)));
464 if (CheckOSError(rc))
465 warn("*DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x, *paddr=%x",
466 rc, swcntrl.idSession, &_THUNK_FUNCTION(DosSmSetTitle),
473 sesmgr_title_set(char *s)
478 fill_swentry_default(&swentry);
480 (_THUNK_PROLOG (2+4);
481 _THUNK_SHORT (swentry.swctl.idSession);
483 _THUNK_CALL (DosSmSetTitle)));
485 if (CheckOSError(rc))
486 warn("DOSSMSETTITLE: err=%ld, ses=%ld, addr=%x",
487 rc, swcntrl.idSession, _THUNK_FUNCTION(DosSmSetTitle));
489 return !CheckOSError(rc);
493 #if 0 /* Does not work. */
494 USHORT _THUNK_FUNCTION(Win16SetTitle) ();
504 _THUNK_CALL (Win16SetTitle)));
505 if (CheckWinError(rc))
506 warn("Win16SetTitle: err=%ld", rc);
511 process_swentry(unsigned long pid, unsigned long hwnd)
515 if (!(_emx_env & 0x200))
516 croak("process_swentry not implemented on DOS"); /* not OS/2. */
517 fill_swentry(&swentry, hwnd, pid);
518 return newSVpvn((char*)&swentry, sizeof(swentry));
527 SV *sv = newSVpvn("",0);
529 if (!(_emx_env & 0x200))
530 croak("swentries_list not implemented on DOS"); /* not OS/2. */
531 if (!pWinQuerySwitchList)
532 AssignFuncPByORD(pWinQuerySwitchList, ORD_WinQuerySwitchList);
533 num = pWinQuerySwitchList(0, NULL, 0); /* HAB is not required */
535 croak("(Unknown) error during WinQuerySwitchList()");
536 /* Allow one extra entry to allow overflow detection (may happen
537 if the list has been changed). */
542 n = 2*num + 10; /* Enlarge quickly */
543 SvGROW(sv, sizeof(ULONG) + sizeof(SWENTRY) * n + 1);
544 pswblk = (PSWBLOCK) SvPV_force(sv, n_a);
545 num = pWinQuerySwitchList(0, pswblk, SvLEN(sv));
547 SvCUR_set(sv, sizeof(ULONG) + sizeof(SWENTRY) * num);
553 swentry( char *title, HWND sw_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
554 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
555 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
559 strncpy(e.swctl.szSwtitle, title, MAXNAMEL);
560 e.swctl.szSwtitle[60] = 0;
561 e.swctl.hwnd = sw_hwnd;
562 e.swctl.hwndIcon = icon_hwnd;
563 e.swctl.hprog = owner_phandle;
564 e.swctl.idProcess = owner_pid;
565 e.swctl.idSession = owner_sid;
566 e.swctl.uchVisibility = ((visible ? SWL_VISIBLE : SWL_INVISIBLE)
567 | (nonswitchable ? SWL_GRAYED : 0));
568 e.swctl.fbJump = (jumpable ? SWL_JUMPABLE : 0);
569 e.swctl.bProgType = ptype;
570 e.hswitch = sw_entry;
575 create_swentry( char *title, HWND owner_hwnd, HWND icon_hwnd, HPROGRAM owner_phandle,
576 PID owner_pid, ULONG owner_sid, ULONG visible, ULONG nonswitchable,
577 ULONG jumpable, ULONG ptype, HSWITCH sw_entry)
579 SWENTRY e = swentry(title, owner_hwnd, icon_hwnd, owner_phandle, owner_pid,
580 owner_sid, visible, nonswitchable, jumpable, ptype,
583 return newSVpvn((char*)&e, sizeof(e));
587 change_swentrysw(SWENTRY *sw)
589 ULONG rc; /* For CheckOSError */
591 if (!(_emx_env & 0x200))
592 croak("change_entry() not implemented on DOS"); /* not OS/2. */
593 if (!pWinChangeSwitchEntry)
594 AssignFuncPByORD(pWinChangeSwitchEntry, ORD_WinChangeSwitchEntry);
595 return !CheckOSError(pWinChangeSwitchEntry(sw->hswitch, &sw->swctl));
599 change_swentry(SV *sv)
602 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
604 if (l != sizeof(SWENTRY))
605 croak("Wrong structure size %ld!=%ld in change_swentry()", (long)l, (long)sizeof(SWENTRY));
606 return change_swentrysw(pswentry);
610 #define swentry_size() (sizeof(SWENTRY))
613 getscrsize(int *wp, int *hp)
622 /* Force vio to not cross 64K-boundary: */
623 #define VIO_FROM_VIOB \
625 if (!_THUNK_PTR_STRUCT_OK(vio)) \
629 scrsize_set(int w, int h)
631 VIOMODEINFO viob[2], *vio;
638 vio->cb = sizeof(*vio);
639 if (CheckOSError(VioGetMode( vio, 0 )))
643 vio->col = (USHORT)w;
646 vio->row = (USHORT)h;
649 if (CheckOSError(VioSetMode( vio, 0 )))
655 cursor(int *sp, int *ep, int *wp, int *ap)
657 VIOCURSORINFO viob[2], *vio;
662 if (CheckOSError(VioGetCurType( vio, 0 )))
663 croak("VioGetCurType() error");
676 cursor(&s, &e, &w, &a);
684 cursor_set(int s, int e, int w, int a)
686 VIOCURSORINFO viob[2], *vio;
695 return !CheckOSError(VioSetCurType( vio, 0 ));
702 VIOMODEINFO viob[2], *vio;
707 vio->cb = sizeof(*vio);
708 if (CheckOSError(VioGetMode( vio, 0 )))
709 croak("Can't get size of buffer for screen");
710 #if 0 /* buf=323552247, full=1118455, partial=0 */
711 croak("Lengths: buf=%d, full=%d, partial=%d",vio->buf_length,vio->full_length,vio->partial_length);
712 return newSVpvn((char*)vio->buf_addr, vio->full_length);
714 return vio->col * vio->row * 2; /* How to get bytes/cell? 2 or 4? */
727 USHORT bufl = bufsize();
728 char b[(1<<16) * 3]; /* This/3 is enough for 16-bit calls, we need
729 2x overhead due to 2 vs 4 issue, and extra
730 64K due to alignment logic */
733 if (((ULONG)buf) & 0xFFFF)
734 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
735 if ((sizeof(b) - (buf - b)) < 2*bufl)
736 croak("panic: VIO buffer allocation");
737 if (CheckOSError(VioReadCellStr( buf, &bufl, 0, 0, 0 )))
739 return newSVpvn(buf,bufl);
746 STRLEN l = SvCUR(sv), bufl = bufsize();
747 char b[(1<<16) * 2]; /* This/2 is enough for 16-bit calls, we need
748 extra 64K due to alignment logic */
751 if (((ULONG)buf) & 0xFFFF)
752 buf += 0x10000 - (((ULONG)buf) & 0xFFFF);
753 if (!SvPOK(sv) || ((l != bufl) && (l != 2*bufl)))
754 croak("Wrong size %d of saved screen data", SvCUR(sv));
755 if ((sizeof(b) - (buf - b)) < l)
756 croak("panic: VIO buffer allocation");
757 Copy(SvPV(sv,l), buf, bufl, char);
758 if (CheckOSError(VioWrtCellStr( buf, bufl, 0, 0, 0 )))
766 ULONG cps[4], cp, rc;
768 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &cp )))
769 croak("DosQueryCp() error");
778 if (CheckOSError(VioGetCp( 0, &cp, 0 )))
779 croak("VioGetCp() error");
784 out_codepage_set(int cp)
788 return !(CheckOSError(VioSetCp( 0, cp, 0 )));
796 if (CheckOSError(KbdGetCp( 0, &cp, 0 )))
797 croak("KbdGetCp() error");
802 in_codepage_set(int cp)
806 return !(CheckOSError(KbdSetCp( 0, cp, 0 )));
810 process_codepage_set(int cp)
814 return !(CheckOSError(DosSetProcessCp( cp )));
825 psi = get_sysinfo(pid, QSS_PROCESS);
828 ppid = psi->procdata->ppid;
841 psi = get_sysinfo(pid, QSS_PROCESS);
844 sid = psi->procdata->sessid;
849 #define ulMPFROMSHORT(i) ((unsigned long)MPFROMSHORT(i))
850 #define ulMPVOID() ((unsigned long)MPVOID)
851 #define ulMPFROMCHAR(i) ((unsigned long)MPFROMCHAR(i))
852 #define ulMPFROM2SHORT(x1,x2) ((unsigned long)MPFROM2SHORT(x1,x2))
853 #define ulMPFROMSH2CH(s, c1, c2) ((unsigned long)MPFROMSH2CH(s, c1, c2))
854 #define ulMPFROMLONG(x) ((unsigned long)MPFROMLONG(x))
856 MODULE = OS2::Process PACKAGE = OS2::Process
873 swentry_expand( SV *sv )
877 PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l);
879 if (l != sizeof(SWENTRY))
880 croak("Wrong structure size %ld!=%ld in swentry_expand()", (long)l, (long)sizeof(SWENTRY));
882 PUSHs(sv_2mortal(newSVpv(pswentry->swctl.szSwtitle, 0)));
883 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwnd)));
884 PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwndIcon)));
885 PUSHs(sv_2mortal(newSViv(pswentry->swctl.hprog)));
886 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idProcess)));
887 PUSHs(sv_2mortal(newSViv(pswentry->swctl.idSession)));
888 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_VISIBLE)));
889 PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_GRAYED)));
890 PUSHs(sv_2mortal(newSViv(pswentry->swctl.fbJump == SWL_JUMPABLE)));
891 PUSHs(sv_2mortal(newSViv(pswentry->swctl.bProgType)));
892 PUSHs(sv_2mortal(newSViv(pswentry->hswitch)));
896 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)
900 change_swentry( SV *sv )
907 process_swentry(unsigned long pid = getpid(), unsigned long hwnd = NULLHANDLE);
920 WindowText_set(unsigned long hwndFrame, char *title)
923 FocusWindow_set(unsigned long hwndFocus, unsigned long hwndDesktop = HWND_DESKTOP)
926 ShowWindow(unsigned long hwnd, bool fShow = TRUE)
929 EnableWindow(unsigned long hwnd, bool fEnable = TRUE)
932 PostMsg(unsigned long hwnd, unsigned long msg, unsigned long mp1 = 0, unsigned long mp2 = 0)
933 C_ARGS: hwnd, msg, (MPARAM)mp1, (MPARAM)mp2
936 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)
940 BeginEnumWindows(unsigned long hwnd)
943 EndEnumWindows(unsigned long henum)
946 GetNextWindow(unsigned long henum)
949 IsWindowVisible(unsigned long hwnd)
952 IsWindowEnabled(unsigned long hwnd)
955 IsWindowShowing(unsigned long hwnd)
958 QueryWindow(unsigned long hwnd, long cmd)
961 IsChild(unsigned long hwnd, unsigned long hwndParent)
964 WindowFromId(unsigned long hwndParent, unsigned long id)
967 WindowFromPoint(long x, long y, unsigned long hwnd = HWND_DESKTOP, bool fChildren = TRUE)
971 EnumDlgItem(unsigned long hwndDlg, unsigned long code, unsigned long hwnd = NULLHANDLE)
972 C_ARGS: hwndDlg, hwnd, code
975 EnableWindowUpdate(unsigned long hwnd, bool fEnable = TRUE)
978 SetWindowBits(unsigned long hwnd, long index, unsigned long flData, unsigned long flMask)
981 SetWindowPtr(unsigned long hwnd, long index, unsigned long p)
982 C_ARGS: hwnd, index, (PVOID)p
985 SetWindowULong(unsigned long hwnd, long index, unsigned long i)
988 SetWindowUShort(unsigned long hwnd, long index, unsigned short i)
991 IsWindow(unsigned long hwnd, unsigned long hab = Acquire_hab())
995 ActiveWindow_set(unsigned long hwnd, unsigned long hwndDesktop = HWND_DESKTOP)
997 RETVAL = SetActiveWindow(hwndDesktop, hwnd);
1003 out_codepage_set(int cp)
1009 in_codepage_set(int cp)
1021 ULONG cps[4], c, i = 0, rc;
1023 if (CheckOSError(DosQueryCp( sizeof(cps), cps, &c )))
1029 PUSHs(sv_2mortal(newSViv(cps[i++])));
1033 process_codepage_set(int cp)
1036 cursor(OUTLIST int stp, OUTLIST int ep, OUTLIST int wp, OUTLIST int ap)
1040 cursor_set(int s, int e, int w = cursor__(0), int a = cursor__(1))
1042 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myQuery
1045 myQueryWindowText(unsigned long hwnd)
1048 myQueryClassName(unsigned long hwnd)
1050 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = Query
1053 QueryFocusWindow(unsigned long hwndDesktop = HWND_DESKTOP)
1056 QueryWindowTextLength(unsigned long hwnd)
1059 QueryWindowSWP(unsigned long hwnd)
1062 QueryWindowULong(unsigned long hwnd, long index)
1065 QueryWindowUShort(unsigned long hwnd, long index)
1068 QueryActiveWindow(unsigned long hwnd = HWND_DESKTOP)
1071 QueryDesktopWindow(unsigned long hab = Acquire_hab(), unsigned long hdc = NULLHANDLE)
1073 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
1076 myWinQueryWindowPtr(unsigned long hwnd, long index)
1079 myWinQueryWindowProcess(unsigned long hwnd, OUTLIST unsigned long pid, OUTLIST unsigned long tid)
1082 if (CheckWinError(RETVAL))
1083 croak("WindowProcess() error");
1085 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWin
1088 myWinSwitchToProgram(unsigned long hsw)
1092 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
1094 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = get
1100 ppidOf(int pid = getpid())
1103 sidOf(int pid = getpid())
1106 getscrsize(OUTLIST int wp, OUTLIST int hp)
1110 scrsize_set(int w_or_h, int h = -9999)
1112 MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = ul
1115 ulMPFROMSHORT(unsigned short i)
1121 ulMPFROMCHAR(unsigned char i)
1124 ulMPFROM2SHORT(unsigned short x1, unsigned short x2)
1128 ulMPFROMSH2CH(unsigned short s, unsigned char c1, unsigned char c2)
1132 ulMPFROMLONG(unsigned long x)