
VoSs2o0o
Active Members-
Posts
32 -
Joined
-
Last visited
Everything posted by VoSs2o0o
-
Array as a parameter for dllcall
VoSs2o0o replied to Inververs's topic in AutoIt General Help and Support
a little bit late for an answer but here we go: #include <Memory.au3> ;~ ;=============================================================================== ;~ ; Description: Returns the RAS-Entrie information in an array. ;~ ; Author: VoSso2o0o ;~ ; Parameter(s): None ;~ ; Requirement(s): #include-once <Memory.au3> ;~ ; Return Value(s): On Success - Returns array of Ras entries ;~ ; On Failure - @error <> 0 (Windows Error Number) and Returns 0 ;- ; ;~ ; Note(s): ;~ ;=============================================================================== Func _RasEnumEntries() const $SUCCESS = 0 const $ERROR_NOT_ENOUGH_MEMORY = 8 const $RASBASE = 600 const $ERROR_BUFFER_TOO_SMALL = $RASBASE + 3 const $ERROR_INVALID_SIZE = $RASBASE + 32 Dim $result[1] $RAS_MaxEntryName=0x104 ;don't no why it is not 0x100.... $RasEntryName = "int dwSize;char szEntryName["&$RAS_MaxEntryName&"]" ;RASENTRYNAME structure data $TRasEntryName = DllStructCreate($RasEntryName) ;temporary Structure for sizing $RAS_EntryName_Size = DllStructGetSize($TRasEntryName) ;Structure Size $mem = _MemGlobalAlloc(256 * $RAS_EntryName_Size, $GPTR) ;Allocate Memory for Array Dim $ARasEntryName[256] ;Create an Array [256] for Param 3 For $i=0 to 255 $ARasEntryName[$i] = DllStructCreate($RasEntryName, $mem + ($i * $RAS_EntryName_Size)) ;Create 256 Structures in the Array next $lpcb = 256*$RAS_EntryName_Size ;calc BufferSize (Param4) $lpcEntries = 0 ;Init Param5 DllStructSetData($ARasEntryName[0],1, $RAS_EntryName_Size) ;write StructureSize to first member of the array ;DWORD RasEnumEntries( __in LPCTSTR reserved, __in LPCTSTR lpszPhonebook, __inout LPRASENTRYNAME lprasentryname, __inout LPDWORD lpcb, __out LPDWORD lpcEntries); $res = DllCall("rasapi32.dll","int","RasEnumEntries","ptr", 0,"ptr",0,"ptr",DllStructGetPtr($ARasEntryName[0]),"int*",$lpcb,"int*",$lpcEntries) ;ConsoleWrite($res[0] & @LF) if $res[0]=0 then ;Return Value ;ConsoleWrite($res[4] & @LF) ;Length in Bytes $noEntries = $res[5] ;number of Entries for $i = 0 to $noEntries - 1 $result[$i] = DllStructGetData ( $ARasEntryName[$i], "szEntryName") ;copy result to result-Array ;ConsoleWrite($result[$i]) Redim $result[Ubound($result) + 1] ;resize result-Array ;ConsoleWrite(DllStructGetData ( $ARasEntryName[$i], "szEntryName") & @LF) next Redim $result[Ubound($result) - 1] ;delete last (empty) entry Return $result Else SetError($res[0], 0, 0) endif endfunc $ras = _RasEnumEntries() -
Hi, I have wondered why my current program give me some strange values, and i have found more about a windows bug in google, The EM_GETLINE Message works not correctly somethimes. A "better" _GUICtrlEditGetLine should be: ;=============================================================================== ; ; Description: _GUICtrlEditGetLine ; Parameter(s): $h_edit - controlID ; $i_line - Specifies the line to be retrieved. ; Requirement: None ; Return Value(s): Returns the line from the multiline edit control. ; If an error occurs, the return value is "" (empty string) and @error is set. ; User CallTip: _GUICtrlEditGetLine($h_edit, $i_line) Copies a line of text from an edit control. (required: <GuiEdit.au3>) ; Author(s): Gary Frost (custompcs at charter dot net) ; Jos van der Zande <jdeb at autoitscript com > ; Note(s): ; ;=============================================================================== Func _GUICtrlEditGetLine(ByRef $h_Edit, $i_line) Local $i_index = _GUICtrlEditLineIndex($h_Edit, $i_line) If @error Then Return SetError($EC_ERR, $EC_ERR, "") ;Local $length = _GUICtrlEditLineLength($h_Edit, $i_index) ;not needed ;If @error Then Return SetError($EC_ERR, $EC_ERR, "") ;not needed Local $length = 1024 - 2 ;better way to make sure that you have the complete line readed Local $struct_Buffer = DllStructCreate("short;char[" & $length + 2 & "]") If @error Then Return SetError($EC_ERR, $EC_ERR, "") DllStructSetData($struct_Buffer, 1, $length, 1) If IsHWnd($h_Edit) Then _SendMessage($h_Edit, $EM_GETLINE, $i_line - 1, DllStructGetPtr($struct_Buffer)) If @error Then Return SetError($EC_ERR, $EC_ERR, "") Else GUICtrlSendMsg($h_Edit, $EM_GETLINE, $i_line - 1, DllStructGetPtr($struct_Buffer)) If @error Then Return SetError($EC_ERR, $EC_ERR, "") EndIf Local $struct_String = DllStructCreate("char[" & $length & "]", DllStructGetPtr($struct_Buffer)) If @error Then Return SetError($EC_ERR, $EC_ERR, "") Return DllStructGetData($struct_String, 1) EndFunc ;==>_GUICtrlEditGetLine replace the old UDF in AutoIt\include\GuiEdit.au3 with this version to fix that problem. I don't have posted it to the Bug-Forum, because its "only" a Windows Bug since Windows 2000, the AutoIt code is correct and in other Windows versions it works stable (including the new Vista? )
-
so my script works now..... V 0.3 -*fixed* prevent Win+Tab -*added* new routine to find the Task Manager -*added* find the Sysinternals Process Explorer also Opt("WinTitleMatchMode",4) Global $hdlTaskmgr HotKeySet("^!{F9}", "unlock") Func unlock() WinSetState ( $hdlTaskmgr, "", @SW_RESTORE) WinClose($hdlTaskmgr) WinSetState ( "classname=Progman", "",@SW_ENABLE) WinSetState ( "classname=Shell_TrayWnd", "", @SW_SHOW) WinMinimizeAllUndo ( ) Send("{ALTUP}") Send("{CTRLUP}") exit endfunc Func WinKey() endfunc run("Taskmgr.exe /t") WinWait("regexp=(?i)([Task][Manager])|([Process][Explorer])") $hdlTaskmgr = WinGetHandle ("last") WinSetState ( $hdlTaskmgr, "", @SW_HIDE ) WinSetState ( "classname=Progman", "",@SW_DISABLE) WinSetState ( "classname=Shell_TrayWnd", "", @SW_HIDE) WinMinimizeAll ( ) While 1 Send("{ALTUP}") Send("{CTRLUP}") Send("{CTRLDOWN}") Send("{ALTDOWN}") sleep(100) Wend There are two ways to prevent Win+xyz Hotkeys: -Write a Hook (impossible in AutoIt, because you cannot define a Callback) -my Autoit solution: leave the modifiers pressed, there exist only ALT+CTRL+DEL that works but I think about to lock the "Windows Security" Window to prevent a logoff...... (you must switch the current desktop for that)
-
I have the solution to break your script: Win+e, and you have the Explorer press the Win-Key twice, then you have the control over the Mouse. create a Shortcut for "taskmgr" and maximized Kill the Process.....
-
OK, here is a better version... hopefully unbreakable Opt("WinTitleMatchMode",4) HotKeySet("{F3}", "Winkey") HotKeySet("!{F9}", "unlock") HotKeySet("!{TAB}", "Winkey") HotKeySet("!{F4}", "Winkey") Func unlock() WinSetState ( "Windows Task-Manager", "", @SW_SHOW) WinSetState ( "classname=Progman", "",@SW_ENABLE) WinSetState ( "classname=Shell_TrayWnd", "", @SW_SHOW) Send("{ALTUP}") WinMinimizeAllUndo ( ) exit endfunc Func WinKey() endfunc run("Taskmgr") WinWait("Windows Task-Manager") WinSetState ( "Windows Task-Manager", "", @SW_HIDE ) WinSetState ( "classname=Progman", "",@SW_DISABLE) WinSetState ( "classname=Shell_TrayWnd", "", @SW_HIDE) WinMinimizeAll ( ) While 1 Send("{ALTUP}") Send("{ALTDOWN}") sleep(100) Wend
-
ohhh - I have found an easier way...... Opt("WinTitleMatchMode",4) HotKeySet("{F9}", "unlock") Func unlock() WinSetState ( "classname=Progman", "",@SW_ENABLE) WinSetState ( "classname=Shell_TrayWnd", "", @SW_ENABLE) WinMinimizeAllUndo ( ) exit endfunc run("Taskmgr") WinWait("Windows Task-Manager") WinSetState ( "Windows Task-Manager", "", @SW_HIDE ) WinSetState ( "classname=Progman", "",@SW_DISABLE) WinSetState ( "classname=Shell_TrayWnd", "", @SW_DISABLE) WinMinimizeAll ( ) While 1 Sleep(100) Wend
-
here is my beta-version: Use F9 to unlock system Opt("WinTitleMatchMode",4) HotKeySet("{F9}", "unlock") Func unlock() WinWait("Windows Task-Manager") ControlEnable ( "classname=Shell_TrayWnd", "", "ToolbarWindow321") ControlEnable ( "classname=Shell_TrayWnd", "", "ToolbarWindow322") ControlEnable ( "classname=Shell_TrayWnd", "", "ToolbarWindow323") ControlEnable ( "classname=Shell_TrayWnd", "", "Button1") WinSetState ( "classname=Progman", "",@SW_ENABLE) WinMinimizeAllUndo ( ) exit endfunc run("Taskmgr") WinWait("Windows Task-Manager") WinSetState ( "Windows Task-Manager", "", @SW_HIDE ) ;WinSetState ( "Windows Task-Manager", "",@SW_DISABLE) ControlDisable ( "classname=Shell_TrayWnd", "", "ToolbarWindow321") ControlDisable ( "classname=Shell_TrayWnd", "", "ToolbarWindow322") ControlDisable ( "classname=Shell_TrayWnd", "", "ToolbarWindow323") ControlDisable ( "classname=Shell_TrayWnd", "", "Button1") WinSetState ( "classname=Progman", "",@SW_DISABLE) WinMinimizeAll ( ) While 1 Sleep(100) Wend
-
function that return a pointer to a string.
VoSs2o0o replied to xonic's topic in AutoIt General Help and Support
Create a char - Structure from a pointer, and get the value $strString = DllStructCreate ( "char[128]" , $yourpointer) $myString = DllStructGetData ($strString, 1) but normaly use only "str" or "wstr" instead of "ptr" to get the Data from the API, because every String needs a pointer, and AutoIt now that. VoSs2o0o -
Here is the "official API-Method" of an ListView Event Handler :-) Global Const $WM_NOTIFY = 0x004E ;ListView Events Global Const $NM_FIRST = 0 - 0 Global Const $NM_LAST = 0 - 99 Global Const $NM_OUTOFMEMORY = $NM_FIRST - 1 Global Const $NM_CLICK = $NM_FIRST - 2 Global Const $NM_DBLCLK = $NM_FIRST - 3 Global Const $NM_RETURN = $NM_FIRST - 4 Global Const $NM_RCLICK = $NM_FIRST - 5 Global Const $NM_RDBLCLK = $NM_FIRST - 6 Global Const $NM_SETFOCUS = $NM_FIRST - 7 Global Const $NM_KILLFOCUS = $NM_FIRST - 8 Global Const $NM_CUSTOMDRAW = $NM_FIRST - 12 Global Const $NM_HOVER = $NM_FIRST - 13 Global Const $NM_NCHITTEST = $NM_FIRST - 14 Global Const $NM_KEYDOWN = $NM_FIRST - 15 Global Const $NM_RELEASEDCAPTURE = $NM_FIRST - 16 Global Const $NM_SETCURSOR = $NM_FIRST - 17 Global Const $NM_CHAR = $NM_FIRST - 18 Global Const $NM_TOOLTIPSCREATED = $NM_FIRST - 19 GUIRegisterMsg($WM_NOTIFY, "exEvents") Func exEvents($hWndGUI, $MsgID, $WParam, $LParam) Switch $WParam Case $Listview_1 $tagNMHDR = DllStructCreate ( "int;int;int",$LParam) ;NMHDR (hwndFrom, idFrom, code) $code = DllStructGetData ( $tagNMHDR, 3) Switch $code Case $NM_DBLCLK ConsoleWrite("$NM_DBLCLK" & @crlf) Endswitch Endswitch endfunc
-
Hi, schade das das heut nicht mehr geklappt hat (oder kommt das File noch in der nächsten halben Stunde?). Was ich bis jetzt an übersetzten Texten gesehen habe sieht schon mal sehr gut (professionell) aus. Ich finde es super, das der deutschsprachige Raum mit zu den ersten gehört, der die AutoIt Hilfe übersetzt. Ich kenne einige Leute die das File sehnsüchtig erwarten (können nicht so gut englisch, sind aber Fans von AutoIt3) Danke schonmal im vorraus für die Arbeit die Ihr euch gemacht habt VoSs2o0o
-
AMG 0.21 (AutoIt ScriptWriter & AutoIt Spy w. API)
VoSs2o0o posted a topic in AutoIt Example Scripts
AutoItMacroGenerator is an easy Tool to create AutoIt Scripts automaticly. Use it e.g. to install a Programm, and save the generated Script to install your Programm in your Network in a minimum of Time. Version 0.21 beta from 2005-02-25 ---------------------------------------- -little Bugfix related to the Button detection -W9X compatibility improved (SysListViw32 and Scite4AutoIt should work now on W9X) -MySpy.dll added (get AutoIt compatible Infos per API) -example for MySpy.dll added to the Helpfile -some small fixes the old Thread for more information is: here and here Download at my Webpage -
And I thought I have an easy Web Interface.... :"> Now I have added the same Link to the Newsentry on my Frontpage for easier finding.
-
This is an easy Tool to create AutoIt Scripts automaticly. Use it e.g. to install a Programm, and save the generated Script to install your Programm in your Network in a minimum of Time. Version 0.20 beta from 2005-02-12 ----------------------------------- - 80% rewritten - an optimized GUI - a new integrated Spy (Au3Info or Au3_Spy is no more needed) - it detects all controls that AutoIt currently supports (Version 3.1) - compatibility with Scite4AutoIt3 (see Scite4Autoit3 inclusion of AutoMacroGenerator) - now you can run every command line you want - and many Bugfixes and code optimations the old Thread for more information is here. Download it on my Site
-
...or try my AutoItMacroGenerator The new Version 0.2 is ready in 1-2 weeks
-
upcoming AutoItMacroGenerator V 0.2 -------------------------------------------- -support of all new Au3_spy versions (including all betas) -keyboard support (e.g. to change a Path in an installer) -support for starting Programs with parameters -compatibility with "Scite4Autoit3" (see Scite4Autoit3 inclusion of AutoMacroGenerator) -a optimized GUI -detection of all controls that AutoIt currently supports (incl. beta versions) -some code optimizations and bugfixes
-
@alexmsupertramp because I dont't be able to write "correct" AutoIt - Code on a Click I use the following Technology: -I start the AutoIt Spy in background, and grab this Window -I grab all Mouseactions (and in the coming Version all Keyboard actions) and interpret this actions. For this I use "TheHook.dll" from Scott Seligman. -I Write the code in the Textbox of my Proggy -the only exception is the code I used for Tabs, but I will change this in the next version cause some problems. I use Purebasic to code this (and I think you must "reinventing the wheel" to use my code.) But I think this Technology is now possible in the newest betas from AutoIt! (You are able to load and use DLLs now). I try this method in the next time..... When it is possible to write this in AutoIt, I write a new (Open Source) version of my Program in AutoIt. For an perfect and easy way we need a small API for the AutoItSpy (in Au3_spy.exe or in a new au3_spy.dll). Then it is possible to have all parameters of the AutoItSpy in an easy way.
-
...have a look on my AutoItMacroGenerator the next Version is coming this Month....
-
Looking for a System Inventory Script or App
VoSs2o0o replied to ioliver's topic in AutoIt Example Scripts
Check Loginventory free for 10 PCs (but it is expensive wenn you have to scan more PCs) -
I am at holidays for one week. Then I will check the problems with Tabs, and will solve some problems to add some more controls. VoSs2o0o
-
@autoitNOW: Okay, I have added a little help File @CyberSlug: no problem @all: New Version 0.12 - Help-File added - now i use zip, and not ace (cause some Problem with extracting) downloadt it on my Homepage (see signature) or soon in the Public File Area
-
My Tool is usefull to automate Installations or Programm Settings. For Example, you generate an Installation Script of your Programm in some seconds, and then use PSExec from Sysinternals to install this Programm on all Network Computers. You save Time on stupid "WaitWindow", "ControlClick" commands and you must not jump between Au3_Spy and your Editor.
-
...I use the good old Regmon from Sysinternals for that. But for some Registry-Keys your Tool is interesting
-
@CyberSlug Now both Homepages work - but the the old one has generated an error saved as a Ace-File. That is now fixed. @Holger I check directly with an MD5 Checksum for that File, to avoid Problem with diffrent Versions of that File. I have now added the MD5-Key for 1.0.8.0 PS I don't use any special DLLs: Only the "normal" WinAPI dlls, and TheHook.dll. New Version 0.11 --make little changes for the new Au3_Spy3 (Version 1.0.8.0) Download it on my both Homepages Here and Here
-
Okay, I have an new Homepage: VoSs2o0o - Homepage there you can find the Scriptwriter
-
Okay... I think there are some problems with this Webspace Provider: I am now at work, and the Page is not really reachable. Try to use this Link: VoSs2o0o - Homepage when you have Problems to Enter the Site, or try again later. (The Problem is a hopefully temporary changed URL, and the Provider is not reachable) --------------------------------------------------------------------------------- And here another URL for the AutoItMacroGenerator on "yousendit.com" The File is up for 7 days.