WideBoyDixon
Active Members-
Posts
379 -
Joined
-
Last visited
-
Days Won
1
WideBoyDixon last won the day on June 1 2017
WideBoyDixon had the most liked content!
Profile Information
-
Member Title
Code Monkey
-
Location
Sheffield, UK
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
WideBoyDixon's Achievements
Universalist (7/7)
15
Reputation
-
wakillon reacted to a post in a topic:
Drag-and-drop reordering listbox
-
pat4005 reacted to a post in a topic:
3D Pie Chart
-
FourLC reacted to a post in a topic:
Converting decimal numbers to another base
-
SkysLastChance reacted to a post in a topic:
excel: autosize column width?
-
Xandy reacted to a post in a topic:
excel: autosize column width?
-
AnonymousX reacted to a post in a topic:
excel: autosize column width?
-
robertocm reacted to a post in a topic:
Screen Crosshairs
-
Seminko reacted to a post in a topic:
Calculate string similarity
-
argumentum reacted to a post in a topic:
advapi32.dll funktion ChangeServiceConfig2
-
Bidder reacted to a post in a topic:
advapi32.dll funktion ChangeServiceConfig2
-
Hi all, Other commitments have taken me away from this forum but today I had an itch that I needed to scratch and AutoIt came to my rescue. I wanted a quick script to arrange windows on my screen so I wrote the one here. It's probably flawed in many ways but I'll throw it here anyways ... The idea of the script is that you can use [Win]+[Ctrl]+[Numeric Keypad] to position the active window on your screen. Should be self explanatory as the window is positioned in the same place as the numeric keypad key that you use. Opt("MustDeclareVars", 1) Global $hDesktop = WinGetHandle("Program Manager") Global $hDLL = DllOpen("user32.dll") Global $gMonitorInfo = DllStructCreate("int;int[4];int[4];int;char[32]") DllStructSetData($gMonitorInfo, 1, DllStructGetSize($gMonitorInfo)) _SetHotKeys() While 1 Sleep(100) WEnd Func _SetHotKeys() Local $i For $i = 1 To 9 HotKeySet("#^{NUMPAD" & $i & "}", "_MoveWindow") Next HotKeySet("#^{NUMPAD0}", "_Quit") EndFunc ;==>_SetHotKeys Func _MoveWindow() Local $hWnd = WinGetHandle("[ACTIVE]") If $hWnd = $hDesktop Then Return If WinGetTitle($hWnd) = "" Then Return Local $winState = WinGetState($hWnd) If BitAND($winState, 7) <> 7 Then Return If BitAND($winState, 48) <> 0 Then Return Local $rWindow = WinGetPos($hWnd) Local $hMonitor = _GetMonitorFromPoint($rWindow[0], $rWindow[1]) If $hMonitor = 0 Then Return Local $rMonitor = _GetMonitorRect($hMonitor) Local $sKeyPressed = StringMid(@HotKeyPressed, 10, 1) If StringInStr("134679", $sKeyPressed) > 0 Then $rMonitor[2] /= 2 If StringInStr("123789", $sKeyPressed) > 0 Then $rMonitor[3] /= 2 If StringInStr("369", $sKeyPressed) > 0 Then $rMonitor[0] += $rMonitor[2] If StringInStr("123", $sKeyPressed) > 0 Then $rMonitor[1] += $rMonitor[3] WinMove($hWnd, "", $rMonitor[0], $rMonitor[1], $rMonitor[2], $rMonitor[3]) EndFunc ;==>_MoveWindow Func _GetMonitorFromPoint($iX, $iY) Local $aRet = DllCall($hDLL, "hwnd", "MonitorFromPoint", "int", $iX, "int", $iY, "int", 0) Return $aRet[0] EndFunc ;==>_GetMonitorFromPoint Func _GetMonitorRect($hMonitor) Local $aRet = DllCall($hDLL, "int", "GetMonitorInfo", "hwnd", $hMonitor, "ptr", DllStructGetPtr($gMonitorInfo)) Local $aRect[4] For $i = 1 To 4 $aRect[$i - 1] = DllStructGetData($gMonitorInfo, 3, $i) Next $aRect[2] -= $aRect[0] $aRect[3] -= $aRect[1] Return $aRect EndFunc ;==>_GetMonitorRect Func _Quit() DllClose($hDLL) Exit EndFunc ;==>_Quit Have fun. WBD
-
If might be more useful to compare the strings for how similar they are e.g. "stationary" and "stationery". See my original post here: http://www.autoitscript.com/forum/index.php?showtopic=40843&view=findpost&p=642358 for an implementation of Levenshtein. WBD
-
Been away from the forums for a while and I'm just looking through some posts when I came across this. Just wanted to say excellent work! WBD
-
Hi there. Nice work. Although not as comprehensive as your application, you might be able to pick up some other ideas from my "Hot Folders" script which you should be find by searching the forum. Regards, WBD
-
Nice one! Makes my stock tracker look better without me having to do anything >_< WBD
-
Sorry! Just found a couple more which I use in order to provide support for translation of my applications: ; =============================================================================================================================== ; _WinAPI_GetLocaleInfo() ; =============================================================================================================================== Global Const $LOCALE_NOUSEROVERRIDE = 0x80000000 ;// do not use user overrides Global Const $LOCALE_USE_CP_ACP = 0x40000000 ;// use the system ACP Global Const $LOCALE_RETURN_NUMBER = 0x20000000 ;// return number instead of string ; The following LCTypes are mutually exclusive in that they may NOT be used in combination with each other. Global Const $LOCALE_ILANGUAGE = 0x00000001 ;// language id Global Const $LOCALE_SLANGUAGE = 0x00000002 ;// localized name of language Global Const $LOCALE_SENGLANGUAGE = 0x00001001 ;// English name of language Global Const $LOCALE_SABBREVLANGNAME = 0x00000003 ;// abbreviated language name Global Const $LOCALE_SNATIVELANGNAME = 0x00000004 ;// native name of language Global Const $LOCALE_ICOUNTRY = 0x00000005 ;// country code Global Const $LOCALE_SCOUNTRY = 0x00000006 ;// localized name of country Global Const $LOCALE_SENGCOUNTRY = 0x00001002 ;// English name of country Global Const $LOCALE_SABBREVCTRYNAME = 0x00000007 ;// abbreviated country name Global Const $LOCALE_SNATIVECTRYNAME = 0x00000008 ;// native name of country Global Const $LOCALE_IDEFAULTLANGUAGE = 0x00000009 ;// default language id Global Const $LOCALE_IDEFAULTCOUNTRY = 0x0000000A ;// default country code Global Const $LOCALE_IDEFAULTCODEPAGE = 0x0000000B ;// default oem code page Global Const $LOCALE_IDEFAULTANSICODEPAGE = 0x00001004 ;// default ansi code page Global Const $LOCALE_IDEFAULTMACCODEPAGE = 0x00001011 ;// default mac code page Global Const $LOCALE_SLIST = 0x0000000C ;// list item separator Global Const $LOCALE_IMEASURE = 0x0000000D ;// 0 = metric, 1 = US Global Const $LOCALE_SDECIMAL = 0x0000000E ;// decimal separator Global Const $LOCALE_STHOUSAND = 0x0000000F ;// thousand separator Global Const $LOCALE_SGROUPING = 0x00000010 ;// digit grouping Global Const $LOCALE_IDIGITS = 0x00000011 ;// number of fractional digits Global Const $LOCALE_ILZERO = 0x00000012 ;// leading zeros for decimal Global Const $LOCALE_INEGNUMBER = 0x00001010 ;// negative number mode Global Const $LOCALE_SNATIVEDIGITS = 0x00000013 ;// native ascii 0-9 Global Const $LOCALE_SCURRENCY = 0x00000014 ;// local monetary symbol Global Const $LOCALE_SINTLSYMBOL = 0x00000015 ;// intl monetary symbol Global Const $LOCALE_SMONDECIMALSEP = 0x00000016 ;// monetary decimal separator Global Const $LOCALE_SMONTHOUSANDSEP = 0x00000017 ;// monetary thousand separator Global Const $LOCALE_SMONGROUPING = 0x00000018 ;// monetary grouping Global Const $LOCALE_ICURRDIGITS = 0x00000019 ;// # local monetary digits Global Const $LOCALE_IINTLCURRDIGITS = 0x0000001A ;// # intl monetary digits Global Const $LOCALE_ICURRENCY = 0x0000001B ;// positive currency mode Global Const $LOCALE_INEGCURR = 0x0000001C ;// negative currency mode Global Const $LOCALE_SDATE = 0x0000001D ;// date separator Global Const $LOCALE_STIME = 0x0000001E ;// time separator Global Const $LOCALE_SSHORTDATE = 0x0000001F ;// short date format string Global Const $LOCALE_SLONGDATE = 0x00000020 ;// long date format string Global Const $LOCALE_STIMEFORMAT = 0x00001003 ;// time format string Global Const $LOCALE_IDATE = 0x00000021 ;// short date format ordering Global Const $LOCALE_ILDATE = 0x00000022 ;// long date format ordering Global Const $LOCALE_ITIME = 0x00000023 ;// time format specifier Global Const $LOCALE_ITIMEMARKPOSN = 0x00001005 ;// time marker position Global Const $LOCALE_ICENTURY = 0x00000024 ;// century format specifier (short date) Global Const $LOCALE_ITLZERO = 0x00000025 ;// leading zeros in time field Global Const $LOCALE_IDAYLZERO = 0x00000026 ;// leading zeros in day field (short date) Global Const $LOCALE_IMONLZERO = 0x00000027 ;// leading zeros in month field (short date) Global Const $LOCALE_S1159 = 0x00000028 ;// AM designator Global Const $LOCALE_S2359 = 0x00000029 ;// PM designator Global Const $LOCALE_ICALENDARTYPE = 0x00001009 ;// type of calendar specifier Global Const $LOCALE_IOPTIONALCALENDAR = 0x0000100B ;// additional calendar types specifier Global Const $LOCALE_IFIRSTDAYOFWEEK = 0x0000100C ;// first day of week specifier Global Const $LOCALE_IFIRSTWEEKOFYEAR = 0x0000100D ;// first week of year specifier Global Const $LOCALE_SDAYNAME1 = 0x0000002A ;// long name for Monday Global Const $LOCALE_SDAYNAME2 = 0x0000002B ;// long name for Tuesday Global Const $LOCALE_SDAYNAME3 = 0x0000002C ;// long name for Wednesday Global Const $LOCALE_SDAYNAME4 = 0x0000002D ;// long name for Thursday Global Const $LOCALE_SDAYNAME5 = 0x0000002E ;// long name for Friday Global Const $LOCALE_SDAYNAME6 = 0x0000002F ;// long name for Saturday Global Const $LOCALE_SDAYNAME7 = 0x00000030 ;// long name for Sunday Global Const $LOCALE_SABBREVDAYNAME1 = 0x00000031 ;// abbreviated name for Monday Global Const $LOCALE_SABBREVDAYNAME2 = 0x00000032 ;// abbreviated name for Tuesday Global Const $LOCALE_SABBREVDAYNAME3 = 0x00000033 ;// abbreviated name for Wednesday Global Const $LOCALE_SABBREVDAYNAME4 = 0x00000034 ;// abbreviated name for Thursday Global Const $LOCALE_SABBREVDAYNAME5 = 0x00000035 ;// abbreviated name for Friday Global Const $LOCALE_SABBREVDAYNAME6 = 0x00000036 ;// abbreviated name for Saturday Global Const $LOCALE_SABBREVDAYNAME7 = 0x00000037 ;// abbreviated name for Sunday Global Const $LOCALE_SMONTHNAME1 = 0x00000038 ;// long name for January Global Const $LOCALE_SMONTHNAME2 = 0x00000039 ;// long name for February Global Const $LOCALE_SMONTHNAME3 = 0x0000003A ;// long name for March Global Const $LOCALE_SMONTHNAME4 = 0x0000003B ;// long name for April Global Const $LOCALE_SMONTHNAME5 = 0x0000003C ;// long name for May Global Const $LOCALE_SMONTHNAME6 = 0x0000003D ;// long name for June Global Const $LOCALE_SMONTHNAME7 = 0x0000003E ;// long name for July Global Const $LOCALE_SMONTHNAME8 = 0x0000003F ;// long name for August Global Const $LOCALE_SMONTHNAME9 = 0x00000040 ;// long name for September Global Const $LOCALE_SMONTHNAME10 = 0x00000041 ;// long name for October Global Const $LOCALE_SMONTHNAME11 = 0x00000042 ;// long name for November Global Const $LOCALE_SMONTHNAME12 = 0x00000043 ;// long name for December Global Const $LOCALE_SMONTHNAME13 = 0x0000100E ;// long name for 13th month (if exists) Global Const $LOCALE_SABBREVMONTHNAME1 = 0x00000044 ;// abbreviated name for January Global Const $LOCALE_SABBREVMONTHNAME2 = 0x00000045 ;// abbreviated name for February Global Const $LOCALE_SABBREVMONTHNAME3 = 0x00000046 ;// abbreviated name for March Global Const $LOCALE_SABBREVMONTHNAME4 = 0x00000047 ;// abbreviated name for April Global Const $LOCALE_SABBREVMONTHNAME5 = 0x00000048 ;// abbreviated name for May Global Const $LOCALE_SABBREVMONTHNAME6 = 0x00000049 ;// abbreviated name for June Global Const $LOCALE_SABBREVMONTHNAME7 = 0x0000004A ;// abbreviated name for July Global Const $LOCALE_SABBREVMONTHNAME8 = 0x0000004B ;// abbreviated name for August Global Const $LOCALE_SABBREVMONTHNAME9 = 0x0000004C ;// abbreviated name for September Global Const $LOCALE_SABBREVMONTHNAME10 = 0x0000004D ;// abbreviated name for October Global Const $LOCALE_SABBREVMONTHNAME11 = 0x0000004E ;// abbreviated name for November Global Const $LOCALE_SABBREVMONTHNAME12 = 0x0000004F ;// abbreviated name for December Global Const $LOCALE_SABBREVMONTHNAME13 = 0x0000100F ;// abbreviated name for 13th month (if exists) Global Const $LOCALE_SPOSITIVESIGN = 0x00000050 ;// positive sign Global Const $LOCALE_SNEGATIVESIGN = 0x00000051 ;// negative sign Global Const $LOCALE_IPOSSIGNPOSN = 0x00000052 ;// positive sign position Global Const $LOCALE_INEGSIGNPOSN = 0x00000053 ;// negative sign position Global Const $LOCALE_IPOSSYMPRECEDES = 0x00000054 ;// mon sym precedes pos amt Global Const $LOCALE_IPOSSEPBYSPACE = 0x00000055 ;// mon sym sep by space from pos amt Global Const $LOCALE_INEGSYMPRECEDES = 0x00000056 ;// mon sym precedes neg amt Global Const $LOCALE_INEGSEPBYSPACE = 0x00000057 ;// mon sym sep by space from neg amt Global Const $LOCALE_FONTSIGNATURE = 0x00000058 ;// font signature Global Const $LOCALE_SISO639LANGNAME = 0x00000059 ;// ISO abbreviated language name Global Const $LOCALE_SISO3166CTRYNAME = 0x0000005A ;// ISO abbreviated country name Global Const $LOCALE_IDEFAULTEBCDICCODEPAGE = 0x00001012 ;// default ebcdic code page Global Const $LOCALE_IPAPERSIZE = 0x0000100A ;// 0 = letter, 1 = a4, 2 = legal, 3 = a3 Global Const $LOCALE_SENGCURRNAME = 0x00001007 ;// english name of currency Global Const $LOCALE_SNATIVECURRNAME = 0x00001008 ;// native name of currency Global Const $LOCALE_SYEARMONTH = 0x00001006 ;// year month format string Global Const $LOCALE_SSORTNAME = 0x00001013 ;// sort name Global Const $LOCALE_IDIGITSUBSTITUTION = 0x00001014 ;// 0 = none, 1 = context, 2 = native digit ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetLocaleInfo ; Description ...: Gets local specific info ; Syntax.........: _WinAPI_GetLocaleInfo($iLocale, $iLCType) ; Parameters ....: $iLocale - Identifies a valid Windows locale ; $iLCType - Identifies the information to be retrieved ; Return values .: Success - String containing the requested information ; Failure - Empty string with @error set to 1 ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetUserDefaultLCID ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetLocaleInfo($iLocale, $iLCType) Local $aResult = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", $Locale, "long", $LCType, "ptr", 0, "long", 0) If @error Then Return SetError(1, 0, "") Local $lpBuffer = DllStructCreate("char[" & $aResult[0] & "]") $aResult = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", $Locale, "long", $LCType, "ptr", DllStructGetPtr($lpBuffer), "long", $aResult[0]) If @error Or ($aResult[0] = 0) Then Return SetError(1, 0, "") Return SetError(0, 0, DllStructGetData($lpBuffer, 1)) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetUserDefaultLCID ; Description ...: Gets local specific info ; Syntax.........: _WinAPI_GetUserDefaultLCID() ; Parameters ....: ; Return values .: Success - The default LCID for the user ; Failure - Zero with @error set to 1 ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetLocaleInfo ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetUserDefaultLCID() Local $aResult = DllCall("kernel32.dll", "long", "GetUserDefaultLCID") ; Get the default LCID for this user If @error Then Return SetError(1, 0, 0) Return SetError(0, 0, $aResult[0]) EndFunc Would be great to have those in there too WBD
-
This is fantastic! Can't remember which ones I'm getting credit for but that's old age for you. A couple of possible additions: ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetLocalTime ; Description ...: Gets the local time ; Syntax.........: _WinAPI_GetLocalTime() ; Parameters ....: ; Return values .: Success - Array with eight values ; 0 - Year ; 1 - Month ; 2 - Day of week ; 3 - Day ; 4 - Hour ; 5 - Minute ; 6 - Second ; 7 - Milliseconds ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetSystemTime ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetLocalTime() Local $aRet[8], $SystemTime = DllStructCreate("ushort[8]") DllCall("kernel32.dll", "none", "GetLocalTime", "ptr", DllStructGetPtr($SystemTime)) For $i = 1 To 8 $aRet[$i - 1] = DllStructGetData($SystemTime, 1, $i) Next Return $aRet EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetSystemTime ; Description ...: Gets the system time ; Syntax.........: _WinAPI_GetSystemTime() ; Parameters ....: ; Return values .: Success - Array with eight values ; 0 - Year ; 1 - Month ; 2 - Day of week ; 3 - Day ; 4 - Hour ; 5 - Minute ; 6 - Second ; 7 - Milliseconds ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetLocalTime ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetSystemTime() Local $aRet[8], $SystemTime = DllStructCreate("ushort[8]") DllCall("kernel32.dll", "none", "GetSystemTime", "ptr", DllStructGetPtr($SystemTime)) For $i = 1 To 8 $aRet[$i - 1] = DllStructGetData($SystemTime, 1, $i) Next Return $aRet EndFunc WBD
-
I'm being kept busy on other projects so I don't have time to polish this in to a releasable state. As such, I'm making the source code available. See the first post for the link to a ZIP which contains the code. It would be great if someone can think of a better way to add stock symbols in to the application. WBD
-
I think you're missing this line from the script. Global Const $Anim_Hide = 0x00010000 WBD
-
I didn't draw them. I took them from the original code that I converted. That would kinda delete the purpose of using GDI+ to rotate the hands of the clock. WBD
-
[2] and [4] have been done. The link in the first post has been updated. WBD
-
Thanks for all the feedback. I'll be working on improving this over the coming weeks. I'm looking to do the following: [1] Make it easier to add stock symbols hopefully something like http://www.google.com/finance [2] Clean up the memory leaks that I found today! [3] Consider some global resizing (as per picea892's suggestion) [4] Allow configuration of the refresh interval (currently 5 minutes) In addition, I'll be looking at incorporating some kind of software protection (possibly home grown) but I'm not certain how to do this just yet. As for the API, I'm just downloading a CSV with the appropriate information based on documentation that I found through Google. See, for example, here: http://www.gummy-stuff.org/Yahoo-data.htm Regards, WBD
-
Whoooops!! Totally forgot to mention that I owe a big thanks to Yashied for using his excellent ColorPicker UDF library. WBD
-
Hi all, I've been working on this for a while now so I thought I'd put it out there. I've now put the source code here for those who'd be interested. Anyway, the application is a stock tracker written in AutoIt3 using GDI+ to display the stock information. It uses the Yahoo! finance API to retrieve the stock prices etc. and it updates the stocks every five minutes. The coding that took the most time was making the UI completely customizable. The size of the UI and all the fonts and colours can be changed in the options dialog. Feel free to pass comments as you see fit. It would be great to get some feedback but I know some people just won't run it The application can be downloaded from here WBD
-
It's working with the new example. I have no idea why it wasn't working before. As I said, the function was returning @error = 0. WBD