unquiet Posted February 19, 2012 Share Posted February 19, 2012 (edited) Autoit te belirlenen bit klavye kısayolu ile kullanıcının komutu gönderdiği dizinde yeni klasör nasıl oluşturulur. Örneğin Win 7 deki shift + ctrl + N komutu gibi xp ve vista da bunu autoit ile nasıl yapabiliriz!! Edited February 19, 2012 by unquiet Quote Link to comment Share on other sites More sharing options...
blue_life Posted February 20, 2012 Share Posted February 20, 2012 @unquiet Bir örnek hazırladım, denersin... [codebox]HotKeySet("+^n", "_Blue_Create_NewFolder") ;Shift-Ctrl-n While 1 Sleep(100) ;Cpu Save WEnd Func _Blue_Create_NewFolder() Local $WinGetActive = WinGetHandle("[active]") ;Active Title ;Local $WinGetActive = WinGetHandle("System (C:)") Local $DesktopHwnd = WinGetHandle("[Class:Progman]") If $DesktopHwnd = $WinGetActive Then If _CreateNewFolder(@DesktopDir) = 0 Then Return SetError(3, 0, 0) Return 1 EndIf ; ----------- Local $Window_Location Local $oShell = ObjCreate("shell.application") ; Get the Windows Shell Object Local $oShellWindows = $oShell.windows ; Get the collection of open shell Windows If IsObj($oShellWindows) = 0 Then Return SetError(1, 0, 0) For $Window In $oShellWindows ; Count all existing shell windows If $Window.hwnd = $WinGetActive Then $Window_Location = $Window.LocationURL $aRet = DllCall('shlwapi.dll', 'long', 'PathCreateFromUrlW', 'wstr', $Window_Location, 'wstr', '', 'dword*', 65534, 'dword', 0) If Not @error And $aRet[0] = 0 Then $Window_Location = $aRet[2] ExitLoop EndIf Next If $Window_Location = "" Or FileExists($Window_Location) = 0 Then Return SetError(2, 0, 0) If _CreateNewFolder($Window_Location) = 0 Then Return SetError(3, 0, 0) Return 1 EndFunc ;==>_Blue_Create_NewFolder Func _CreateNewFolder($Location, $FolderName = "Yeni Klasör") If StringRight($Location, 1) <> "\" Then $Location &= "\" Local $OldFolderName = $FolderName, $I = 1 While FileExists($Location & $FolderName) $FolderName = $OldFolderName & " (" & $I & ")" $I += 1 WEnd If DirCreate($Location & $FolderName) = 0 Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_CreateNewFolder [/codebox] Quote Link to comment Share on other sites More sharing options...
unquiet Posted February 20, 2012 Author Share Posted February 20, 2012 [quote name='blue_life' date='20 February 2012 - 11:05 ' timestamp='1329728731' post='1157789'] @unquiet Bir örnek hazırladım, denersin... [codebox]HotKeySet("+^n", "_Blue_Create_NewFolder") ;Shift-Ctrl-n While 1 Sleep(100) ;Cpu Save WEnd Func _Blue_Create_NewFolder() Local $WinGetActive = WinGetHandle("[active]") ;Active Title ;Local $WinGetActive = WinGetHandle("System (C:)") Local $DesktopHwnd = WinGetHandle("[Class:Progman]") If $DesktopHwnd = $WinGetActive Then If _CreateNewFolder(@DesktopDir) = 0 Then Return SetError(3, 0, 0) Return 1 EndIf ; ----------- Local $Window_Location Local $oShell = ObjCreate("shell.application") ; Get the Windows Shell Object Local $oShellWindows = $oShell.windows ; Get the collection of open shell Windows If IsObj($oShellWindows) = 0 Then Return SetError(1, 0, 0) For $Window In $oShellWindows ; Count all existing shell windows If $Window.hwnd = $WinGetActive Then $Window_Location = $Window.LocationURL $aRet = DllCall('shlwapi.dll', 'long', 'PathCreateFromUrlW', 'wstr', $Window_Location, 'wstr', '', 'dword*', 65534, 'dword', 0) If Not @error And $aRet[0] = 0 Then $Window_Location = $aRet[2] ExitLoop EndIf Next If $Window_Location = "" Or FileExists($Window_Location) = 0 Then Return SetError(2, 0, 0) If _CreateNewFolder($Window_Location) = 0 Then Return SetError(3, 0, 0) Return 1 EndFunc ;==>_Blue_Create_NewFolder Func _CreateNewFolder($Location, $FolderName = "Yeni Klasör") If StringRight($Location, 1) <> "\" Then $Location &= "\" Local $OldFolderName = $FolderName, $I = 1 While FileExists($Location & $FolderName) $FolderName = $OldFolderName & " (" & $I & ")" $I += 1 WEnd If DirCreate($Location & $FolderName) = 0 Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_CreateNewFolder [/codebox] [/quote] Çok Teşekkür Ederim @blue_life uzun süredir uğraşıyordum Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.