sleepydvdr
Active Members-
Posts
561 -
Joined
-
Last visited
-
Days Won
1
sleepydvdr last won the day on November 10 2011
sleepydvdr had the most liked content!
Profile Information
-
Location
USA
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
sleepydvdr's Achievements
Universalist (7/7)
9
Reputation
-
Toninho reacted to a post in a topic: Changing the position of a Msgbox
-
samibb reacted to a post in a topic: unable to run files
-
Run .bat files don't work like i want
sleepydvdr replied to ZanaxNL's topic in AutoIt General Help and Support
The line you posted didn't seem to do anything for me. I assume that is an IP address, so I changed it to mine and still nothing. However, try this: ShellExecute('"Log" java', "-jar Log.jar 121.128.133.28 15777") The cd is a command. It stands for change directory. You have to be in the correct directory to run an executable. -
Run .bat files don't work like i want
sleepydvdr replied to ZanaxNL's topic in AutoIt General Help and Support
in the bat file, you will need to change directories. Something like: cd "c:Program FilesCasetalk" But why are you using a batch file? Why not cut out the middle man and do everything with AutoIt? -
Compiling for command line, suppress error message
sleepydvdr replied to myspacee's topic in AutoIt General Help and Support
You could put in some code that prevents the error in the first place. Example: #include <array.au3> Local $array[5] For $i = 0 to 10 step 1 ; loops 11 times, but the array only has 5 slots If $i <= UBound($array) - 1 Then $array[$i] = "information" EndIf Next _ArrayDisplay($array) -
Red border around window
sleepydvdr replied to Evolutionnext's topic in AutoIt General Help and Support
Sounds like you have some kind of sandboxing program running. -
You can get regsistry information in a user account, so Xandy's code works. You may have a problem with getting the GPU info. I looked up mine and it was listed here: [HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E968-E325-11CE-BFC1-08002BE10318}0000] I have a feeling that every video card will have a different class. You may have to write code that reads all classes and search the entries for major name brands (intel, amd, trident, voodoo, etc). Once you find a match, you could read registry entries from that class. So far, I don't know how to find the memory type.
-
Small bundle of (possibly silly) questions.
sleepydvdr replied to BitOfHope's topic in AutoIt General Help and Support
I can only address #2 and #3. You do not need an outside program to draw gridlines. Below is an example of your screen getting split up in to 100 equal sections. Press the ESC key to exit. #include <WinAPI.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> #NoTrayIcon $width = @DesktopWidth $height = @DesktopHeight Global $tRECT, $hFont, $hOldFont, $hDC HotKeySet("{ESC}", "_Exit") $tRECT = DllStructCreate($tagRect) DllStructSetData($tRECT, "Left", 5) DllStructSetData($tRECT, "Top", 5) DllStructSetData($tRECT, "Right", 250) DllStructSetData($tRECT, "Bottom", 50) $hDC = _WinAPI_GetDC(0) $hFont = _WinAPI_CreateFont(50, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _ $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Arial') $hOldFont = _WinAPI_SelectObject($hDC, $hFont) _WinAPI_SetTextColor($hDC, 0x0000FF) _WinAPI_SetBkColor($hDC, 0x000000) While 1 For $i = 1 To 100 step 1 _WinAPI_DrawLine($hDC, $width / 100 * $i, 0, $width / 100 * $i, $height) Next Sleep(100) WEnd Func _Exit() _WinAPI_SelectObject($hDC, $hOldFont) _WinAPI_DeleteObject($hFont) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_InvalidateRect(0, 0) $tRECT = 0 Exit EndFunc ;==>_Exit -
I modified the example in the AutoIt help file to show you a way it can be done. It works by pressing the PageDown button manually or by clicking a button. Or you could send it silently. If you are afraid of losing focus to the IE window later on, you could set a hotkey for PageDown and run a function that activates the window. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() Local $oIE = _IECreateEmbedded() GUICtrlSetState($oIE, $GUI_FOCUS) GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 40, 600, 360) Local $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) Local $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) Local $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) Local $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) Local $GUI_Button_PGDown = GUICtrlCreateButton("PG Down", 450, 420, 100, 30) GUISetState() _IENavigate($oIE, "http://www.autoitscript.com") ControlFocus("Embedded Web control Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]") ; This line sets focus to the IE window ; Waiting for user to close the window While 1 Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_Button_Home _IENavigate($oIE, "http://www.autoitscript.com") Case $msg = $GUI_Button_Back _IEAction($oIE, "back") Case $msg = $GUI_Button_Forward _IEAction($oIE, "forward") Case $msg = $GUI_Button_Stop _IEAction($oIE, "stop") Case $msg = $GUI_Button_PGDown ; This is your Page Down ControlFocus("Embedded Web control Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]") ; You have to add it here because when you click the button, you lose focus of the IE Window Send("{PGDN}") EndSelect WEnd GUIDelete() Exit
-
Hide edit scroll bars if not used
sleepydvdr replied to toonboon's topic in AutoIt GUI Help and Support
This could simulate what you want. I made it show the scroll bars after 14 lines (the limit of this particular GUI). If you go over 14 lines and then back to 14 or less, it takes away the scrollbars. It does not account for horizontal scrollbars. That might prove to be more difficult. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiScrollBars.au3> #include <GuiEdit.au3> $scroll = 0 $Form1 = GUICreate("Form1", 362, 211, 193, 125) $Edit1 = GUICtrlCreateEdit("", 16, 8, 329, 193, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, "1" & @crlf & "2" & @crlf & "3" & @crlf & "4" & @crlf & "5" & @crlf & "6" & @crlf & "7" & @crlf & "8" & @crlf & "9" & @crlf & "10" & @crlf & "11" & @crlf & "12" & @crlf & "13"); & @crlf & "14" & @crlf & "15" & @crlf & "16" & @crlf & "17" & @crlf & "18") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() $lineCount = _GUICtrlEdit_GetLineCount($Edit1) If $lineCount > 14 AND $scroll = 0 Then GUICtrlSetStyle($Edit1, BitOR($ES_AUTOVSCROLL,$WS_VSCROLL,$ES_WANTRETURN)) $scroll = 1 ElseIf $lineCount <= 14 AND $scroll = 1 Then GUICtrlSetStyle($Edit1, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN)) $scroll = 0 EndIf sleep (50) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd -
Instead of sending keys to a control, try using _INetMail to create the email message. I have used that many times in the past without any problems.
-
Are you looking for something along these lines? If $text = "Your IP" Then $text = StringReplace($text, "Your IP" Or $fr, @IPAddress1) Else $text = StringReplace($text, $fr, @IPAddress1) EndIf
-
Yes, there is. The function is @ScriptDir. MsgBox(0, "", @ScriptDir)