📄 process.xs
字号:
char *my_type()U32file_type(path) char *pathSV *swentry_expand( SV *sv ) PPCODE: { STRLEN l; PSWENTRY pswentry = (PSWENTRY)SvPV(sv, l); if (l != sizeof(SWENTRY)) croak("Wrong structure size %ld!=%ld in swentry_expand()", (long)l, (long)sizeof(SWENTRY)); EXTEND(sp,11); PUSHs(sv_2mortal(newSVpv(pswentry->swctl.szSwtitle, 0))); PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwnd))); PUSHs(sv_2mortal(newSVnv(pswentry->swctl.hwndIcon))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.hprog))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.idProcess))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.idSession))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_VISIBLE))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.uchVisibility & SWL_GRAYED))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.fbJump == SWL_JUMPABLE))); PUSHs(sv_2mortal(newSViv(pswentry->swctl.bProgType))); PUSHs(sv_2mortal(newSViv(pswentry->hswitch))); }SV *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)PROTOTYPE: DISABLEintchange_swentry( SV *sv )boolsesmgr_title_set(s) char *sSV *process_swentry(unsigned long pid = getpid(), HWND hwnd = NULLHANDLE); PROTOTYPE: DISABLEintswentry_size()SV *swentries_list()voidResetWinError() POSTCALL: XSRETURN_YES;intWindowText_set(HWND hwndFrame, char *title)boolFocusWindow_set(HWND hwndFocus, HWND hwndDesktop = HWND_DESKTOP)boolShowWindow(HWND hwnd, bool fShow = TRUE)boolEnableWindow(HWND hwnd, bool fEnable = TRUE)boolPostMsg(HWND hwnd, unsigned long msg, unsigned long mp1 = 0, unsigned long mp2 = 0) C_ARGS: hwnd, msg, (MPARAM)mp1, (MPARAM)mp2boolWindowPos_set(HWND hwnd, long x, long y, unsigned long fl = SWP_MOVE, long cx = 0, long cy = 0, HWND hwndInsertBehind = HWND_TOP) PROTOTYPE: DISABLEunsigned longBeginEnumWindows(HWND hwnd)boolEndEnumWindows(unsigned long henum)unsigned longGetNextWindow(unsigned long henum)boolIsWindowVisible(HWND hwnd)boolIsWindowEnabled(HWND hwnd)boolIsWindowShowing(HWND hwnd)unsigned longQueryWindow(HWND hwnd, long cmd)unsigned longIsChild(HWND hwnd, HWND hwndParent)unsigned longWindowFromId(HWND hwndParent, unsigned long id)unsigned longWindowFromPoint(long x, long y, HWND hwnd = HWND_DESKTOP, bool fChildren = TRUE)PROTOTYPE: DISABLEunsigned longEnumDlgItem(HWND hwndDlg, unsigned long code, HWND hwnd = NULLHANDLE) C_ARGS: hwndDlg, hwnd, codeboolEnableWindowUpdate(HWND hwnd, bool fEnable = TRUE)boolSetWindowBits(HWND hwnd, long index, unsigned long flData, unsigned long flMask)boolSetWindowPtr(HWND hwnd, long index, unsigned long p) C_ARGS: hwnd, index, (PVOID)pboolSetWindowULong(HWND hwnd, long index, unsigned long i)boolSetWindowUShort(HWND hwnd, long index, unsigned short i)boolIsWindow(HWND hwnd, HAB hab = Acquire_hab()) C_ARGS: hab, hwndBOOLActiveWindow_set(HWND hwnd, HWND hwndDesktop = HWND_DESKTOP) CODE: RETVAL = SetActiveWindow(hwndDesktop, hwnd);unsigned longLoadPointer(unsigned long idres, unsigned long hmod = 0, HWND hwndDesktop = HWND_DESKTOP) C_ARGS: hwndDesktop, hmod, idresintout_codepage()boolout_codepage_set(int cp)intin_codepage()boolin_codepage_set(int cp)SV *screen()boolscreen_set(SV *sv)SV *process_codepages() PPCODE: { ULONG cps[4], c, i = 0, rc; if (CheckOSError(DosQueryCp( sizeof(cps), cps, &c ))) c = 0; c /= sizeof(ULONG); if (c >= 3) EXTEND(sp, c); while (i < c) PUSHs(sv_2mortal(newSViv(cps[i++]))); }boolprocess_codepage_set(int cp)voidcursor(OUTLIST int stp, OUTLIST int ep, OUTLIST int wp, OUTLIST int ap) PROTOTYPE:boolcursor_set(int s, int e, int w = cursor__(0), int a = cursor__(1))SV*_kbdChar(int nowait = 0, int handle = 0)SV*_kbdStatus(int handle = 0)void_kbdStatus_set(SV *sv, int handle = 0) POSTCALL: XSRETURN_YES;SV*_vioConfig(int which = 0, int handle = 0)SV*_vioMode()void_vioMode_set(SV *buffer) POSTCALL: XSRETURN_YES;SV*_vioState(int what, int first = -1, int count = -1)void_vioState_set(SV *buffer) POSTCALL: XSRETURN_YES;SV*vioFont( int type = 0, OUTLIST int w, OUTLIST int h)voidvioFont_set(SV *buffer, int cellwidth, int cellheight, int type = 0) POSTCALL: XSRETURN_YES;NO_OUTPUT bool_ClipbrdData_set(unsigned long ulData, unsigned long fmt = CF_TEXT, unsigned long rgfFmtInfo = default_fmtInfo(fmt), HAB hab = perl_hab_GET()) PROTOTYPE: DISABLE C_ARGS: hab, ulData, fmt, rgfFmtInfo POSTCALL: if (CheckWinError(RETVAL)) croak_with_os2error("_ClipbrdData_set() error"); XSRETURN_YES;voidClipbrdData_set(SV *text, int convert_nl = 1, unsigned long fmt = CF_TEXT, unsigned long rgfFmtInfo = default_fmtInfo(fmt), HAB hab = perl_hab_GET()) PROTOTYPE: DISABLE POSTCALL: XSRETURN_YES;voidClipbrdOwner_set(HWND hwnd, HAB hab = perl_hab_GET()) C_ARGS: hab, hwnd POSTCALL: XSRETURN_YES;voidClipbrdViewer_set(HWND hwnd, HAB hab = perl_hab_GET()) C_ARGS: hab, hwnd POSTCALL: XSRETURN_YES;unsigned longEnumClipbrdFmts(unsigned long fmt = 0, HAB hab = perl_hab_GET()) C_ARGS: hab, fmtunsigned longAddAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable()) C_ARGS: hAtomTbl, pszAtomNameunsigned longFindAtom(char *pszAtomName, HATOMTBL hAtomTbl = QuerySystemAtomTable()) C_ARGS: hAtomTbl, pszAtomNameunsigned long_DeleteAtom(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable()) PROTOTYPE: DISABLE C_ARGS: hAtomTbl, atom#if 0unsigned longWinDeleteAtom(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable()) C_ARGS: hAtomTbl, atom#endifvoidAlarm(unsigned long rgfType = WA_ERROR, HWND hwndDesktop = HWND_DESKTOP) C_ARGS: hwndDesktop, rgfType POSTCALL: XSRETURN_YES;voidFlashWindow(HWND hwndFrame, bool fFlash) POSTCALL: XSRETURN_YES;STRLENStrLen(ULONG addr, ULONG lim, I32 unitsize = 1)MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myQuerySV *myQueryWindowText(HWND hwnd)SV *myQueryClassName(HWND hwnd)MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = Queryunsigned longQueryFocusWindow(HWND hwndDesktop = HWND_DESKTOP)longQueryWindowTextLength(HWND hwnd)SV *QueryWindowSWP(HWND hwnd)unsigned longQueryWindowULong(HWND hwnd, long index)unsigned shortQueryWindowUShort(HWND hwnd, long index)unsigned longQueryActiveWindow(HWND hwnd = HWND_DESKTOP)unsigned longQueryDesktopWindow(HAB hab = Acquire_hab(), unsigned long hdc = NULLHANDLE)unsigned longQueryClipbrdData(unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET()) C_ARGS: hab, fmt PROTOTYPE: DISABLEULONGQueryMemoryRegionSize(ULONG addr, OUTLIST ULONG flagp, ULONG len = 0xFFFFFFFF - addr, I32 interrupt = 1)unsigned longQueryClipbrdViewer(HAB hab = perl_hab_GET())unsigned longQueryClipbrdOwner(HAB hab = perl_hab_GET())voidCloseClipbrd(HAB hab = perl_hab_GET()) POSTCALL: XSRETURN_YES;voidEmptyClipbrd(HAB hab = perl_hab_GET()) POSTCALL: XSRETURN_YES;boolOpenClipbrd(HAB hab = perl_hab_GET())unsigned longQueryAtomUsage(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable()) C_ARGS: hAtomTbl, atomunsigned longQueryAtomLength(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable()) C_ARGS: hAtomTbl, atom POSTCALL: if (!RETVAL) XSRETURN_EMPTY;unsigned longQuerySystemAtomTable()unsigned longQuerySysPointer(long lId, bool fCopy = 1, HWND hwndDesktop = HWND_DESKTOP) C_ARGS: hwndDesktop, lId, fCopyunsigned longCreateAtomTable(unsigned long initial = 0, unsigned long buckets = 0)unsigned long_DestroyAtomTable(HATOMTBL hAtomTbl) PROTOTYPE: DISABLEMODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQueryunsigned longmyWinQueryWindowPtr(HWND hwnd, long index)NO_OUTPUT BOOLmyWinQueryWindowProcess(HWND hwnd, OUTLIST unsigned long pid, OUTLIST unsigned long tid) PROTOTYPE: $ POSTCALL: if (CheckWinError(RETVAL)) croak_with_os2error("WindowProcess() error");SV *myWinQueryActiveDesktopPathname()voidmyWinQueryClipbrdFmtInfo(OUTLIST unsigned long prgfFmtInfo, unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET()) C_ARGS: hab, fmt, &prgfFmtInfoSV *myWinQueryAtomName(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinintmyWinSwitchToProgram(HSWITCH hsw = switch_of(NULLHANDLE, getpid())) PREINIT: ULONG rc;#if 0unsigned longmyWinMessageBox(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) C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle#endifunsigned long_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) C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle POSTCALL: if (RETVAL == MBID_ERROR) RETVAL = 0;unsigned long_MessageBox2(char *pszText, char* pmb2info, char *pszCaption = "Perl script message", HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0) C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, (PMB2INFO)pmb2info POSTCALL: if (RETVAL == MBID_ERROR) RETVAL = 0;MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQueryMODULE = OS2::Process PACKAGE = OS2::Process PREFIX = getintgetppid()intppidOf(int pid = getpid())intsidOf(int pid = getpid())voidgetscrsize(OUTLIST int wp, OUTLIST int hp) PROTOTYPE:boolscrsize_set(int w_or_h, int h = -9999)voidget_InvalidateRect(HWND hwnd, char *prcl, bool fIncludeChildren)voidget_CreateFrameControls(HWND hwndFrame, char *pfcdata, char* pszTitle)MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = ulunsigned longulMPFROMSHORT(unsigned short i)unsigned longulMPVOID()unsigned longulMPFROMCHAR(unsigned char i)unsigned longulMPFROM2SHORT(unsigned short x1, unsigned short x2) PROTOTYPE: DISABLEunsigned longulMPFROMSH2CH(unsigned short s, unsigned char c1, unsigned char c2) PROTOTYPE: DISABLEunsigned longulMPFROMLONG(unsigned long x)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -