psynegy Posted January 9, 2009 Posted January 9, 2009 (edited) Okay, so I've been really bored lately, and have thus been adding to a little program I started ages ago, and I keep adding new features to it, because basically I have no life.It's essentially a tool for locking your computer using a 4 digit pin code, simpler than a password, but secure none the less.Locked screenshot:Settings Page:Features:- Customisable GUI (replaceable images)- Settings INI file- Update notification- Complete lockout (even on PC's without Welcome Screen)- First-run setup configuration screen- Ability to take pictures using webcam when the pincode is entered incorrectly, or correctly, or both.- Option to enable windows live messenger "open chat windows" feature. (lists all open conversations)- Ability to pause and resume iTunes on lock/unlock.- Power saving, turns monitors off after 30 seconds of locked inactivity!- Works on dual displays!- A clock...Thanks to:- GaryFrost (For the WinAPI timer functions, which power the clock and monitor switch off)New in 1.1.4- Fix for when messenger is not running.- Adjustment of how messenger window list updates.- A clockNew in 1.2.0- Gmail check- Removed webcam feature (too slow)- INI encryption of Gmail password an PIN (at last)- A few bug fixesCURRENT VERSION: 1.2.0LockPC.zipSource:expandcollapse popup#include <EditConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <Misc.au3> #include <String.au3> #include <Array.au3> #NoTrayIcon Opt("WinTitleMatchMode", 4) If _Singleton("OllieB.net-LockPC", 1) = 0 Then ProcessClose("LockPC.exe") ProcessWaitClose("LockPC.exe") Exit EndIf $_VERSION = '1.2.0' $_SETTINGS = "settings.ini" $_CRYPTSTRING = "lockPCau3ollieb.net" Global $_COPYRIGHT = "LockPC " & $_VERSION & @CRLF & "© OllieB.net" Global Enum $TIMERID1 = 1001 $winlock = DllOpen("WinLockDll.dll") If Not FileExists("settings.ini") Then MsgBox(0, "Firstrun", "Welcome to LockPC, the next step will help you configure LockPC." & @CRLF & @CRLF & "To run this setup again or change your lock code, delete the settings.ini found in the installation directory.") CreateSettingsFile() Else $_INIVERSION = IniRead("settings.ini", "app", "version", '0') If $_VERSION <> $_INIVERSION Then MsgBox(0, "Error", "Your settings file was created in a different version, creating a new one...") FileDelete("settings.ini") CreateSettingsFile() EndIf EndIf Global $passcode = _StringEncrypt(0, IniRead($_SETTINGS, "set", "passcode", '0000'), $_CRYPTSTRING) Global $itunes_pause_resume = IniRead($_SETTINGS, "set", "itunes_pause_resume", '0') Global $monitor_idle_off = IniRead($_SETTINGS, "set", "monitor_idle_off", '0') Global $messenger_contact_list = IniRead($_SETTINGS, "set", "messenger_contact_list", '0') Global $display_clock = IniRead($_SETTINGS, "set", "display_clock", '0') Global $beep_on_deny = IniRead($_SETTINGS, "set", "beep_on_deny", '0') Global $gmail_count = IniRead($_SETTINGS, "set", "gmail_count", '0') Global $gmail_username = IniRead($_SETTINGS, "set", "gmail_username", '0') Global $gmail_password = _StringEncrypt(0, IniRead($_SETTINGS, "set", "gmail_password", ''), $_CRYPTSTRING) If Not IsDeclared("SM_VIRTUALWIDTH") Then Global Const $SM_VIRTUALWIDTH = 78 If Not IsDeclared("SM_VIRTUALHEIGHT") Then Global Const $SM_VIRTUALHEIGHT = 79 $VirtualDesktopWidth = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALWIDTH) $VirtualDesktopWidth = $VirtualDesktopWidth[0] $VirtualDesktopHeight = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALHEIGHT) $VirtualDesktopHeight = $VirtualDesktopHeight[0] Global $_WinWidth=$VirtualDesktopWidth Global $_WinHeight=$VirtualDesktopHeight Global $prevleng = 0 Global $mainpassentry Global $hwnd = WinGetHandle("classname=Progman") Global $user32 = DllOpen("user32.dll") Global $last_active = 0 Global $timer = TimerInit() Global $oiTunes Global $DELAYTIMER = TimerInit() Global $DELAY = 3 Global $DELAYTIMER2 = TimerInit() Global $DELAY2 = 5 Global $new_data = "Loading..." Global $old_data = "" Global $_INFO[1] HotKeySet("{SPACE}", "DoNothing") HotKeySet("{LEFT}", "DoNothing") HotKeySet("{RIGHT}", "DoNothing") HotKeySet("{UP}", "DoNothing") HotKeySet("{DOWN}", "DoNothing") HotKeySet("{TAB}", "DoNothing") HotKeySet("{F1}", "DoNothing") MainLock() Func DoNothing() Return EndFunc Func CheckUpdates($_VERSION) TCPStartup() $addr = "ollieb.net" $sc = TCPConnect(TCPNameToIP($addr), 80) $path = "/apps/lockpc.php?ver=" & $_VERSION If @error Or $sc < 1 Then Return Else $request = "GET " & $path & " HTTP/1.0" & @CRLF & "Host:" & $addr & @CRLF & @CRLF TCPSend($sc, $request) While 1 $recv = TCPRecv($sc, 1024) $recv = StringRight($recv, 1) If @error Then ExitLoop If $recv <> "" Then If $recv = 1 Then MsgBox(64, "Notification", "There is an update available for LockPC.") EndIf ExitLoop EndIf WEnd EndIf TCPShutdown() EndFunc Func CheckGmail() $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", "https://mail.google.com/mail/feed/atom", False) $oHTTP.SetCredentials($gmail_username, $gmail_password, 0) $oHTTP.Send() $response = $oHTTP.ResponseText If StringInStr($response, "<fullcount>", false) Then $_COUNT = _StringBetween($response, "<fullcount>", "</fullcount>") $_COUNT = Int($_COUNT[0]) $s = "s" If $_COUNT = 0 Then $_COUNT = "no" ElseIf $_COUNT = 1 Then $s = "" EndIf $_RETURN = "You have " & $_COUNT & " new email" & $s Else $_RETURN = "Gmail Error" $_COUNT = False EndIf $_INFO[$gmail_count_i] = $_RETURN EndFunc Func timerevent($hWnd, $Msg, $iIDTimer, $dwTime) If $display_clock = 1 Then GUICtrlSetData($CLOCK, @HOUR & ":" & @MIN & ":" & @SEC) EndIf If $messenger_contact_list = 1 Then If Int(TimerDiff($DELAYTIMER)/1000) > $DELAY Then msnwindowlist() $DELAYTIMER = TimerInit() EndIf EndIf If $gmail_count = 1 Then If Int(TimerDiff($DELAYTIMER2)/1000) > $DELAY2 Then CheckGmail() $DELAYTIMER2 = TimerInit() EndIf EndIf EndFunc Func msnwindowlist() If ProcessExists("msnmsgr.exe") Then $processes = ProcessList("msnmsgr.exe") For $i = 1 To $processes[0][0] $MSNPID = $processes[$i][1] Next $var = WinList() $list = "" For $i = 1 to $var[0][0] If WinGetProcess($var[$i][0]) = $MSNPID AND $var[$i][0] <> "Windows Live Messenger" AND $var[$i][0] <> "" AND IsVisible($var[$i][1]) AND StringRight($var[$i][0], 5) <> "Alert" Then $list = $list & $var[$i][0] & @LF EndIf Next If $list = "" Then $_RETURN = "None " Else $_RETURN = $list EndIf $_INFO[$messenger_contact_list_i] = "Conversation Windows" & @LF & @LF & $_RETURN EndIf Return "WLM not running " EndFunc Func disableCTRLALTDEL($value) If $value Then DllCall($winlock, "Int", "CtrlAltDel_Enable_Disable", "Int", "0") DllCall($winlock, "Int", "TaskSwitching_Enable_Disable", "Int", "0") Else DllCall($winlock, "Int", "CtrlAltDel_Enable_Disable", "Int", "1") DllCall($winlock, "Int", "TaskSwitching_Enable_Disable", "Int", "1") EndIf EndFunc Func IsVisible($handle) If BitAnd(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc Func CreateSettingsFile() $settingsform = GUICreate("LockPC", 266, 360) GUICtrlCreateGroup("Settings", 8, 8, 249, 300) $set_pinentry = GUICtrlCreateInput("", 120, 29, 49, 21, $ES_PASSWORD) GUICtrlSetLimit($set_pinentry, 4) GUICtrlCreateLabel("Create a new PIN:", 24, 32, 91, 17) $set_itunes = GUICtrlCreateCheckbox("Pause/Play iTunes.", 24, 64, 193, 17) $set_monitors = GUICtrlCreateCheckbox("Monitors standby after 30s inactivity.", 24, 96, 193, 17) $set_beep_on_deny = GUICtrlCreateCheckbox("Beep on false entry.", 24, 128, 193, 17) $set_messenger_contact_list = GUICtrlCreateCheckbox("Display WLM conversation list.", 24, 160, 193, 17) $set_display_clock = GUICtrlCreateCheckbox("Display clock on lock screen.", 24, 192, 193, 17) $set_gmail_count = GUICtrlCreateCheckbox("Display G-Mail count.", 24, 224, 193, 17) GUICtrlCreateLabel("Username:", 24, 252, 100, 18) GUICtrlCreateLabel("Password:", 138, 252, 100, 18) $set_gmail_username = GUICtrlCreateInput("", 24, 270, 100, 21, $ES_READONLY) $set_gmail_password = GUICtrlCreateInput("", 138, 270, 100, 21, BitOr($ES_PASSWORD, $ES_READONLY)) GUICtrlCreateGroup("", -99, -99, 1, 1) $set_save = GUICtrlCreateButton("Save", 32, 323, 83, 25, $BS_DEFPUSHBUTTON) $set_cancel = GUICtrlCreateButton("Cancel", 144, 323, 83, 25, 0) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $set_gmail_count If BitAnd(GUICtrlRead($set_gmail_count), $GUI_CHECKED) = 1 Then GUICtrlSetStyle($set_gmail_username, $GUI_SS_DEFAULT_INPUT) GUICtrlSetStyle($set_gmail_password, $GUI_SS_DEFAULT_INPUT) Else GUICtrlSetData($set_gmail_username, "") GUICtrlSetData($set_gmail_password, "") GUICtrlSetStyle($set_gmail_username, $ES_READONLY) GUICtrlSetStyle($set_gmail_password, $ES_READONLY) EndIf Case $set_save $set_pinentry_r = GUICtrlRead($set_pinentry) if StringLen($set_pinentry_r) <> 4 Then MsgBox(0, "Error", "Sorry, your PIN must be exactaly 4 characters") ContinueLoop EndIf $set_itunes_r = BitAnd(GUICtrlRead($set_itunes), $GUI_CHECKED) $set_monitors_r = BitAnd(GUICtrlRead($set_monitors), $GUI_CHECKED) $set_messenger_contact_list_r = BitAnd(GUICtrlRead($set_messenger_contact_list), $GUI_CHECKED) $set_beep_on_deny_r = BitAnd(GUICtrlRead($set_beep_on_deny), $GUI_CHECKED) $set_display_clock_r = BitAnd(GUICtrlRead($set_display_clock), $GUI_CHECKED) $set_gmail_count_r = BitAnd(GUICtrlRead($set_gmail_count), $GUI_CHECKED) $set_gmail_username_r = GUICtrlRead($set_gmail_username) $set_gmail_password_r = GUICtrlRead($set_gmail_password) GUIDelete($settingsform) ExitLoop Case $set_cancel Exit Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd IniWrite($_SETTINGS, "app", "version", $_VERSION) IniWrite($_SETTINGS, "set", "passcode", _StringEncrypt(1, $set_pinentry_r, $_CRYPTSTRING)) IniWrite($_SETTINGS, "set", "itunes_pause_resume", $set_itunes_r) IniWrite($_SETTINGS, "set", "monitor_idle_off", $set_monitors_r) IniWrite($_SETTINGS, "set", "messenger_contact_list", $set_messenger_contact_list_r) IniWrite($_SETTINGS, "set", "beep_on_deny", $set_beep_on_deny_r) IniWrite($_SETTINGS, "set", "display_clock", $set_display_clock_r) IniWrite($_SETTINGS, "set", "gmail_count", $set_gmail_count_r) IniWrite($_SETTINGS, "set", "gmail_username", $set_gmail_username_r) IniWrite($_SETTINGS, "set", "gmail_password", _StringEncrypt(1, $set_gmail_password_r, $_CRYPTSTRING)) if @error <> 0 Then MsgBox(0, "Error", "There was an error creating the .ini file. Check permissions and location of executable." EndIf EndFunc Func _CheckIdle(ByRef $last_active, $start = 0) $struct = DllStructCreate("uint;dword") DllStructSetData($struct, 1, DllStructGetSize($struct)) If $start Then DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct)) $last_active = DllStructGetData($struct, 2) Return $last_active Else DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct)) If $last_active <> DllStructGetData($struct, 2) Then Local $save = $last_active $last_active = DllStructGetData($struct, 2) Return $last_active - $save EndIf EndIf EndFunc Func _WinAPI_KillTimer($hWnd, $iIDEvent) Local $iResult = DllCall("user32.dll", "int", "KillTimer", "hwnd", $hWnd, "int", $iIDEvent) If @error Then Return SetError(-1, -1, 0) Return $iResult[0] <> 0 EndFunc Func _WinAPI_SetTimer($hWnd, $iIDEvent, $iElapse, $pTimerFunc = 0) Local $iResult = DllCall("user32.dll", "int", "SetTimer", "hwnd", $hWnd, "int", $iIDEvent, "int", $iElapse, "ptr", $pTimerFunc) If @error Then Return SetError(-1, -1, 0) Return $iResult[0] EndFunc Func MainLock() Local $iTimer1, $hCallBack Global $_MAINGUI = GUICreate("LockPC Main", $_WinWidth,$_WinHeight, 0, 0, 0x80000000, 136) GUISetCursor(16,1) GUISetBkColor(0x000000) $mainpassentry = GUICtrlCreateInput("", -100, -100, 0, 0) GUICtrlSetLimit($mainpassentry, 4) ;SETUP INFO DISPLAY If $gmail_count = 1 Then Global $gmail_count_i = UBound($_INFO) _ArrayAdd($_INFO, "") CheckGmail() EndIf If $messenger_contact_list = 1 Then Global $messenger_contact_list_i = UBound($_INFO) _ArrayAdd($_INFO, "") msnwindowlist() EndIf ;END INFO DISPLAY $mainimage = GUICtrlCreatePic("img/0.jpg", ((@DesktopWidth/2)-(500/2)), ((@DesktopHeight/2)-(190/2))-50, 0, 0) ;START CLOCK If $display_clock = 1 Then Global $CLOCK = GUICtrlCreateLabel(@HOUR & ":" & @MIN & ":" & @SEC, ((@DesktopWidth/2)-(400/2)), ((@DesktopHeight/2)-(190/2))/2-(80/2), 400, 80, $SS_CENTER) GUICtrlSetColor(-1, 0x999999) GUICtrlSetFont(-1, 30, 600, 0, "Verdana") EndIf ;END CLOCK ;START COPYRIGHT $COPYRIGHT = GUICtrlCreateLabel("LockPC v" & $_VERSION & @LF & "© OllieB.net", 4, 4, 100, 45, 0x) GUICtrlSetColor(-1, 0x999999) GUICtrlSetFont(-1, 7) ;END COPYRIGHT If UBound($_INFO) > 0 Then Global $_INFOLIST = GUICtrlCreateLabel("Loading ", @DesktopWidth-((@DesktopWidth/2)-(500/2)), 4, ((@DesktopWidth/2)-(500/2)), @DesktopHeight-40, $SS_RIGHT) GUICtrlSetColor(-1, 0x999999) GUICtrlSetFont(-1, 7) EndIf GUISetState(@SW_SHOW, $_MAINGUI) disableCTRLALTDEL(True) If $itunes_pause_resume = 1 Then If ProcessExists("itunes.exe") Then $oiTunes = ObjCreate("iTunes.Application") If IsObj($oiTunes) Then $oiTunes.pause EndIf EndIf If IsObj($oiTunes) Then $oiTunes.pause EndIf EndIf ;SETUP TIMER $hCallBack = DllCallbackRegister("timerevent", "none", "hwnd;int;int;dword") $iTimer1 = _WinAPI_SetTimer($_MAINGUI, $TIMERID1, 500, DllCallbackGetPtr($hCallBack)) While 1 $msg = GUIGetMsg() If Not WinActive("LockPC Main") Then WinActivate("LockPC Main") EndIf If ControlGetFocus("LockPC Main") <> "Edit1" Then ControlFocus("LockPC Main", "", "Edit1") EndIf If $prevleng <> StringLen(GUICtrlRead($mainpassentry)) Then GUICtrlSetImage($mainimage, "img/" & StringLen(GUICtrlRead($mainpassentry)) & ".jpg") $prevleng = StringLen(GUICtrlRead($mainpassentry)) EndIf $new_data = "" For $i = 1 to UBound($_INFO)-1 Step +1 $new_data = $new_data & $_INFO[$i] & @CR & @CR Next If $old_data <> $new_data Then GUICtrlSetData($_INFOLIST, $new_data) $old_data = $new_data EndIf $not_idle = _CheckIdle($last_active) If $not_idle <> 0 Then $timer = TimerInit() If Int(TimerDiff($timer)/1000) > 20 Then If $monitor_idle_off = 1 Then DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", 274, "int", 61808, "int", 2) EndIf EndIf Select Case StringLen(GUICtrlRead($mainpassentry)) = '4' If(GUICtrlRead($mainpassentry) = $passcode) Then If $itunes_pause_resume = 1 Then If IsObj($oiTunes) Then $oiTunes.play EndIf EndIf _WinAPI_KillTimer($_MAINGUI, $iTimer1) DllCallbackFree($hCallBack) disableCTRLALTDEL(False) DllClose($winlock) Sleep(150) GUIDelete($_MAINGUI) HotKeySet("{SPACE}") HotKeySet("{LEFT}") HotKeySet("{RIGHT}") HotKeySet("{UP}") HotKeySet("{DOWN}") HotKeySet("{TAB}") HotKeySet("{F1}") CheckUpdates($_VERSION) Exit Else GUICtrlSetImage($mainimage, "img/e.jpg") Sleep(150) If $beep_on_deny = 1 Then Beep(500, 150) Beep(200, 350) Else Sleep(500) EndIf GUICtrlSetData($mainpassentry, "") EndIf EndSelect WEnd EndFunchttp://i.creativecommons.org/l/by-nc-nd/2.0/uk/88x31.pngLicence DetailsLet me know if you find any bugs or errors, or what-not. Also suggestions are greatly appreciated!EditIt seems some people have taken this script and used it as their own without my permission or even any recognition. Sad really. Edited November 4, 2009 by psynegy Zip removed until OP verfies information requested.
iHonda Posted January 10, 2009 Posted January 10, 2009 (edited) taking a look at it now from what i see so far i see alot of stuff i might try to integrate into my latest project, any chance i could get a look at the source?? Edited January 10, 2009 by Zmaster A great place to start Autoit 1-2-3
FireFox Posted January 10, 2009 Posted January 10, 2009 @psynegy Looks nice @iHonda Can you take a look to Lock'n ? I think you will like it Cheers, FireFox.
psynegy Posted January 10, 2009 Author Posted January 10, 2009 New version (1.1.3) released. Few fixes, some major improvements with key-catching. If there are any problems, let me know!! @iHonda I'd rather not release the whole thing, if you let me know what you wanted, I can release it on a need to know basis. @FireFox Thanks
iHonda Posted January 11, 2009 Posted January 11, 2009 @psynegy sure ill get a list of what i would like to see and pm u @firefox sure ill take a look ^^ A great place to start Autoit 1-2-3
FireFox Posted January 11, 2009 Posted January 11, 2009 @psynegy Because youre using dll its easy to lock what you want etc... Im sure you can do it in autoit Cheers, FireFox.
psynegy Posted January 11, 2009 Author Posted January 11, 2009 (edited) @psynegyBecause youre using dll its easy to lock what you want etc... Im sure you can do it in autoit Cheers, FireFox.Can't block CTRL+ALT+DEL, winkey, alt+tab. The DLL sorts all that out for me Edit:I say that, but I've just looked at the source of the DLL, and I'm sure that can be done in autoit, but I have no idea how... I'll post in the help forum... Edited January 11, 2009 by psynegy
FireFox Posted January 11, 2009 Posted January 11, 2009 (edited) @psynegy Can't block CTRL+ALT+DEL, winkey, alt+tab. The DLL sorts all that out for meWrong ! ;DISABLE CTRL+ALT+DEL RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system", "DisableTaskMgr", "REG_DWORD", "1") ;ENABLE CTRL+ALT+DEL ;~ RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system", "DisableTaskMgr")oÝ÷ ØZ+´þLr¢çȦ¦¡×°whÃ^+Z¦®Æ®¶sevÆR¢bväW7G2gV÷Cµ´4Ä53¢33#ssÒgV÷C²ÂgV÷C²gV÷C²FVà¢vå6WE7FFRgV÷Cµ´4Ä53¢33#ssÒgV÷C²ÂgV÷C²gV÷C²Â5uôDR¢väÖæÖ¦TƲÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒТVæD`¥tVæ@ Cheers, FireFox. Edited January 11, 2009 by FireFox
psynegy Posted January 11, 2009 Author Posted January 11, 2009 @psynegy Wrong ! ;DISABLE CTRL+ALT+DEL RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system", "DisableTaskMgr", "REG_DWORD", "1") ;ENABLE CTRL+ALT+DEL ;~ RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system", "DisableTaskMgr")oÝ÷ ØZ+´þLr¢çȦ¦¡×°whÃ^+Z¦®Æ®¶sevÆR¢bväW7G2gV÷Cµ´4Ä53¢33#ssÒgV÷C²ÂgV÷C²gV÷C²FVà¢vå6WE7FFRgV÷Cµ´4Ä53¢33#ssÒgV÷C²ÂgV÷C²gV÷C²Â5uôDR¢väÖæÖ¦TƲÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒТVæD`¥tVæ@ Cheers, FireFox. What I wanted to avoid was things like winkey+L (for XP home users) and the CTRL+ALT+DEL screen that domain users get (which I am). And it just makes it seem more stable, not having the start menu appear and vanish quickly...
FireFox Posted January 11, 2009 Posted January 11, 2009 (edited) @psynegyWhat I wanted to avoid was things like winkey+L (for XP home users) and the CTRL+ALT+DEL screen that domain users get (which I am). And it just makes it seem more stable, not having the start menu appear and vanish quickly...you can disable keyboard keys with this UDF : http://www.autoitscript.com/forum/index.php?showtopic=82650Cheers, FireFox. Edited January 11, 2009 by FireFox
iHonda Posted January 11, 2009 Posted January 11, 2009 thats pretty good ill post my first lock i made in a bit im trying to add it to some other things as well as add some functionality to it. @psynegy if possible could i see how you did the web cam feature as well as the dual display? A great place to start Autoit 1-2-3
psynegy Posted January 11, 2009 Author Posted January 11, 2009 thats pretty good ill post my first lock i made in a bit im trying to add it to some other things as well as add some functionality to it. @psynegy if possible could i see how you did the web cam feature as well as the dual display? Code for dual-screen coverageness: #include <GUIConstantsEx.au3> If Not IsDeclared("SM_VIRTUALWIDTH") Then Global Const $SM_VIRTUALWIDTH = 78 If Not IsDeclared("SM_VIRTUALHEIGHT") Then Global Const $SM_VIRTUALHEIGHT = 79 $VirtualDesktopWidth = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALWIDTH) $VirtualDesktopWidth = $VirtualDesktopWidth[0] $VirtualDesktopHeight = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALHEIGHT) $VirtualDesktopHeight = $VirtualDesktopHeight[0 $_MAINGUI = GUICreate("LockPC Main", $VirtualDesktopWidth,$VirtualDesktopHeight, 0, 0, 0x80000000, 136) GUISetCursor(16,1) GUISetBkColor(0x000000) GUISetState(@SW_SHOW, $_MAINGUI) Sleep(1000) And the code for webcam: expandcollapse popup$WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START + 100 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WS_VISIBLE = 0x10000000 $WS_CHILD = 0x40000000 Func _SnapShot($path) $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") $Main = GUICreate("", 0, 0) $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD, $WS_VISIBLE), "int", 15, "int", 15, "int", 0, "int", 0, "hwnd", $Main, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) GUISetState(@SW_HIDE) ;TAKE PIC DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $path) ;KILL CAM DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) ;DllClose($avi) ;DllClose($user) EndFunc _SnapShot("C:\Documents and Settings\Ollie\My Documents\AutoIt\test.jpg")
iHonda Posted January 12, 2009 Posted January 12, 2009 awesome! thank you A great place to start Autoit 1-2-3
psynegy Posted January 13, 2009 Author Posted January 13, 2009 Post your Code .au3 plssIf you read, you'll see that I don't want to release the code. But I'm happy to give certain bits.
iHonda Posted January 13, 2009 Posted January 13, 2009 Post your Code .au3 plssMight I refer you to : http://www.autoitscript.com/forum/index.php?showtopic=65889 this regards asking for source also if you had read the very first reply i had already asked XD A great place to start Autoit 1-2-3
psynegy Posted January 16, 2009 Author Posted January 16, 2009 New version released: 1.1.4Enjoy Any suggestions for features, I'd be happy to hear them!!
etfaker Posted February 9, 2009 Posted February 9, 2009 (edited) http://www.virustotal.com/de/analisis/4847...3e4d25f28305c4dlooks like a trojan? Also my firewall said smth about remoteport when testing this programm.. why needs such a programm i-net cconnection? and even remote port?and then he doest publish his code.. okayi dont trust it at all :DD@edit: some private programm (wont tell u name even if its private only) tells me that this program isn´t even coded with autoit.. and watching his site it tells me like he has smth to do with hacking .. which tells me it is pretyt sure a pw stealer or trojan or what ever..sad since it is a rly nice programmremote.ip:93.89.83.250:80 Edited February 9, 2009 by etfaker
ProgAndy Posted February 10, 2009 Posted February 10, 2009 (edited) Just one thing: i checked the connection with Ethereal. The app does exactly one HTTP-query. It checks for a new version... ->URL: http://ollieb.net/apps/lockpc.php?ver=1.1.4 No. Time Source Destination Protocol Info 6 7.387592 123.456.789.12 93.89.83.250 HTTP GET /apps/lockpc.php?ver=1.1.4 HTTP/1.0And it IS AutoIt: OllyDbg just opens the MsgBox: --------------------------- --------------------------- This is a compiled AutoIt script. AV researchers please email avsupport@autoitscript.com for support. --------------------------- OK --------------------------- //Edit: I know, there is a thread about this, but I want other people not to be scared of downloading this cool app Btw: I like the design of the input-boxes. Edited February 10, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Moderators SmOke_N Posted February 10, 2009 Moderators Posted February 10, 2009 Just one thing: i checked the connection with Ethereal. The app does exactly one HTTP-query. It checks for a new version... ->URL: http://ollieb.net/apps/lockpc.php?ver=1.1.4 And it IS AutoIt: OllyDbg just opens the MsgBox: --------------------------- --------------------------- This is a compiled AutoIt script. AV researchers please email avsupport@autoitscript.com for support. --------------------------- OK --------------------------- //Edit: I know, there is a thread about this, but I want other people not to be scared of downloading this cool app Btw: I like the design of the input-boxes.Thanks ProgAndy, I am however locking this topic until the OP graciously answers a few questions I sent to their PM box. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now