Jump to content

WideBoyDixon

Active Members
  • Posts

    379
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by WideBoyDixon

  1. Did you actually read my reply or look at the code? DON'T INCLUDE THE PARAMETER NAMES IN THE CALL. $oExcel = _ExcelBookOpen("c:\call_list.xls", 1, True) WBD
  2. Why not roll your own? While Not WinExists("My Window") Sleep(xxx) Wend WBD
  3. Something in the back of mind is niggling me. I seem to recall that your hook procedure has to be in a separate DLL and that's not something that can be achieved through AutoIt. However, I might be wrong. It's been known.
  4. You don't have to include the parameter names in the call. Also, False is the default for the third parameter so you don't need to include it. $oExcel = _ExcelBookOpen("c:\call_list.xls", 0) WBD
  5. The SciTE editor is Unicode. That's why you only get half the characters. Try _GUICtrlEdit_SetSel($hWnd, 0, $i * 2) WBD
  6. Googling around the web suggests that this function doesn't necessarily return the file name: http://groups.google.com/group/microsoft.p...d078bc3df9ecf8f
  7. I assume we're ignoring the obvious error here: Case StringInStr ($SourceCode,"protector.to") = True In addition, you need to change your function called protector() so that it can time out. You can't force a "Next" while your script is executing that function. WBD
  8. #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiMenu.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $hGui, $cInput, $cInput2, $wProcOld _Main() Func _Main() Local $wProcNew, $DummyMenu $hGui = GUICreate("Focus!", 400, 200, -1, -1, $WS_THICKFRAME, -1) $cInput = GUICtrlCreateInput("Type something here", 20, 20, 360, 20) GUICtrlSetColor(-1, 0x808080) $cInput2 = GUICtrlCreateInput("Type something here", 20, 50, 360, 20) GUICtrlSetColor(-1, 0x808080) $wProcNew = DllCallbackRegister("_FocusWindowProc", "ptr", "hwnd;uint;long;ptr") $wProcOld = _WinAPI_SetWindowLong(GUICtrlGetHandle($cInput), $GWL_WNDPROC, DllCallbackGetPtr($wProcNew)) _WinAPI_SetWindowLong(GUICtrlGetHandle($cInput2), $GWL_WNDPROC, DllCallbackGetPtr($wProcNew)) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc ;==>_Main Func _FocusWindowProc($hWnd, $uiMsg, $wParam, $lParam) Switch $uiMsg Case $WM_SETFOCUS If _WinAPI_GetWindowText($hWnd) = "Type something here" Then _WinAPI_SetWindowText($hWnd, "") If $hWnd = GUICtrlGetHandle($cInput) Then GUICtrlSetColor($cInput, 0x000000) Else GUICtrlSetColor($cInput2, 0x000000) EndIf EndIf Case $WM_KILLFOCUS If _WinAPI_GetWindowText($hWnd) = "" Then _WinAPI_SetWindowText($hWnd, "Type something here") If $hWnd = GUICtrlGetHandle($cInput) Then GUICtrlSetColor($cInput, 0x808080) Else GUICtrlSetColor($cInput2, 0x808080) EndIf EndIf EndSwitch Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $uiMsg, $wParam, $lParam) EndFunc ;==>_FocusWindowProc WBD
  9. Start here : http://www.autoitscript.com/forum/index.ph...st&p=290912
  10. In the (almost) words of the Thomson Twins, you've got COM, COM, COM on your side. Global $oVisio = ObjCreate("Visio.Application") $oVisio.Visible = True Global $oVSD = $oVisio.Documents.Open("[path to vsd]") $oSAW = $oVisio.Addons.ItemU("SaveAsWeb") $oSAW.Run("/quiet=True /openbrowser=False /target=""[path to html]""") $oVisio.Quit I hope it isn't necessary but I'm going to say it anyway. Please replace [path to vsd] and [path to html] with some proper values. WBD
  11. My $0.02 is that AutoIt is dangerous by its very existence. It makes some people believe they can write programs! WBD
  12. You might need to explain a little better what you're trying to achieve. I'm not sure I understand your original post. WBD
  13. Are you looking for this: http://www.autoitscript.com/forum/index.ph...st&p=199131 ? WBD
  14. The language is almost unpenetrable. My best guess is that it needs to run when MSN is minimized so it probably needs _WinAPI_ShowWindow(). On another note, has anyone written a script that will click "Fast Reply", insert the text "Have you looked in the help file?" and then click "Add Reply"? WBD
  15. I don't think your original array-based approach is too bad. Here's my stab at it: #include <file.au3> #include <array.au3> Global $answer = "Section 2" Global $valueToAdd = "LON\1212" Global $logArray Global $AdminRights = "C:\Remote.ini" If FileExists($AdminRights) Then _FileReadToArray($AdminRights, $logArray) Else Exit EndIf Global $result = _ArraySearch($logArray, "[" & $answer & "]") If $result < 0 Then Exit Global $sLast = "" While $logArray[$result] <> "" $sLast = $logArray[$result] $result += 1 If $result > $logArray[0] Then ExitLoop Wend Global $aSplit If $sLast = "" Then $sLast = "ID1" Else $aSplit = StringSplit($sLast, "=") $sLast = "ID" & String(Number(StringMid($aSplit[1], 3)) + 1) EndIf $sLast &= "=" & $valueToAdd If $result > $logArray[0] Then _ArrayAdd($logArray, $sLast) Else _ArrayInsert($logArray, $result, $sLast) EndIf $logArray[0] += 1 _FileWriteFromArray($AdminRights, $logArray, 1) Exit You'll notice that I'm a stickler for declaring variables. It helps to cut down on errors later. WBD EDIT: $sLast should be $aSplit[1] in the If statement ... now corrected.
  16. If you get the RGB value of a pixel then you could apply a generic formula: $Brightness = (0.3 * $Red) + (0.59 * $Green) + (0.11 * $Blue) You can then set your threshold (between 0 and 255) for what is considered "white" and what is considered "black". WBD EDIT: According to Michael Jackson, it don't matter if you're black or white. Presumably he's never tried using OCR himself.
  17. AFAIK, SQLite doesn't support stored procedures. If you're asking about SPs contained in SQL Server or ORACLE then the answer is "no" - you'll need to use ADO or similar to achieve your aim. WBD
  18. I must be missing something. Have you just re-written BitAND, BitOR and BitXOR but much slower? Func POW($X, $Y) $Z = 1 For $i = 1 To $Y Step 1 $Z *= $X Next Return $Z EndFunc ;==>POW How about: Func POW($X, $Y) Return $X ^ $Y EndFunc ;==>POW It must be late or I've gone crazy WBD
  19. I guess you didn't look too hard in the help file. @ScriptLineNumber WBD
  20. MAC address would be a start. If you want to get hold of it (and lots of other interesting information), you should start by taking a look at this message : http://www.autoitscript.com/forum/index.ph...st&p=513225 Note the comment for ProgAndy (two posts latest) about increasing the size of the structure on line 109. You could take the output from _IPH_Capture() and parse it in to an XML DOM for further processing. Regards, WBD
  21. It appears that the [Ctrl] key simulated press in the Send() call is never registered as being "up" again. _IsPressed("A2") returns 1 even when you're using the right control key to trigger the script. It will depend on how the underlying C++ code is implementing the functionality for Send(). Even the target application (SciTE in my case) thinks the left control key is down until you toggle it yourself by pressing it. Yashied's example uses a deprecated call (see http://msdn.microsoft.com/en-us/library/ms...04(VS.85).aspx) to synthesise the keystroke. Because you've already got [Ctrl] held down, it just sends a keydown/keyup event for the "c" key which effectively sends [Ctrl]C to the application. Hope that makes more sense for you. WBD
  22. Much better coding style of course. However, going back to your original question I think what you were looking for is: Assign("$usr" & $e, IniRead($ini, "User" & $e, "username", "") WBD
  23. I'm guessing your original INI file needs the spaces removed around the "=" like this: [UNPW] Username=Username Password=Password WBD
  24. I suspect that the _WinAPI_DrawIconEx() error is caused by a null handle to an icon (i.e. PrivateExtractIcons didn't work). Try changing the following line in the SetIcon function: If $hIcon <> 0 Then _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, 0, 0, 0, 0, $DI_NORMAL) It does give you a blank icon but at least you can see the rest of the script working ... WBD
  25. I guess you'll need to find a COM object that lets you connect to SQL Server. Have you tried ActiveX Data Objects (ADO)? WBD
×
×
  • Create New...