Jump to content

Dampe

Active Members
  • Posts

    231
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Dampe's Achievements

Polymath

Polymath (5/7)

0

Reputation

  1. Ah that would make sense
  2. I guess it would be possible but pretty impracticable. If you want to watch a movie at the same time, have a look at VLC Media player. Pretty sure you can right click and set window to be always on top which would allow you to do other things on the computer whilst watching a movie.. I use linux at home and quite a few linux desktop enviroments support virtual desktops, so I wanted one for work. I guess I learn the commands from years of programming and knowledge of the windows internal functions. I was originally using the autoit setwindowstate() function but it was too slow, hence using the user_32.dll function instead. Peace
  3. What? Yes it does. I fixed the script here. #include <array.au3> Local $Win_Max_Number = 4 Local $Key_Forward = "{PAUSE}" Local $Key_Backward = "{HOME}" Local $Window_Array[5][25] Local $Window_Current_Arr = 1 Local $Window_Current_Active = 1 OnAutoItExitRegister( "_Au3Exit" ) Local $Dll_User_32 = DllOpen("user32.dll") HotKeySet($Key_Forward, "_ScreenForward") HotKeySet($Key_Backward, "_ScreenBackward") _GenerateWindowArray() While 1 Sleep(50) _UpdateWindowArray() WEnd Func _GenerateWindowArray() $var = WinList() For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then If $var[$i][0] <> "Start" AND $var[$i][0] <> "Program Manager" Then $Window_Array[$Window_Current_Active][$Window_Current_Arr] = $var[$i][1] $Window_Current_Arr += 1 EndIf EndIf Next EndFunc ;==>_GenerateWindowArray Func _UpdateWindowArray() For $x = 1 to 4 For $i = 1 to 24 If not WinExists ($Window_Array[$x][$i]) Then $Window_Array[$x][$i] = "" $Window_Current_Arr -= 1 EndIf Next Next $var = WinList() For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then If $var[$i][0] <> "Start" AND $var[$i][0] <> "Program Manager" Then If _ArraySearch($Window_Array, $var[$i][1]) = -1 Then $Window_Array[$Window_Current_Active][$Window_Current_Arr] = $var[$i][1] $Window_Current_Arr += 1 EndIf EndIf EndIf Next EndFunc Func _ScreenForward() If $Window_Current_Active < $Win_Max_Number Then $Window_Current_Active += 1 ConsoleWrite ("Screen #: " & $Window_Current_Active & @CRLF) For $i = 1 to 24 If $Window_Array[$Window_Current_Active-1][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active-1][$i], 0) EndIf Next For $i = 1 to 24 If $Window_Array[$Window_Current_Active][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active][$i], 1) EndIf Next EndIf EndFunc ;==>_ScreenForward Func _ScreenBackward() If $Window_Current_Active > 1 Then $Window_Current_Active -= 1 ConsoleWrite ("Screen #: " & $Window_Current_Active & @CRLF) For $i = 1 to 24 If $Window_Array[$Window_Current_Active+1][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active+1][$i], 0) EndIf Next For $i = 1 to 24 If $Window_Array[$Window_Current_Active][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active][$i], 1) EndIf Next EndIf EndFunc ;==>_ScreenBackward Func _SetWindowState($hWnd, $sCode) DllCall($Dll_User_32, "bool", "ShowWindow", "HWND", $hWnd, "int", $sCode) EndFunc ;==>_SetWindowState Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible Func _Au3Exit() For $x = 1 to $Win_Max_Number For $i = 1 to 24 _SetWindowState($Window_Array[$x][$i], 1) Next Next DllClose ($Dll_User_32) EndFunc
  4. Wrote it to use at work. Change the hotkeys at the top. #include <array.au3> Local $Win_Max_Number = 4 Local $Key_Forward = "{PAUSE}" Local $Key_Backward = "{HOME}" Local $Window_Array[5][25] Local $Window_Current_Arr = 1 Local $Window_Current_Active = 1 Local $Dll_User_32 = DllOpen("user32.dll") HotKeySet($Key_Forward, "_ScreenForward") HotKeySet($Key_Backward, "_ScreenBackward") _GenerateWindowArray() While 1 Sleep(50) _UpdateWindowArray() WEnd Func _GenerateWindowArray() $var = WinList() For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then $Window_Array[$Window_Current_Active][$Window_Current_Arr] = $var[$i][1] $Window_Current_Arr += 1 EndIf Next EndFunc ;==>_GenerateWindowArray Func _UpdateWindowArray() For $x = 1 to 4 For $i = 1 to 24 If not WinExists ($Window_Array[$x][$i]) Then $Window_Array[$x][$i] = "" $Window_Current_Arr -= 1 EndIf Next Next $var = WinList() For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then If _ArraySearch($Window_Array, $var[$i][1]) = -1 Then $Window_Array[$Window_Current_Active][$Window_Current_Arr] = $var[$i][1] $Window_Current_Arr += 1 EndIf EndIf Next EndFunc Func _ScreenForward() If $Window_Current_Active < $Win_Max_Number Then $Window_Current_Active += 1 ConsoleWrite ("Screen #: " & $Window_Current_Active & @CRLF) For $i = 1 to 24 If $Window_Array[$Window_Current_Active-1][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active-1][$i], 0) EndIf Next For $i = 1 to 24 If $Window_Array[$Window_Current_Active][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active][$i], 1) EndIf Next EndIf EndFunc ;==>_ScreenForward Func _ScreenBackward() If $Window_Current_Active > 1 Then $Window_Current_Active -= 1 ConsoleWrite ("Screen #: " & $Window_Current_Active & @CRLF) For $i = 1 to 24 If $Window_Array[$Window_Current_Active+1][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active+1][$i], 0) EndIf Next For $i = 1 to 24 If $Window_Array[$Window_Current_Active][$i] <> "" Then _SetWindowState($Window_Array[$Window_Current_Active][$i], 1) EndIf Next EndIf EndFunc ;==>_ScreenBackward Func _SetWindowState($hWnd, $sCode) DllCall($Dll_User_32, "bool", "ShowWindow", "HWND", $hWnd, "int", $sCode) EndFunc ;==>_SetWindowState Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible
  5. Nevermind, resolved.
  6. Hey all, trying to automate an office 2010 install. Working fine on XP but no-go on Win7. Even though I am forcing admin execution, the script still refuses to actually launch the batch script as admin. #include <GUIConstants.au3> #NoTrayIcon #RequireAdmin #NoAutoIt3Execute $hWnd = GUICreate ("Processing..", 300, 150) $Edit = GUICtrlCreateEdit ("Webster Computers Office 2010 Auto-Installer" & @CRLF & "Starting installation process" & @CRLF, 5, 5, 290, 140) GUISetState (@SW_SHOW) $TempDir = @HomeDrive & "\" & Random (1, 99999, 1) DirCreate ($TempDir) If @error Then MsgBox (48, "Error", "Could not create directory at " & $TempDir) Exit 0 EndIf _LOG("Created temp directory at " & $TempDir) _LOG("Copying files to " & $TempDir & " please wait..") DirCopy (@ScriptDir, $TempDir, 1) _LOG("Finished cache file copy, installing Office 2010") If IsAdmin() Then $PID = Run ($TempDir & "\oemsetup.en-us.bat", $TempDir) Else While 1 $user = InputBox ("Admin-Logon", "You must be an Administrator to continue setup." & @CRlf & "Please enter your username:", "Administrator") $pass = InputBox ("Admin-Logon", "Please enter your password", "", "*") If $user <> "" AND $pass <> "" Then $PID = RunAs ($user, @ComputerName, $pass, 0, $TempDir & "\oemsetup.en-us.bat", $TempDir) If @error Then MsgBox (48, "Authentication Error", "You have entered an invalid username / password") EndIf ExitLoop EndIf WEnd EndIf While 1 If not ProcessExists ($PID) Then ExitLoop EndIf Sleep (50) WEnd Sleep (1000) _LOG("Installer Finished, removing Temp directory at " & $TempDir) DirRemove ($TempDir, 1) MsgBox (32, "Success", "Finished installing successfully") Func _LOG($string) GUICtrlSetData ($Edit, GUICtrlRead ($Edit) & $string & @CRLF) ConsoleWrite ($string & @CRLF) EndFunc
  7. Sorry, didn't mean to hard rage. Just was frustrated. Thanks, it seems assigning the value to a variable and then reading it works.
  8. First of all, I have about 150 posts more than you. Second of all, I'm not asking for help with writing a bot, I'm asking for help with a GUI Function. You have absolutely no idea what the rest of the script does. It could just be a knowledge database or something similar. And thirdly, before you go bossing people around, you should really think more before you post. You're just making yourself look stupid. If anyone doesn't want me to post this, I can re-post the same problem without battleground names for values, But I really didn't think it was necessary. Now if we could go back on topic that would be excellent.
  9. Howdy. I cannot seem to read any value from my combo box except 0. Example: $System_Drop = GUICtrlCreateCombo ("Alterac Valley", 170, 5, 145, 20) GUICtrlSetData (-1, "Arathi Basin|Warsong Gulch|Eye of the Storm", "Alterac Valley") MsgBox (32, "test", GUICtrlRead($System_Drop)) And even $System_Drop = GUICtrlCreateCombo ("Alterac Valley", 170, 5, 145, 20) GUICtrlSetData (-1, "Arathi Basin|Warsong Gulch|Eye of the Storm", "Alterac Valley") MsgBox (32, "test", _GUICtrlComboBox_GetCurSel($System_Drop)) Thanks
  10. Another program / service may be running listening on that port on your computer. Do a netstat -a or try another port
  11. Look up _FileListToArray() _ArraySearch() Easily done.
  12. I'm not blaming you for this, just suggesting what may become of it. I was more or less refering to the fact that people could use the yahoo messenger protocol to help spread their virus's. E.g. Load .exe -> steal account info from yahoo messenger -> log on to account -> send link of malicious file to all contacts.
  13. This is awesome. Although, It introduces a new level of virus's and malware to autoit.
  14. Sorry my mistake, I always get the two mixed up. Most other program I use modules for music hence my habbit of saying bassMOD.
  15. Wow that's nice! Hope all the best for the project.
×
×
  • Create New...