Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/17/2016 in all areas

  1. It's a nice little example you found there. You have to download, compile and run the C-code in the link. Then you create an object with ObjCreateInterface in this way: #include <WinAPIConstants.au3> Opt( "MustDeclareVars", 1 ) Global Const $sCLSID_Example = "{6899A2A3-405B-44d4-A415-E08CEE2A97CB}" Global Const $sIID_IExample = "{74666CAC-C2B1-4fa8-A049-97F3214802F0}" Global Const $dtag_IExample = _ "SetString hresult(str);" & _ "GetString hresult(str;int);" Example() Func Example() Local $oExample = ObjCreateInterface( $sCLSID_Example, $sIID_IExample, $dtag_IExample ) If Not IsObj( $oExample ) Then Return ConsoleWrite( "ObjCreateInterface ERR" & @CRLF ) ConsoleWrite( "ObjCreateInterface OK" & @CRLF ) If Not $oExample.SetString( "My grandmother could do that too" ) = $S_OK Then _ Return ConsoleWrite( "SetString method ERR" & @CRLF ) ConsoleWrite( "SetString method OK" & @CRLF ) Local $sStr1, $sStr2 = "is a cool coder" If Not $oExample.GetString( $sStr1, 16 ) = $S_OK Then _ Return ConsoleWrite( "GetString method ERR" & @CRLF ) ConsoleWrite( "GetString method OK" & @CRLF ) ConsoleWrite( $sStr1 & $sStr2 & @CRLF ) EndFunc #cs SciTE console: ObjCreateInterface OK SetString method OK GetString method OK My grandmother is a cool coder #ce
    4 points
  2. We run SQL on a Win2K server. The database for an OOB product began to be flagged as 'suspect' a few days ago. The first couple of times we were able to stop/start MSSQL and the database would come back up. Today it wouldn't. In an attempt to repair the problem, I detatched the db. When I attempt to re-attach, I was getting the following message error 5101: Device activation error. The physical file name 'C:\%path to db%\db_log.LDF ' may be incorrect. Then I get db Attach failed. I resolved this by creating a new DB of the same name, stopping SQL and replacing the MDF with the corrupt file. I'm now back to 'suspect' on the DB in Enterprise Manager. When I run DBCC CHECKDB ('dbname', REPAIR_REBUILD) I get the response below: Server: Msg 945, Level 14, State 2, Line 1 Database 'dbname' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. Any ideas?
    1 point
  3. I don't know how it would be, and even if it was, you'd be talking micros of a milisecond difference between the two. You could always run a test to see which is faster, disabling the hot key, send, enable the hot key, or controlsend.
    1 point
  4. LarsJ

    Subclass Listview

    Because WM_NOTIFY messages are sent to the parent window of the listview. In your case the parent window is the GUI, so you have to subclass the GUI.
    1 point
  5. Jos

    Send command and hotkeyset

    It will send it for sure ... what program are you trying to send it to? Jos
    1 point
  6. use it this way: Func _fTest() HotKeySet("f") Send("f") HotKeySet("f", "_fTest") EndFunc
    1 point
  7. Awesome idea also the use of the hexchat , it is cool. see you there.. ##Autoit
    1 point
  8. Italiano, I use this code from Yashied to enumerate the contents of the Recycle bin. Once you have the list, you can use FileMove to move the file as shown: #Include <Array.au3> Func _EnumRecycleBinItems($sRoot = '') Local $oShellApp, $oRecycleBin, $oFolderItems, $oItem $oShellApp = ObjCreate('Shell.Application') $oRecycleBin = $oShellApp.NameSpace(10) If Not IsObj($oRecycleBin) Then Return SetError(1, 0, 0) EndIf Local $Ret, $Result[101][6] = [[0]] $sRoot = StringStripWS($sRoot, 3) If $sRoot > '' Then If StringInStr($sRoot, ':') Then $sRoot = StringRegExpReplace($sRoot, ':.*', '') Else $sRoot = '' EndIf If Not FileExists($sRoot & ':') Then Return SetError(1, 0, 0) EndIf EndIf $Ret = DllCall('shell32.dll', 'none', 'SHGetSettings', 'uint*', 0, 'dword', 2) If @error Then Return SetError(1, 0, 0) EndIf $oFolderItems = $oRecycleBin.Items() For $oItem In $oFolderItems If ($sRoot > '') And ($sRoot <> StringLeft($oItem.Path, 1)) Then ContinueLoop EndIf $Result[0][0] += 1 If $Result[0][0] > UBound($Result) - 1 Then ReDim $Result[$Result[0][0] + 100][UBound($Result, 2)] EndIf $Result[$Result[0][0]][0] = $oRecycleBin.GetDetailsOf($oItem, 0) ; Original name $Result[$Result[0][0]][1] = $oRecycleBin.GetDetailsOf($oItem, 1) ; Original path $Result[$Result[0][0]][2] = $oRecycleBin.GetDetailsOf($oItem, 2) ; Deleted date ; $Result[$Result[0][0]][3] = $oRecycleBin.GetDetailsOf($oItem, 3) ; Size $Result[$Result[0][0]][3] = $oItem.Size ; Size $Result[$Result[0][0]][4] = FileGetAttrib($oItem.Path) ; Attributes $Result[$Result[0][0]][5] = $oItem.Path ; Recycle name If (Not $Ret[1]) And (Not StringInStr($Result[$Result[0][0]][4], 'D')) Then If StringInStr($Result[$Result[0][0]][5], '.') Then $Result[$Result[0][0]][0] &= StringRegExpReplace($Result[$Result[0][0]][5], '^.*\.', '.') EndIf EndIf Next ReDim $Result[$Result[0][0] + 1][UBound($Result, 2)] Return $Result EndFunc ;==>_EnumRecycleBinItems $Data = _EnumRecycleBinItems() _ArrayDisplay($Data) ; To recover a file all you need do is: FileMove($Data[1][5], $Data[1][0]) ; Recovers the first file in the list M23
    1 point
  9. Func left($iControlID) Return ControlGetPos(GUICtrlGetHandle($iControlID), "", 0)[0] EndFunc ;==>left Func top($iControlID) Return ControlGetPos(GUICtrlGetHandle($iControlID), "", 0)[1] EndFunc ;==>top Func width($iControlID) Return ControlGetPos(GUICtrlGetHandle($iControlID), "", 0)[2] EndFunc ;==>width Func height($iControlID) Return ControlGetPos(GUICtrlGetHandle($iControlID), "", 0)[3] EndFunc ;==>height
    1 point
  10. Here is the code: #include-once ; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ; #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> ShellExecute(@DesktopDir & '\test.txt', Default, Default, "open") Global $test = GUICreate("test",124,108,-1,-1,-1,-1) GUISetBkColor(0xFFFFFF,$test) GUICtrlCreateButton("Hell No",12,12,100,30,128,-1) GUICtrlSetImage(-1, @DesktopDir & '\12.ico') GUICtrlCreateButton("Hell Yeah",12,60,100,30,128,-1) GUICtrlSetImage(-1, @DesktopDir & '\11.ico') GUISetState(@SW_SHOW,$test) Note that the icons are not being displayed, how can I get them to display icon? Thanks in advance, TD 11.ico 12.ico
    1 point
×
×
  • Create New...