Jump to content

AppTux

Active Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by AppTux

  1. This UDF is still in beta, because by example Notepad is still not working. It's really strange because if I just right-click on Notepad.exe and select run as..., it's working. I don't know if it's also on other programs, your and my task to find other programs what are not working. It's experimental, I looked on the forums (), and I haven't found yet another function, so I decided to write a one by myself. If you find other bugs or programs what are not working, there could be made a kind of 'blacklist' with programs what are not working. Code: #include-once #include <File.au3> Func _ShellExecuteAs($username, $domain, $password, $logon_flag, $torun, $workingdir = @SystemDir, $show_flag = "", $opt_flag = "") Dim $szDrive, $szDir, $szFName, $szExt If $username = "" Then Return 0 ;No username given, return 0 If $domain = "" Then $domain = @ComputerName If $logon_flag = "" Then Return 0 ;No logon flag given, return 0 If $torun = "" Then Return 0 ;No run value given, return 0 If $show_flag = "" Then $no_show_flag = 1 If $opt_flag = "" Then $no_opt_flag = 1 If BitAND($no_opt_flag = 1, $no_show_flag = 1) Then $no_show_opt_flag = 1 $fileinfo = _PathSplit($torun, $szDrive, $szDir, $szFName, $szExt) $extension = $fileinfo[4] $Standard = RegRead("HKEY_CLASSES_ROOT\" & $extension, "") If $Standard = "" Then SetError(1) $ShellCommand = RegRead("HKEY_CLASSES_ROOT\" & $Standard & "\shell\open\command", "") If $ShellCommand = "" Then SetError(2) $ShellCommand = StringReplace($ShellCommand, "%1", $torun);Set parameters to $toRun $ShellCommand = StringReplace($ShellCommand, "%L", $torun);Set parameters to $toRun $ShellCommand = StringReplace($ShellCommand, "%SystemRoot%", @WindowsDir);Set the %SystemRoot% If $no_show_flag = 1 Then $runas = RunAs($username, $domain, $password, $logon_flag, $ShellCommand, $workingdir, "", $opt_flag) ElseIf $no_opt_flag = 1 Then $runas = RunAs($username, $domain, $password, $logon_flag, $ShellCommand, $workingdir, $show_flag) ElseIf $no_show_opt_flag = 1 Then $runas = RunAs($username, $domain, $password, $logon_flag, $ShellCommand, $workingdir) Else $runas = RunAs($username, $domain, $password, $logon_flag, $ShellCommand, $workingdir, $show_flag, $opt_flag) EndIf If @error Then Return -1 EndIf Return $runas ;Return Id of Process. EndFunc ;==>_ShellExecuteAs Yes, it's a really strange code, but it works! (as far I know)
  2. Thank you, but unfortunately the label isn't transparent. But that's another thing, it works, and that was it all about
  3. Did it, but I don't see the button again after I added the $WS_CLIPSIBLINGS style to the button
  4. With a script I have I want to use multiple fonts in a single button. Something like this: A button with this text: Hello World. But then I want to set a font to Hello and World separately. Arial font to Hello and Consolas to World. I tried to use a additional label, but I wasn't working, when I go with my mouse over the button, the button goes over the label I made. Is this possible? Thanks in advance, AppTux
  5. My computer is still alive!!!! Maybe your cat in a few minutes also!! Cat: Help me, I'm buried alive!!
  6. After you shot the cat you can use Sleep(negative value) again and shoot it again. And again. And again. And again. And so on. Edit: I think it's better to move this story to the Chat section
  7. When I look at your code, it's good, but why do you use a Sleep(50) in the loop what's searching for a file??? By Example: When I want to search a file what's in the system32 directory (which contains 2353 files on my XP system) and you're not lucky because the file you want to search is the last file in the folder, you have to wait about 2353 * 50 ms \ 1000 = 117,65 seconds = almost 2 minutes!!! And that's then the minimal waiting time!! There's also about a few milliseconds a file for FileFindNextFile() and I think it would totally take about 3 or 4 minutes to search for that file. I prefer the standard Explorer, browse to the folder where the file exists and just copy the file to where I want. If you want to use this program, I'll suggest to sleep less, about 10 ms, is enough I think, that's about 5 times faster! But it's good for your AutoIt skills .
  8. Just put it in a function and use HotKeySet() edit: lol, posting same time
  9. I'll try tomorrow, I don't have time today
  10. Can you explain better because I don't understand what you want to do, you mean a 'embedded' picture? Then will I use INetGet() to download the file to the Temp dir and make a picture using GUICtrlCreatePic() P.S. : Your image doesn't work, get this error: An error occurred: Input error: Invalid referer
  11. I don't know, but if you really want to know, I think you have to go to the developers - they made these functions..
  12. I think you first have to compile the program, because Run() can't run a .au3 as far as I know, try to do it with the compiled script or use ShellExecute() instead.
  13. Did some research in the registry, and in the .png folder in the registry there isn't a shell subfolder, but: OpenWithListOpenWithProgIdsPersistentHandlerAnd in the OpenWithList folder are 2 subfolders called: ois.exePictureViewer.exeAnd in the folder OpenWithProgIds are 3 REG_NONE values, and 1 REG_SZ value.REG_NONE keys: Opera.imagepngfileQuickTime.pngAnd these means to the same called folders in the HKEY_CLASSES_ROOT folder.And in those is a folder named shell. Now I have to find out where is written which one is used (Opera.image, pngfile or QuickTime.png). Anyone a idea? P.S. : registry is so confusing...
  14. Thanks for all your replies, I'll try soon, but how about images or whatever, do I have to replace Local $gb_RegRead = RegRead("HKEY_CLASSES_ROOT\http\shell\open\command", "") with this: ($extension is the extension of the file, like .au3, .png, .jpg, .bat) Local $gb_RegRead = RegRead("HKEY_CLASSES_ROOT\" & $extension & "\shell\open\command", "") Edit: edited syntax above
  15. That's possible, I also was thinking about that, but I'm working on a more advanced run for Windows, with functions like a logfile, abbreviations and search on the internet using search engines, so it's a bit more complicated than you suggested
  16. I already did that, but if I want to open the site (like www.autoitscript.com) it's impossible for RunAs. I was thinking about a ShellExecuteAs() function made by myself. But that's really hard I think, but it's possible, but you need a lot of time to make such a good function as ShellExecute(). Maybe if I don't have anything else to do, can I try to make a ShellExecuteAs() but not now.... Not interested and I have other things to do.
  17. Is it possible to make or is there already a ShellExecuteAs function??? Thanks in advance, AppTux
  18. I think ModernMenu is what you're looking, for, but I'm not sure. Look at page.
  19. Nice program in the list of screen locks . But when the screen is locked, I still see a small strip of my wallpaper: just modify this code: $Locked = GUICreate("Desktop Locker", @DesktopWidth+3, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) ;Should be: $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) And it would be nice if the progress bar is a bit higher on the screen, because the label overlaps the progress and vice-versa. Just modify the progress code: $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) /2, @DesktopHeight/2 + 20, 400, 10) Now it's a bit bigger and it doesn't overlap the label or whatever on my 1280x1024px screen. Another remark: why would you set the data of the input and wrong password label to nothing if the program is just gonna closed??? And why would you set the data of the progress to 100 if it's already 100??? I don't want to nag a lot, but you just have useless functions used and you could make your code shorter P.S. I ran Tidy on it because it was not so clear for me. Code after I modified it: #NoTrayIcon #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ScrollBarConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <GuiEdit.au3> #include <Misc.au3> While 1 $code = InputBox("Desktop Locker", "Safety. Please reset your password." & @CRLF & @CRLF & "Enter:New Password", Default, "", 250, 143, 370, 300) If @error Then Exit ElseIf $code = '' Then ToolTip("Please enter your password in the spaces.", 370, 300, "Desktop Locker", 1, 0) Sleep(3000) ToolTip("") Else $plate = StringReplace($code, "|", @CRLF) $Password = $plate ExitLoop EndIf WEnd $btn = MsgBox(36, "Desktop Locker", "You want to lock the screen with this code (" & $Password & ")? ") If $btn = 6 Then $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0x000000, $Locked) $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) / 2, @DesktopHeight / 2 + 20, 400, 10) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreatePic("lock.gif", 430, 130, 164, 144) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @DesktopHeight - 14, BitOR($ES_AUTOVSCROLL, $ES_READONLY), 0) $InputPw = GUICtrlCreateInput("", @DesktopWidth / 2 - 100, @DesktopHeight / 2 - 10, 200, 20, BitOR($ES_CENTER, $ES_PASSWORD), 0) GUICtrlCreateLabel("Desktop Locker", @DesktopWidth / 2 - 125, @DesktopHeight / 2 - 95, 260, 50, $ES_CENTER, 0) GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x000000) GUICtrlCreateLabel("Please enter a password to unlock the screen.", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetFont($WrongPw, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor($WrongPw, 0xFFFFFF) GUICtrlSetBkColor($WrongPw, 0x000000) GUICtrlSetFont($InputPw, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor($InputPw, 0xFFFFFF) GUICtrlSetBkColor($InputPw, 0x000000) WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE) GUISetState(@SW_SHOW, $Locked) _MouseTrap(@DesktopWidth, @DesktopHeight) While 1 If _IsPressed("0D") Then If GUICtrlRead($InputPw) == '' Then ToolTip("Forgot your password. Please enter the correct", 509, 375, "", 1, 3) ToolTip("") ElseIf GUICtrlRead($InputPw) == $Password Then For $i = 0 To 100 Step 10 GUICtrlSetData($Progress1, $i) Sleep(50) Next GUISetState(@SW_HIDE, $Locked) WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW) _MouseTrap() ExitLoop Else GUICtrlSetData($WrongPw, _RandomMsg() & @CRLF & GUICtrlRead($WrongPw)) ToolTip("The password is incorrect ..try again.", 509, 375, "", 3, 3) Sleep(2000) ToolTip("") GUICtrlSetData($InputPw, "") EndIf EndIf If Not WinActive("Desktop Locker") Then WinActivate("Desktop Locker") _MouseTrap(@DesktopWidth, @DesktopHeight) GUICtrlCreateLabel("MESS WITH THE BEST DIE LIKE THE REST!", Random(@DesktopWidth - 540), Random(@DesktopHeight - 30), 540, 30) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetBkColor(-1, 0x000000) EndIf WEnd Else Exit EndIf Func _RandomMsg() Local $RandomMsg[10] $RandomMsg[0] = "Wrong Password!" $RandomMsg[1] = "Step away from the computer." $RandomMsg[2] = "Your not Jim." $RandomMsg[3] = "Give Up!" $RandomMsg[4] = "Don't Touch!" $RandomMsg[5] = "Please Enter Correct Password." $RandomMsg[6] = "Try Again!" $RandomMsg[7] = "Stop pushing my buttons." $RandomMsg[8] = "INS! INS!" $RandomMsg[9] = "Ctrl-Alt-Dipshit" Return $RandomMsg[Random(10)] EndFunc ;==>_RandomMsg
  20. Good work , but I'll recommend to let the password GUI also fade in, just add this code to the script: After the password Gui is made, add this code: WinSetTrans($PwdGui, "", 0) And in the fade in loop: WinSetTrans($PwdGui, "", $TRANS) One remark: Why do you split the password, and in the loop, if the length is 4 digits, then check every single digit, and turn the slider on???? That's so... useless I think. Maybe you just save the password in a variable, and use GUICtrlRead() to read the password input, and compare the password variable and the string what's just read??? That makes difference in code length and speed I think... I'll post the modified code soon, I'm not always busy with PS2U, I've done a time nothing with it because I'm busy with other programs..
  21. Whoa........... I'm quiet of it... amazing.... Really like this and keep up the good work Could be nice for some bigger programs like White Eagle Media Player by ludocus
  22. @jscript that's strange, because I see something happen: the window gets darker... (when the MsgBox is opened)
  23. I still don't know what the issue is of the password field flickering, but the width of the slider fits perfectly on my PC and I don't have problems with it. If too many people say the slider is too big, then I'm gonna make 2 versions for different resolutions. Btw, if you remove this code, is the flickering gone??? If $PwdOpen = 0 Then If Not WinActive($MGUI, "") Then WinActivate($MGUI, "") Else If Not WinActive($PwdGui, "") Then WinActivate($PwdGui, "") ConsoleWrite("$PwdGui activated" & @CR) EndIf EndIf If you remove this code, the window won't stay always on top anymore. But it could be possible that the flickering is gone then..
  24. I also tried to find that, I just use arrays instead of that... And in your case you have to use multidimensional arrays I think.
  25. Yes I also heard of the password field flicker, but if you have recommends, PLEASE post them to the topic, because now it's gonna go off-topic
×
×
  • Create New...