#NoTrayIcon $sversionnumber = "2.1.0.0" Global Const $tageventlogrecord = "dword Length;dword Reserved;dword RecordNumber;dword TimeGenerated;dword TimeWritten;dword EventID;" & "word EventType;word NumStrings;word EventCategory;word ReservedFlags;dword ClosingRecordNumber;dword StringOffset;" & "dword UserSidLength;dword UserSidOffset;dword DataLength;dword DataOffset" Global Const $tagnmlvcustomdraw = "struct;" & $tagnmhdr & ";dword dwDrawStage;handle hdc;" & $tagrect & ";dword_ptr dwItemSpec;uint uItemState;lparam lItemlParam;endstruct" & ";dword clrText;dword clrTextBk;int iSubItem;dword dwItemType;dword clrFace;int iIconEffect;" & "int iIconPhase;int iPartId;int iStateId;struct;long TextLeft;long TextTop;long TextRight;long TextBottom;endstruct;uint uAlign" Global Const $tagnmselchange = $tagnmhdr & ";struct;word BegYear;word BegMonth;word BegDOW;word BegDay;word BegHour;word BegMinute;word BegSecond;word BegMSeconds;endstruct;" & "struct;word EndYear;word EndMonth;word EndDOW;word EndDay;word EndHour;word EndMinute;word EndSecond;word EndMSeconds;endstruct" Global Const $tagnmtreeview = $tagnmhdr & ";uint Action;" & "struct;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;endstruct;" & "struct;uint NewMask;handle NewhItem;uint NewState;uint NewStateMask;" & "ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;lparam NewParam;endstruct;" & "struct;long PointX;long PointY;endstruct" Global Const $tagrebarbandinfo = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;" & "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;" & "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader" & ((@OSVersion = "WIN_XP") ? "" : ";" & $tagrect & ";uint uChevronState") Global Const $tagopenfilename = "dword StructSize;hwnd hwndOwner;handle hInstance;ptr lpstrFilter;ptr lpstrCustomFilter;" & "dword nMaxCustFilter;dword nFilterIndex;ptr lpstrFile;dword nMaxFile;ptr lpstrFileTitle;dword nMaxFileTitle;" & "ptr lpstrInitialDir;ptr lpstrTitle;dword Flags;word nFileOffset;word nFileExtension;ptr lpstrDefExt;lparam lCustData;" & "ptr lpfnHook;ptr lpTemplateName;ptr pvReserved;dword dwReserved;dword FlagsEx" Global Const $tagtextmetric = "long tmHeight;long tmAscent;long tmDescent;long tmInternalLeading;long tmExternalLeading;" & "long tmAveCharWidth;long tmMaxCharWidth;long tmWeight;long tmOverhang;long tmDigitizedAspectX;long tmDigitizedAspectY;" & "wchar tmFirstChar;wchar tmLastChar;wchar tmDefaultChar;wchar tmBreakChar;byte tmItalic;byte tmUnderlined;byte tmStruckOut;" & "byte tmPitchAndFamily;byte tmCharSet" DllStructSetData($tchoose, "Flags", BitOR($__miscconstant_cc_anycolor, $__miscconstant_cc_fullopen, $__miscconstant_cc_rgbinit)) Return $scolor_picked __misc_releasedc(0, $hdc) DllStructSetData($tchoosefont, "Flags", BitOR($cf_screenfonts, $cf_printerfonts, $cf_effects, $cf_inittologfontstruct, $cf_noscriptsel)) Return StringSplit($iattributes & "," & $sfacename & "," & $isize & "," & $iweight & "," & $icolorref & "," & "0x" & $scolor_picked & "," & "0x" & StringMid($scolor_picked, 5, 2) & StringMid($scolor_picked, 3, 2) & StringMid($scolor_picked, 1, 2), ",") $sfile &= $sseparator & $sseparator $ierror = 2 $ilasterror = _winapi_getlasterror() $aresult = DllCall("kernel32.dll", "handle", "GlobalAlloc", "uint", $gmem_moveable, "ulong_ptr", $nglobmemsize) $ierror = 3 $ilasterror = _winapi_getlasterror() $ierror = 4 $ilasterror = _winapi_getlasterror() Local $tdropfiles = DllStructCreate("dword pFiles;" & $tagpoint & ";bool fNC;bool fWide;wchar[" & StringLen($sfile) + 1 & "]", $hlock) If DllStructGetData($tdropfiles, 6, $i) = $sseparator Then DllStructSetData($tdropfiles, 6, Chr(0), $i) $aresult = DllCall("user32.dll", "handle", "SetClipboardData", "uint", $cf_hdrop, "handle", $hglobal) $ierror = 6 $ilasterror = _winapi_getlasterror() $ierror = 8 $ilasterror = _winapi_getlasterror() $ierror = 9 $ilasterror = _winapi_getlasterror() $iright = $ileft + 1 $ibottom = $itop + 1 $aret = DllCall("advapi32.dll", "bool", "SetSecurityDescriptorDacl", "struct*", $tsecuritydescriptor, "bool", 1, "ptr", 0, "bool", 0) Global Enum $tokenuser = 1, $tokengroups, $tokenprivileges, $tokenowner, $tokenprimarygroup, $tokendefaultdacl, $tokensource, $tokentype, $tokenimpersonationlevel, $tokenstatistics, $tokenrestrictedsids, $tokensessionid, $tokengroupsandprivileges, $tokensessionreference, $tokensandboxinert, $tokenauditpolicy, $tokenorigin, $tokenelevationtype, $tokenlinkedtoken, $tokenelevation, $tokenhasrestrictions, $tokenaccessinformation, $tokenvirtualizationallowed, $tokenvirtualizationenabled, $tokenintegritylevel, $tokenuiaccess, $tokenmandatorypolicy, $tokenlogonsid Func _security__adjusttokenprivileges($htoken, $bdisableall, $pnewstate, $ibufferlen, $pprevstate = 0, $prequired = 0) Func _security__createprocesswithtoken($htoken, $ilogonflags, $scommandline, $icreationflags, $scurdir, $tstartupinfo, $tprocess_information) Func _security__duplicatetokenex($hexistingtoken, $idesiredaccess, $iimpersonationlevel, $itokentype) Return "" $acall = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $htoken, "int", $iclass, "struct*", $tbuffer, "dword", DllStructGetSize($tbuffer), "dword*", 0) Return $tbuffer Local $acall = DllCall("advapi32.dll", "bool", "LookupAccountNameW", "wstr", $ssystem, "wstr", $saccount, "struct*", $tdata, "dword*", DllStructGetSize($tdata), "wstr", "", "dword*", DllStructGetSize($tdata), "int*", 0) $aacct[1] = $acall[5] $aacct[2] = $acall[7] Return $aacct $psid = _security__stringsidtosid($vsid) $psid = $vsid $aacct[0] = $acall[3] $aacct[1] = $acall[5] $aacct[2] = $acall[7] Return $aacct $hthread = $aresult[0] $htoken = _security__openthreadtoken($iaccess, $hthread, $bopenasself) Return $htoken Func _security__settokeninformation($htoken, $itokeninformation, $vtokeninformation, $itokeninformationlength) Local $ssid = DllStructGetData(DllStructCreate("wchar Text[" & $alen[0] + 1 & "]", $pstringsid), "Text") Return $ssid Switch $itype Case $sidtypeuser Return "User" Case $sidtypegroup Return "Group" Case $sidtypedomain Return "Domain" Case $sidtypealias Return "Alias" Case $sidtypewellknowngroup Return "Well Known Group" Case $sidtypedeletedaccount Return "Deleted Account" Case $sidtypeinvalid Return "Invalid" Case $sidtypeunknown Return "Unknown Type" Case $sidtypecomputer Return "Computer" Case $sidtypelabel Return "A mandatory integrity label SID" Return "Unknown SID Type" Return $tsid Func _sendmessage($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult") Return $aresult Func _sendmessagea($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult") Return $aresult Return $tpoint Case $cderr_dialogfailure Case $cderr_findresfailure Case $cderr_initialization Case $cderr_loadresfailure Case $cderr_loadstrfailure Case $cderr_lockresfailure Case $cderr_memallocfailure Case $cderr_memlockfailure Case $cderr_nohinstance Case $cderr_nohook Case $cderr_notemplate Case $cderr_registermsgfail Case $cderr_structsize Case $fnerr_buffertoosmall Return SetError($aresult[0], 0, "The buffer pointed to by the lpstrFile member of the OPENFILENAME structure is too small for the file name specified by the user." & @LF & "The first two bytes of the lpstrFile buffer contain an integer value specifying the size, in TCHARs, required to receive the full name.") Case $fnerr_invalidfilename Case $fnerr_subclassfailure $sname = 0 $snametype = "ptr" Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iattributes = 0, $psecurity = 0) Switch $icreation Case 0 $icd = $create_new Case 1 $icd = $create_always Case 2 $icd = $open_existing Case 3 $icd = $open_always Case 4 $icd = $truncate_existing Func _winapi_createfont($iheight, $iwidth, $iescape = 0, $iorientn = 0, $iweight = $__winapiconstant_fw_normal, $bitalic = False, $bunderline = False, $bstrikeout = False, $icharset = $__winapiconstant_default_charset, $ioutputprec = $__winapiconstant_out_default_precis, $iclipprec = $__winapiconstant_clip_default_precis, $iquality = $__winapiconstant_default_quality, $ipitch = 0, $sface = "Arial") Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontW", "int", $iheight, "int", $iwidth, "int", $iescape, "int", $iorientn, "int", $iweight, "dword", $bitalic, "dword", $bunderline, "dword", $bstrikeout, "dword", $icharset, "dword", $ioutputprec, "dword", $iclipprec, "dword", $iquality, "dword", $ipitch, "wstr", $sface) Func _winapi_createprocess($sappname, $scommand, $psecurity, $pthread, $binherit, $iflags, $penviron, $sdir, $pstartupinfo, $pprocess) $sappnametype = "ptr" $sappname = 0 $sdirtype = "ptr" $sdir = 0 Func _winapi_createroundrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect, $iwidthellipse, $iheightellipse) _winapi_deleteobject($hbitmap) $hbitmap = 0 _winapi_deleteobject($hbrush) _winapi_releasedc($hwnd, $hdc) _winapi_selectobject($hdestdc, $hold) _winapi_deletedc($hdestdc) Return $hbitmap Func _winapi_createwindowex($iexstyle, $sclass, $sname, $istyle, $ix, $iy, $iwidth, $iheight, $hparent, $hmenu = 0, $hinstance = 0, $pparam = 0) Func _winapi_drawiconex($hdc, $ix, $iy, $hicon, $iwidth = 0, $iheight = 0, $istep = 0, $hbrush = 0, $iflags = 3) Local $ioptions Switch $iflags Case 1 $ioptions = $di_mask Case 2 $ioptions = $di_image Case 3 $ioptions = $di_normal Case 4 $ioptions = $di_compat Case 5 $ioptions = $di_defaultsize $ioptions = $di_nomirror _winapi_moveto($hdc, $ix1, $iy1) _winapi_lineto($hdc, $ix2, $iy2) Func _winapi_duplicatehandle($hsourceprocesshandle, $hsourcehandle, $htargetprocesshandle, $idesiredaccess, $binherithandle, $ioptions) $adevice[3] = $iflags Return $adevice __winapi_enumwindowsinit() __winapi_enumwindowschild($hwnd, $bvisible) Return $__g_awinlist_winapi $__g_awinlist_winapi[0][0] += 1 $__g_awinlist_winapi[0][1] += 64 $__g_awinlist_winapi[$icount][0] = $hwnd $__g_awinlist_winapi[$icount][1] = $sclass $hwnd = _winapi_getwindow($hwnd, $gw_child) __winapi_enumwindowsadd($hwnd) __winapi_enumwindowschild($hwnd, $bvisible) $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext) $__g_awinlist_winapi[0][0] = 0 $__g_awinlist_winapi[0][1] = 64 __winapi_enumwindowsinit() Local $sclass $sclass = _winapi_getclassname($hwnd) __winapi_enumwindowsadd($hwnd) __winapi_enumwindowsadd($hwnd) __winapi_enumwindowsadd($hwnd) __winapi_enumwindowschild($hwnd) $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext) Return $__g_awinlist_winapi __winapi_enumwindowsinit() $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext) Return $__g_awinlist_winapi Local $aresult $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "struct*", $prect, "handle", $hbrush) $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "struct*", $prect, "dword_ptr", $hbrush) Return $trect Return $acursor Return $aicon _winapi_localfree($pbuffer) Return $stext $itranscolor = -1 $itransparency = -1 $itranscolor = $aresult[2] $itransparency = $aresult[3] $smodulename = 0 $smodulenametype = "ptr" Return $tpoint Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0) $asfilter[0] = $asflines[0] * 2 $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), $str_stripleading + $str_striptrailing) $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), $str_stripleading + $str_striptrailing) $inulls += 1 $inulls = 0 $ibytes = $aresult[3] $amask[1] = $aresult[2] $amask[2] = $aresult[3] Return $amask Func _winapi_getsavefilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0) $asfilter[0] = $asflines[0] * 2 $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), $str_stripleading + $str_striptrailing) $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), $str_stripleading + $str_striptrailing) Return $tsize Return $ttextmetric Return $twindowplacement Return $trect $ipid = $aresult[2] Return $amem _winapi_guidfromstringex($sguid, $tguid) Return $tguid $hlastwnd = $hwnd Local $ipid _winapi_getwindowthreadprocessid($hwnd, $ipid) $__g_ainprocess_winapi[0][0] = $icount $__g_ainprocess_winapi[$icount][0] = $hwnd If StringUpper(StringMid($sclasscheck, 1, StringLen($aclassname[$x]))) = StringUpper($aclassname[$x]) Then Return True $aresult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $hinstance, $simagetype, $simage, "uint", $itype, "int", $ixdesired, "int", $iydesired, "uint", $iload) Local $isound Switch $itype Case 1 $isound = 0 Case 2 $isound = 16 Case 3 $isound = 32 Case 4 $isound = 48 Case 5 $isound = 64 $isound = -1 DllCall("user32.dll", "none", "mouse_event", "dword", $iflags, "dword", $ix, "dword", $iy, "dword", $idata, "ulong_ptr", $iextrainfo) $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $stext, "int", -1, "struct*", $tout, "int", $iout) Return $tout $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $ipid) _winapi_closehandle($htoken) $afiles[0] = 2 $afiles[1] = $stemp Return $afiles $ix1 = $ix1 + (($ix2 - $ix1) / 2) $iy1 = $iy1 + (($iy2 - $iy1) / 2) Return $tpoint $iread = $aresult[4] $iread = $aresult[5] Return (DllStructGetData($trect, "Left") = 0) AND (DllStructGetData($trect, "Top") = 0) AND (DllStructGetData($trect, "Right") = 0) AND (DllStructGetData($trect, "Bottom") = 0) _sendmessage($hwnd, $__winapiconstant_wm_setfont, $hfont, $bredraw, 0, "hwnd") Local $ielementnum $ielementnum = 1 _winapi_setlasterror(0) _winapi_msgbox($mb_systemmodal, "Error", $stext) _winapi_msgbox($mb_systemmodal, "Information", $stext) $hdc = _winapi_getdc(0) $itwipsperpixelx = 1440 / _winapi_getdevicecaps($hdc, $__winapiconstant_logpixelsx) _winapi_releasedc(0, $hdc) Return $itwipsperpixelx $hdc = _winapi_getdc(0) $itwipsperpixely = 1440 / _winapi_getdevicecaps($hdc, $__winapiconstant_logpixelsy) _winapi_releasedc(0, $hdc) Return $itwipsperpixely Func _winapi_updatelayeredwindow($hwnd, $hdcdest, $pptdest, $psize, $hdcsrce, $pptsrce, $irgb, $pblend, $iflags) $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "struct*", $tmultibyte, "int", $aresult[0], "ptr", 0, "ptr", 0) Return $tmultibyte $iwritten = $aresult[4] $iwritten = $aresult[5] Local $label1, $hsection, $label10, $hfriendly, $hprocess, $label11, $label12, $hstyle, $hidentifier, $label2, $hidentifierdel, $label7, $hwidth, $label8, $hheight, $label13, $label14, $hposx, $label15, $hposy, $hsave, $happly, $hmanagemouse, $hmousewindow, $hmousehide, $hdelete, $a, $s, $i, $nmsg $hsection = GUICtrlCreateCombo("", 120, 26, 265, 25, BitOR($gui_ss_default_combo, $cbs_simple, $ws_hscroll, 256)) $hwidth = GUICtrlCreateInput("", 120, 252, 57, 24, BitOR($gui_ss_default_input, $es_center, $es_number)) $hheight = GUICtrlCreateInput("", 208, 252, 57, 24, BitOR($gui_ss_default_input, $es_center, $es_number)) While 1 Switch $nmsg Case $gui_event_close Case $hsection $sactivegame = _gs_getcurrentsection($hsection, $agamelist) Case $hfriendly $agamelist = _gs_getgames($hsection) Case $hidentifierdel GUICtrlSetData($hidentifier, StringRegExpReplace(GUICtrlRead($hidentifier), "(?i)(Title\:.*;Class)", "Class")) $agamelist = _gs_getgames($hsection) $sactivegame = _gs_getcurrentsection($hsection, $agamelist) Case $hwidth Case $hheight Case $hposx Case $hposy Case $hsave Case $hmanagemouse Case $hmousewindow Case $hmousehide Case $hdelete $agamelist = _gs_getgames($hsection) $sactivegame = _gs_getcurrentsection($hsection, $agamelist) Case $happly _gs_apply($sactivegame) _winapi_setwindowlong($hwnd, -16, -2147483648 + 268435456 + 131072) $areturn[$i][0] = $asections[$i] $areturn[$i][1] = _gs_getuniquefriendlyname(StringRegExpReplace($asections[$i], "(Title\:)|(\;*Class\:.{1,})", "")) $s &= $areturn[$i][1] & "|" GUICtrlSetData($hcontrol, $s, IniRead($sini, "Global_Config", "LastUsed", $areturn[UBound($areturn) - 1][1])) Return $areturn $asections[0] = "" Local $i While 1 $a[0] = $ahexkeys[$i] $a[1] = $ahexkeys[$i] Return $a Local $areturn Dim $areturn[103] = ["08", "09", "0D", "11", "12", "13", "14", "1B", "20", "21", "22", "23", "24", "25", "26", "27", "28", "2C", "2D", "2E", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "90", "91", "A0", "A1", "A2", "A3", "BA", "BB", "BC", "BD", "BE", "BF", "C0", "DB", "DC", "DD"] Dim $areturn[103] = ["Backspace", "TAB", "ENTER", "CTRL", "ALT", "PAUSE", "CAPS LOCK", "ESC", "SPACEBAR", "PAGE UP", "PAGE DOWN", "END", "HOME", "LEFT ARROW", "UP ARROW", "RIGHT ARROW", "DOWN ARROW", "PRINT SCREEN", "INS", "DEL", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Left Windows key", "Right Windows key", "NUMPAD 0", "NUMPAD 1", "NUMPAD 2", "NUMPAD 3", "NUMPAD 4", "NUMPAD 5", "NUMPAD 6", "NUMPAD 7", "NUMPAD 8", "NUMPAD 9", "NUMPAD *", "NUMPAD +", "Separator", "NUMPAD -", "NUMPAD .", "NUMPAD /", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "NUM LOCK", "SCROLL LOCK", "Left SHIFT", "Right SHIFT", "Left CONTROL", "Right CONTROL", ";", "=", ",", "-", ".", "/", "`", "[", "\", "]"] Dim $areturn[103] = ["{BACKSPACE}", "{TAB}", "{ENTER}", "{LCTRL}", "{ALT}", "{PAUSE}", "{CAPSLOCK off}", "{ESC}", "{SPACE}", "{PGUP}", "{PGDN}", "{END}", "{HOME}", "{LEFT}", "{UP}", "{RIGHT}", "{DOWN}", "{PRINTSCREEN}", "{INS}", "{DEL}", "{0}", "{1}", "{2}", "{3}", "{4}", "{5}", "{6}", "{7}", "{8}", "{9}", "{a}", "{b}", "{c}", "{d}", "{e}", "{f}", "{g}", "{h}", "{i}", "{j}", "{k}", "{l}", "{m}", "{n}", "{o}", "{p}", "{q}", "{r}", "{s}", "{t}", "{u}", "{v}", "{w}", "{x}", "{y}", "{z}", "{LWIN}", "{RWIN}", "{NUMPAD0}", "{NUMPAD1}", "{NUMPAD2}", "{NUMPAD3}", "{NUMPAD4}", "{NUMPAD5}", "{NUMPAD6}", "{NUMPAD7}", "{NUMPAD8}", "{NUMPAD9}", "{NUMPADMULT}", "{NUMPADADD}", "{|}", "{NUMPADSUB}", "{NUMPADDOT}", "{NUMPADDIV}", "{F1}", "{F2}", "{F3}", "{F4}", "{F5}", "{F6}", "{F7}", "{F8}", "{F9}", "{F10}", "{F11}", "{F12}", "{NUMLOCK on}", "{SCROLLLOCK toggle}", "{LSHIFT}", "{LSHIFT}", "{LCTRL}", "{RCTRL}", "{;}", "{=}", "{,}", "{-}", "{.}", "{/}", "{`}", "{[}", "{\}", "{]}"] Dim $areturn[103] = ["{BACKSPACE down}", "{TAB down}", "{ENTER down}", "{LCTRL down}", "{ALTDOWN}", "{PAUSE down}", "{CAPSLOCK down}", "{ESC down}", "{SPACE down}", "{PGUP down}", "{PGDN down}", "{END down}", "{HOME down}", "{LEFT down}", "{UP down}", "{RIGHT down}", "{DOWN down}", "{PRINTSCREEN down}", "{INS down}", "{DEL down}", "{0 down}", "{1 down}", "{2 down}", "{3 down}", "{4 down}", "{5 down}", "{6 down}", "{7 down}", "{8 down}", "{9 down}", "{a down}", "{b down}", "{c down}", "{d down}", "{e down}", "{f down}", "{g down}", "{h down}", "{i down}", "{j down}", "{k down}", "{l down}", "{m down}", "{n down}", "{o down}", "{p down}", "{q down}", "{r down}", "{s down}", "{t down}", "{u down}", "{v down}", "{w down}", "{x down}", "{y down}", "{z down}", "{LWINDOWN}", "{RWINDOWN}", "{NUMPAD0 down}", "{NUMPAD1 down}", "{NUMPAD2 down}", "{NUMPAD3 down}", "{NUMPAD4 down}", "{NUMPAD5 down}", "{NUMPAD6 down}", "{NUMPAD7 down}", "{NUMPAD8 down}", "{NUMPAD9 down}", "{NUMPADMULT down}", "{NUMPADADD down}", "{| down}", "{NUMPADSUB down}", "{NUMPADDOT down}", "{NUMPADDIV down}", "{F1 down}", "{F2 down}", "{F3 down}", "{F4 down}", "{F5 down}", "{F6 down}", "{F7 down}", "{F8 down}", "{F9 down}", "{F10 down}", "{F11 down}", "{F12 down}", "{NUMLOCK down}", "{SCROLLLOCK down}", "{LSHIFT down}", "{LSHIFT down}", "{LCTRL down}", "{RCTRL down}", "{; down}", "{= down}", "{, down}", "{- down}", "{. down}", "{/ down}", "{` down}", "{[ down}", "{\ down}", "{] down}"] Dim $areturn[103] = ["{BACKSPACE up}", "{TAB up}", "{ENTER up}", "{LCTRL up}", "{ALTUP}", "{PAUSE up}", "{CAPSLOCK up}", "{ESC up}", "{SPACE up}", "{PGUP up}", "{PGDN up}", "{END up}", "{HOME up}", "{LEFT up}", "{UP up}", "{RIGHT up}", "{DOWN up}", "{PRINTSCREEN up}", "{INS up}", "{DEL up}", "{0 up}", "{1 up}", "{2 up}", "{3 up}", "{4 up}", "{5 up}", "{6 up}", "{7 up}", "{8 up}", "{9 up}", "{a up}", "{b up}", "{c up}", "{d up}", "{e up}", "{f up}", "{g up}", "{h up}", "{i up}", "{j up}", "{k up}", "{l up}", "{m up}", "{n up}", "{o up}", "{p up}", "{q up}", "{r up}", "{s up}", "{t up}", "{u up}", "{v up}", "{w up}", "{x up}", "{y up}", "{z up}", "{LWINUP}", "{RWINUP}", "{NUMPAD0 up}", "{NUMPAD1 up}", "{NUMPAD2 up}", "{NUMPAD3 up}", "{NUMPAD4 up}", "{NUMPAD5 up}", "{NUMPAD6 up}", "{NUMPAD7 up}", "{NUMPAD8 up}", "{NUMPAD9 up}", "{NUMPADMULT up}", "{NUMPADADD up}", "{| up}", "{NUMPADSUB up}", "{NUMPADDOT up}", "{NUMPADDIV up}", "{F1 up}", "{F2 up}", "{F3 up}", "{F4 up}", "{F5 up}", "{F6 up}", "{F7 up}", "{F8 up}", "{F9 up}", "{F10 up}", "{F11 up}", "{F12 up}", "{NUMLOCK up}", "{SCROLLLOCK up}", "{LSHIFT up}", "{LSHIFT up}", "{LCTRL up}", "{RCTRL up}", "{; up}", "{= up}", "{, up}", "{- up}", "{. up}", "{/ up}", "{` up}", "{[ up}", "{\ up}", "{] up}"] Return $areturn _singleton($sfriendlyname & "GlobalSettings") $s = _ispressedfriendlyname($ikeybind1_addwindow) Local $hautosetresolution = GUICtrlCreateCheckbox("Automatically set resolution in the game's settings", 10, 50, 321, 25) If IniRead($sini, "Global_Config", "AutoSetResolution", "never") = "always" Then GUICtrlSetState(-1, $gui_checked) Local $hdefaultdesktopwidth = GUICtrlCreateInput(IniRead($sini, "Global_Config", "DefaultDeskTopWidth", @DesktopWidth), 120, 75, 57, 24, BitOR($gui_ss_default_input, $es_center, $es_number)) Local $hdefaultdesktopheight = GUICtrlCreateInput(IniRead($sini, "Global_Config", "DefaultDeskTopHeight", @DesktopHeight), 208, 75, 57, 24, BitOR($gui_ss_default_input, $es_center, $es_number)) Local $hautosetoffset = GUICtrlCreateCheckbox("Automatically set offset in the game's settings", 10, 106, 321, 25) If IniRead($sini, "Global_Config", "AutoSetOffset", "never") = "always" Then GUICtrlSetState(-1, $gui_checked) Local $hdefaultposx = GUICtrlCreateInput(IniRead($sini, "Global_Config", "DefaultPosX", 0), 120, 131, 57, 24, BitOR($gui_ss_default_input, $es_center)) Local $hdefaultposy = GUICtrlCreateInput(IniRead($sini, "Global_Config", "DefaultPosY", 0), 208, 131, 57, 24, BitOR($gui_ss_default_input, $es_center)) Local $haddwindow_confirmationcheckbox1 = GUICtrlCreateCheckbox("Ask for confirmation before adding a window", 10, 155, 321, 25) If IniRead($sini, "Global_Config", "AddWindow_Confirmation", "never") = "always" Then GUICtrlSetState(-1, $gui_checked) Local $hforceborderlesskeyenabled = GUICtrlCreateCheckbox("Enable a keybind to re-trigger borderless mode", 10, 228, 321, 25) If IniRead($sini, "Global_Config", "ForceBorderlessKeyEnabled", "always") = "always" Then GUICtrlSetState(-1, $gui_checked) $s = _ispressedfriendlyname($ikeybind1_forceborderless) $s = _ispressedfriendlyname($ikeybind2_forceborderless) Local $hforcekeychecktitlealways = GUICtrlCreateRadio("Check for window name, class and process", 10, 288, 305, 25) If IniRead($sini, "Global_Config", "ForceKeyCheckTitle", "always") = "always" Then GUICtrlSetState(-1, $gui_checked) Local $hforcekeychecktitlenever = GUICtrlCreateRadio("Check for window class and process", 10, 313, 313, 25) If IniRead($sini, "Global_Config", "ForceKeyCheckTitle", "always") = "never" Then GUICtrlSetState(-1, $gui_checked) GUICtrlCreateLabel("How to recognise a window to make borderless", 10, 380, 386, 25, $ss_centerimage) Local $hforcetriggerchecktitlealways = GUICtrlCreateRadio("By window title, class and process name", 10, 405, 290, 25) If IniRead($sini, "Global_Config", "ForceTriggerCheckTitle", "always") = "always" Then GUICtrlSetState(-1, $gui_checked) Local $hforcetriggerchecktitlenever = GUICtrlCreateRadio("By window class and process name", 10, 430, 290, 25) If IniRead($sini, "Global_Config", "ForceTriggerCheckTitle", "always") = "never" Then GUICtrlSetState(-1, $gui_checked) While 1 Switch $nmsg Case $gui_event_close Case $hkeybind1_addwindow _keyinputbtn($ikeybind1_addwindow, $hkeybind1_addwindow) Case $hautosetresolution Case $hdefaultdesktopwidth Case $hdefaultdesktopheight Case $hautosetoffset Case $hdefaultposx Case $hdefaultposy Case $haddwindow_confirmationcheckbox1 Case $hforceborderlesskeyenabled Case $hkeybind1_forceborderless _keyinputbtn($ikeybind1_forceborderless, $hkeybind1_forceborderless) $ikeybind2_forceborderless = $ikeybind1_forceborderless Case $hkeybind2_forceborderless _keyinputbtn($ikeybind2_forceborderless, $hkeybind2_forceborderless) Case $hforcekeychecktitlealways Case $hforcekeychecktitlenever Case $hforcetriggerchecktitlealways Case $hforcetriggerchecktitlenever Case $hsave Local $acontrols[15] = [$ikeybind1_addwindow, $hautosetresolution, $hdefaultdesktopwidth, $hdefaultdesktopheight, $hautosetoffset, $hdefaultposx, $hdefaultposy, $haddwindow_confirmationcheckbox1, $hforceborderlesskeyenabled, $ikeybind1_forceborderless, $ikeybind2_forceborderless, $hforcekeychecktitlealways, $hforcekeychecktitlenever, $hforcetriggerchecktitlealways, $hforcetriggerchecktitlenever] _saveglobalsettings($acontrols) Case $hcancel GUICtrlCreateLabel("Click a button on your keyboard", 0, 0, 415, 128, BitOR($ss_center, $ss_centerimage)) $a = _ispressedfriendlyuserinput() If GUICtrlRead($acontrols[1]) = $gui_checked Then IniWrite($sini, "Global_Config", "AutoSetResolution", "always") If GUICtrlRead($acontrols[1]) = $gui_unchecked Then IniWrite($sini, "Global_Config", "AutoSetResolution", "never") If GUICtrlRead($acontrols[4]) = $gui_checked Then IniWrite($sini, "Global_Config", "AutoSetOffset", "always") If GUICtrlRead($acontrols[4]) = $gui_unchecked Then IniWrite($sini, "Global_Config", "AutoSetOffset", "never") If GUICtrlRead($acontrols[7]) = $gui_checked Then IniWrite($sini, "Global_Config", "AddWindow_Confirmation", "always") If GUICtrlRead($acontrols[7]) = $gui_unchecked Then IniWrite($sini, "Global_Config", "AddWindow_Confirmation", "never") If GUICtrlRead($acontrols[8]) = $gui_checked Then IniWrite($sini, "Global_Config", "ForceBorderlessKeyEnabled", "always") If GUICtrlRead($acontrols[8]) = $gui_unchecked Then IniWrite($sini, "Global_Config", "ForceBorderlessKeyEnabled", "never") If GUICtrlRead($acontrols[11]) = $gui_checked Then IniWrite($sini, "Global_Config", "ForceKeyCheckTitle", "always") If GUICtrlRead($acontrols[12]) = $gui_checked Then IniWrite($sini, "Global_Config", "ForceKeyCheckTitle", "never") If GUICtrlRead($acontrols[13]) = $gui_checked Then IniWrite($sini, "Global_Config", "ForceTriggerCheckTitle", "always") If GUICtrlRead($acontrols[14]) = $gui_checked Then IniWrite($sini, "Global_Config", "ForceTriggerCheckTitle", "never") Local $a $istate = -1 _mousetrap() $istate = 2 _mousetrap($a[0], $a[1], $a[0] + $a[2], $a[1] + $a[3]) $istate = 2 _mousetrap(($a[0] + $a[2]) / 2, ($a[1] + $a[3]) - 1, ($a[0] + $a[2]) / 2, $a[1] + $a[3] - 1) Return $istate $ierror = 0 $sprocessname = $aprocesslist[$i][0] Case 64 $ireturn = 0 Case 16384 $ireturn = 1 Case 32 $ireturn = 2 Case 32768 $ireturn = 3 Case 128 $ireturn = 4 Case 256 $ireturn = 5 $ierror = 1 $iextended = $apriority[0] $ireturn = -1 _gs_settingsgui() _globalsettingsgui() _masterloop() _singleton($sfriendlyname) Local $hlog = TrayCreateItem("Add window ( " & _ispressedfriendlyname(IniRead($sini, "Global_Config", "KeyBind1_AddWindow", 72)) & " )") $idxwnddeclared = 1 While 1 _logwindow() $holdhwnd = "" If $msg = $hcheckupdates Then ShellExecute("http://westechsolutions.net/sites/WindowedBorderlessGaming/updates?v=" & $sversionnumber) If $msg = $hreadmanual Then ShellExecute("http://westechsolutions.net/sites/WindowedBorderlessGaming/manual") TrayItemSetText($hlog, "Add window ( " & _ispressedfriendlyname(IniRead($sini, "Global_Config", "KeyBind1_AddWindow", 72)) & " )") If FileExists(@ScriptDir & "\DXWnd\dxwnd.exe") Then Run('"' & @ScriptDir & "\DXWnd\dxwnd.exe" & '"', @ScriptDir & "\DXWnd") $holdhwnd = $hwnd $ssection = StringReplace("Title:" & WinGetTitle($hwnd) & ";Class:" & _winapi_getclassname($hwnd), "[", "[") $imouselock = _mouselock($ssection, $hwnd, $imouselock) If _processgetname(WinGetProcess($hwnd)) <> IniRead($sini, $ssection, "Process", "0") Then ContinueLoop If _winapi_getwindowlong($hwnd, -16) <> IniRead($sini, $ssection, "Style", "ERROR") Then ContinueLoop Dim $i Local $ssection = StringReplace("Title:" & WinGetTitle($hwnd) & ";Class:" & _winapi_getclassname($hwnd), "[", "[") Local $foo = Run(@ComSpec & " /c Schtasks /Query /fo list", @SystemDir, @SW_HIDE, $stderr_child + $stdout_child) Local $s While 1 Return 0 RunWait(@ComSpec & ' "/c" "schtasks" "/delete" "/tn" "WindowedBorderlessGaming-' & @UserName & '" "/f"', @SystemDir, @SW_HIDE) RunWait(@ComSpec & ' "/c" "schtasks" "/create" "/tn" "WindowedBorderlessGaming-' & @UserName & '" "/tr" "' & FileGetShortName(@ScriptFullPath) & '" "/sc" "ONLOGON" "/ru" "' & @UserName & '" "/it" "/rl" "HIGHEST"', @SystemDir, @SW_HIDE) While 1 _wingetinfo() IniWrite($sini, $ssection, "Width", IniRead($sini, "Global_Config", "DefaultDeskTopWidth", @DesktopWidth)) IniWrite($sini, $ssection, "Height", IniRead($sini, "Global_Config", "DefaultDeskTopHeight", @DesktopHeight)) _winsetborderless($hwnd, $a[0], $a[1], $a[2], $a[3], $ssection) Return 1 _inidelete($sini, $ssection) Return 0 _winapi_setwindowlong($hwnd, -16, -2147483648 + 268435456 + 131072) If IniRead($sini, $ssection, "Redraw", "always") = "always" Then WinSetState($hwnd, "", @SW_MINIMIZE)