JohnOne Posted July 2, 2010 Share Posted July 2, 2010 (edited) EDIT: the issues in this thread are solved until post #20_____________________________________________________________Im trying to pop my dllcall cherry an wondering if someone coul look at the state of it before I crash my PC$uiAction = "SPI_GETMOUSECLICKLOCK" $uiParam = 0 $fWinIni = 0 $dll = "User32.dll" $stct = "uint state" $Structure = DllStructCreate($stct) $pvParam = DllStructGetPtr($Structure,"state") $aret = DllCall($dll, "uint", $uiAction, "uint", $uiParam, "ptr", $pvParam, "uint", $fWinIni)I've never attemped it before and... well Im shitting myself, and it just dosent look rightSPI_GETMOUSECLICKLOCK is near the top of Accessibility parameters hereAny hints or tips warmly welcome. Edited August 3, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2010 Author Share Posted July 2, 2010 well I ran it anyway adding If @error Then MsgBox(0, @error, @extended) Else _ArrayDisplay($aret) EndIf And @error = 3 "function" not found in the DLL file AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted July 2, 2010 Share Posted July 2, 2010 (edited) Completely wrong $SPI_GETMOUSECLICKLOCK = 4126 $aCall = DllCall("user32.dll", "bool", "SystemParametersInfo", _ "dword", $SPI_GETMOUSECLICKLOCK, _ "dword", 0, _ "bool*", 0, _ "dword", 0) ; ...chech for errors here... ConsoleWrite("! Mouse ClickLock feature ") If $aCall[3] Then ConsoleWrite("enabled." & @CRLF) Else ConsoleWrite("disabled." & @CRLF) EndIf Edited July 2, 2010 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2010 Author Share Posted July 2, 2010 (edited) wow, thanks trancexx Well i'm even more confused now with dword, I can see where the bool comes from I thing, I just thought it was int in autoit EDIT: hang on, they are both 32 bit unsigned intger ? Edited July 2, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted July 2, 2010 Share Posted July 2, 2010 Some new (including bool) DllCall types were introduced in AutoIt with some of the recent releases. "int" would be fine too. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2010 Author Share Posted July 2, 2010 (edited) Loking closer I see I totally got the function name wrong, using a parameter as it EDIT: Can you let me know where 4126 comes from? I was thinking I may have had to use 0x101E somewhere as that was in the docs. Edited July 2, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted July 2, 2010 Share Posted July 2, 2010 Loking closer I see I totally got the function name wrong, using a parameter as it EDIT: Can you let me know where 4126 comes from? I was thinking I may have had to use 0x101E somewhere as that was in the docs. Run this:ConsoleWrite(0x101E & " is in fact 0x101E" & @CRLF) Btw, uint is the same as dword (int is not). ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 2, 2010 Share Posted July 2, 2010 (edited) That's just hex to decimal conversion, 0x101E = 4126. Either will work. Edit: Oops, redundant again! Edited July 2, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2010 Author Share Posted July 2, 2010 Thanks very much. I did think it was decimal and tried ConsoleWrite(Dec(0x101E) & @LF) except it never worked AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 2, 2010 Share Posted July 2, 2010 Dec() is intended to convert a hex STRING: ConsoleWrite(Dec("101E") & @LF) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
KaFu Posted July 2, 2010 Share Posted July 2, 2010 Hmmm, talking about Hex<>Dec conversion... why is it, that some hex numbers are 4 digits long, and others 8 digits? Better, how do I know when to use which? Hope it's not a too noobish question ConsoleWrite(Dec("101E") & @tab & 0x101E & @tab & "0x101E" & @tab & Hex(4126) & @tab & "0x" & Hex(4126,4) & @CRLF) ; 4126 4126 0x101E 0000101E 0x101E OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Ascend4nt Posted July 2, 2010 Share Posted July 2, 2010 The smallest internal representation of numbers is 32-bit, which is 8 hex characters long. You can shorten it by using the second operand for 'Hex' of course if you know the number can fit into less than 32-bits. Also, a shortcoming of both Hex() and Dec() is they both work on a max integer size of 32-bits. Of course, there are workarounds for 64-bit numbers My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
KaFu Posted July 2, 2010 Share Posted July 2, 2010 (edited) Ah, I see , so the 4 digit hex numbers are leftovers from the 16bit area? And 0x00000001 = 0x0001 is TRUE, if of course the "target" accepts 32bit? Edited July 2, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
jchd Posted July 2, 2010 Share Posted July 2, 2010 It depends on the use you have of the hex representation. As I see it Hex defaults to 8-char output, which is what your example shows. Except for strictly formatted usage, having leading hex zeroes generally don't harm just like leading decimal zeroes. But sometimes the context forces zeroes truncation on not (Win 7 vs. agent 007). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
KaFu Posted July 2, 2010 Share Posted July 2, 2010 Makes sense to me , thanks for the replies! OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2010 Author Share Posted July 2, 2010 (edited) Im back already, (cherry in tact) Ive been trying other parameters of the function, and thought tedting for cleartype looked pretty simple. I first tried checking for SPI_GETCLEARTYPE Determines whether ClearType is enabled. The pvParam parameter must point to a BOOL variable that receives TRUE if ClearType is enabled, or FALSE otherwise. which is pretty much the same as the last, but it just kept returning true, whether it was enabled or not. I read down the page, and someone had commented that it didnt work in vista, and suggested checking for SPI_GETFONTSMOOTHING and SPI_GETFONTSMOOTHINGTYPE, so I tried that. Thing is it returns true than font smoothing is enabled but dosent return what is used, Ive tried a few variations of this code. (basically the code from trancexx) expandcollapse popup#include <Array.au3> $SPI_GETFONTSMOOTHING = 0x004A $aCall = DllCall("user32.dll", "bool*", "SystemParametersInfo", _ "dword", $SPI_GETFONTSMOOTHING, _ "dword",0 , _ "bool*",0, _ "dword",0 ) If @error Then MsgBox(0, "error", @error) EndIf _ArrayDisplay($aCall) ConsoleWrite("! FONTSMOOTHING feature ") If $aCall[3] Then ConsoleWrite("enabled." & @CRLF) Else ConsoleWrite("disabled." & @CRLF) EndIf ;#ce sleep(1000) $SPI_GETFONTSMOOTHINGTYPE = 0x200A $aCall = DllCall("user32.dll", "bool*", "SystemParametersInfo", _ "dword", $SPI_GETFONTSMOOTHINGTYPE, _ "dword", 0, _ "dword", "FE_FONTSMOOTHINGCLEARTYPE", _ "dword", 0) If @error Then MsgBox(0, "error", @error) EndIf _ArrayDisplay($aCall) ConsoleWrite("! smoothing type ") If $aCall[3] Then ConsoleWrite($aCall[3] & @CRLF) Else ConsoleWrite("disabled." & @CRLF) EndIf If anyone has the time and patience, Id appreciated any guidance. Edited July 2, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted July 2, 2010 Share Posted July 2, 2010 (edited) That other call should be:$aCall = DllCall("user32.dll", "bool", "SystemParametersInfo", _ "dword", $SPI_GETFONTSMOOTHINGTYPE, _ "dword", 0, _ "dword*", 0, _ "dword", 0) Edited July 2, 2010 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2010 Author Share Posted July 2, 2010 Thanks mate, really appreciate the help. Im off to try and set it now AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted July 2, 2010 Share Posted July 2, 2010 Sure mate. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted August 3, 2010 Author Share Posted August 3, 2010 I've been trying to set this system param for some time now, to change the type of font smoothing used, but unfortunately Autoit crashes during the dllcall, I' love someone to see if my code is wrong.#include <WinAPI.au3> $string = "Environment" $struct = DllStructCreate($string) $pointer = DllStructGetPtr($struct) $WM_WININICHANGE = 0x001A $SPI_SETFONTSMOOTHINGTYPE = 0x200B $aCall = DllCall("user32.dll", "bool*", "SystemParametersInfo", _ "uint", $SPI_SETFONTSMOOTHINGTYPE, _ "uint", 0, _ "uint*",1, _ "uint", $WM_WININICHANGE, "dword", 0, "ptr", $pointer) If @error Then ConsoleWrite(_WinAPI_GetLastErrorMessage()) EndIf ConsoleWrite(_WinAPI_GetLastErrorMessage())MSDN INFOhttp://msdn.microsoft.com/en-us/library/ms724947%28VS.85%29.aspxBOOL WINAPI SystemParametersInfo( __in UINT uiAction, __in UINT uiParam, __inout PVOID pvParam, __in UINT fWinIni);__________________________________________________uiAction [in] UINT The system-wide parameter to be retrieved or set.SPI_SETFONTSMOOTHINGTYPE0x200BSets the font smoothing type. The pvParam parameter is either FE_FONTSMOOTHINGSTANDARD, if standard anti-aliasing is used, or FE_FONTSMOOTHINGCLEARTYPE, if ClearType is used. The default is FE_FONTSMOOTHINGSTANDARD.SPI_SETFONTSMOOTHING must also be set. Windows 2000: This parameter is not supported.----------------------------------------------------uiParam [in] UINT A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.-----------------------------------------------------pvParam [in, out] PVOID A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter.------------------------------------------------------fWinIni [in] UINT If a system parameter is being set, specifies whether the user profile is to be updated, and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change. This parameter can be zero if you don't want to update the user profile or broadcast the WM_SETTINGCHANGE message, or it can be one or more of the following values. http://msdn.microsoft.com/en-us/library/ms725497%28v=VS.85%29.aspx AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now