반응형

 

 

 

대박입니다. 이걸 이제야 봤는지 

오토핫키 v1 에서 v2로 스크립트를 변환해주는 변환 스크립트입니다.

글을보니 아직 몇몇은 개발중이라고 하긴하는데

 

간단한 스크립트등 변환을 잘해주는 듯합니다

 

 

원문 주소입니다

https://www.autohotkey.com/boards/viewtopic.php?f=83&t=25100

 

v1 -> v2 Script Converter - AutoHotkey Community

@ Quote 27 Jul 2021, 16:53 Is somebody planning of updating this convertor to the new AHK V2 Beta? I tried it out on a script, it did some conversion wel, but failed in a lot of lines. (msgbox, iniRead, loop read, iniwrite,inputbox,...) This is of course n

www.autohotkey.com

 

 

AHK-v2-script-converter-master.zip
3.28MB

 

 

 

반응형
반응형

 

 

원문 주소 

https://www.autohotkey.com/boards/viewtopic.php?f=6&t=3702

 

Get the URL of the current (active) browser tab - AutoHotkey Community

@ Quote 19 Jan 2016, 18:31 Need some help here as I am not much of a coder. I have downloaded GetActiveBrowserURL.ahk, brought it into my script with #Include, but can't figure out how to get it to work the way I want to. I basically want it to work the sa

www.autohotkey.com

 

 

 

 

스크립트 특징은,

비활성 상태의 창을 인식하는게 아닌, 

Active 상태의 활성화된 창을 인식합니다 .

 

 

지원하는 브라우저 목록 입니다.

  • Google Chrome 
  • Mozilla 
  • Firefox Internet Explorer 11 
  • Opera 
  • Microsoft Edge 
  • Opera 12 
  • Maxthon 
  • Iron 
  • Coowon 
  • Slimjet 
  • Vivaldi 

 

; AutoHotkey Version: AutoHotkey 1.1
; Language:           English
; Platform:           Win7 SP1 / Win8.1 / Win10
; Author:             Antonio Bueno <user atnbueno of Google's popular e-mail service>
; Short description:  Gets the URL of the current (active) browser tab for most modern browsers
; Last Mod:           2016-05-19

Menu, Tray, Icon, % A_WinDir "\system32\netshell.dll", 86 ; Shows a world icon in the system tray

ModernBrowsers := "ApplicationFrameWindow,Chrome_WidgetWin_0,Chrome_WidgetWin_1,Maxthon3Cls_MainFrm,MozillaWindowClass,Slimjet_WidgetWin_1"
LegacyBrowsers := "IEFrame,OperaWindowClass"

f1::
	nTime := A_TickCount
	sURL := GetActiveBrowserURL()
	WinGetClass, sClass, A
	If (sURL != "")
		MsgBox, % "The URL is """ sURL """`nEllapsed time: " (A_TickCount - nTime) " ms (" sClass ")"
	Else If sClass In % ModernBrowsers "," LegacyBrowsers
		MsgBox, % "The URL couldn't be determined (" sClass ")"
	Else
		MsgBox, % "Not a browser or browser not supported (" sClass ")"
Return

GetActiveBrowserURL() {
	global ModernBrowsers, LegacyBrowsers
	WinGetClass, sClass, A
	If sClass In % ModernBrowsers
		Return GetBrowserURL_ACC(sClass)
	Else If sClass In % LegacyBrowsers
		Return GetBrowserURL_DDE(sClass) ; empty string if DDE not supported (or not a browser)
	Else
		Return ""
}

; "GetBrowserURL_DDE" adapted from DDE code by Sean, (AHK_L version by maraskan_user)
; Found at http://autohotkey.com/board/topic/17633-/?p=434518

GetBrowserURL_DDE(sClass) {
	WinGet, sServer, ProcessName, % "ahk_class " sClass
	StringTrimRight, sServer, sServer, 4
	iCodePage := A_IsUnicode ? 0x04B0 : 0x03EC ; 0x04B0 = CP_WINUNICODE, 0x03EC = CP_WINANSI
	DllCall("DdeInitialize", "UPtrP", idInst, "Uint", 0, "Uint", 0, "Uint", 0)
	hServer := DllCall("DdeCreateStringHandle", "UPtr", idInst, "Str", sServer, "int", iCodePage)
	hTopic := DllCall("DdeCreateStringHandle", "UPtr", idInst, "Str", "WWW_GetWindowInfo", "int", iCodePage)
	hItem := DllCall("DdeCreateStringHandle", "UPtr", idInst, "Str", "0xFFFFFFFF", "int", iCodePage)
	hConv := DllCall("DdeConnect", "UPtr", idInst, "UPtr", hServer, "UPtr", hTopic, "Uint", 0)
	hData := DllCall("DdeClientTransaction", "Uint", 0, "Uint", 0, "UPtr", hConv, "UPtr", hItem, "UInt", 1, "Uint", 0x20B0, "Uint", 10000, "UPtrP", nResult) ; 0x20B0 = XTYP_REQUEST, 10000 = 10s timeout
	sData := DllCall("DdeAccessData", "Uint", hData, "Uint", 0, "Str")
	DllCall("DdeFreeStringHandle", "UPtr", idInst, "UPtr", hServer)
	DllCall("DdeFreeStringHandle", "UPtr", idInst, "UPtr", hTopic)
	DllCall("DdeFreeStringHandle", "UPtr", idInst, "UPtr", hItem)
	DllCall("DdeUnaccessData", "UPtr", hData)
	DllCall("DdeFreeDataHandle", "UPtr", hData)
	DllCall("DdeDisconnect", "UPtr", hConv)
	DllCall("DdeUninitialize", "UPtr", idInst)
	csvWindowInfo := StrGet(&sData, "CP0")
	StringSplit, sWindowInfo, csvWindowInfo, `" ;"; comment to avoid a syntax highlighting issue in autohotkey.com/boards
	Return sWindowInfo2
}

GetBrowserURL_ACC(sClass) {
	global nWindow, accAddressBar
	If (nWindow != WinExist("ahk_class " sClass)) ; reuses accAddressBar if it's the same window
	{
		nWindow := WinExist("ahk_class " sClass)
		accAddressBar := GetAddressBar(Acc_ObjectFromWindow(nWindow))
	}
	Try sURL := accAddressBar.accValue(0)
	If (sURL == "") {
		WinGet, nWindows, List, % "ahk_class " sClass ; In case of a nested browser window as in the old CoolNovo (TO DO: check if still needed)
		If (nWindows > 1) {
			accAddressBar := GetAddressBar(Acc_ObjectFromWindow(nWindows2))
			Try sURL := accAddressBar.accValue(0)
		}
	}
	If ((sURL != "") and (SubStr(sURL, 1, 4) != "http")) ; Modern browsers omit "http://"
		sURL := "http://" sURL
	If (sURL == "")
		nWindow := -1 ; Don't remember the window if there is no URL
	Return sURL
}

; "GetAddressBar" based in code by uname
; Found at http://autohotkey.com/board/topic/103178-/?p=637687

GetAddressBar(accObj) {
	Try If ((accObj.accRole(0) == 42) and IsURL(accObj.accValue(0)))
		Return accObj
	Try If ((accObj.accRole(0) == 42) and IsURL("http://" accObj.accValue(0))) ; Modern browsers omit "http://"
		Return accObj
	For nChild, accChild in Acc_Children(accObj)
		If IsObject(accAddressBar := GetAddressBar(accChild))
			Return accAddressBar
}

IsURL(sURL) {
	Return RegExMatch(sURL, "^(?<Protocol>https?|ftp)://(?<Domain>(?:[\w-]+\.)+\w\w+)(?::(?<Port>\d+))?/?(?<Path>(?:[^:/?# ]*/?)+)(?:\?(?<Query>[^#]+)?)?(?:\#(?<Hash>.+)?)?$")
}

; The code below is part of the Acc.ahk Standard Library by Sean (updated by jethrow)
; Found at http://autohotkey.com/board/topic/77303-/?p=491516

Acc_Init()
{
	static h
	If Not h
		h:=DllCall("LoadLibrary","Str","oleacc","Ptr")
}
Acc_ObjectFromWindow(hWnd, idObject = 0)
{
	Acc_Init()
	If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
	Return ComObjEnwrap(9,pacc,1)
}
Acc_Query(Acc) {
	Try Return ComObj(9, ComObjQuery(Acc,"{618736e0-3c3d-11cf-810c-00aa00389b71}"), 1)
}
Acc_Children(Acc) {
	If ComObjType(Acc,"Name") != "IAccessible"
		ErrorLevel := "Invalid IAccessible Object"
	Else {
		Acc_Init(), cChildren:=Acc.accChildCount, Children:=[]
		If DllCall("oleacc\AccessibleChildren", "Ptr",ComObjValue(Acc), "Int",0, "Int",cChildren, "Ptr",VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&varChildren, "Int*",cChildren)=0 {
			Loop %cChildren%
				i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i), Children.Insert(NumGet(varChildren,i-8)=9?Acc_Query(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child):
			Return Children.MaxIndex()?Children:
		} Else
			ErrorLevel := "AccessibleChildren DllCall Failed"
	}
}

인터넷 URL얻기.ahk
0.01MB

 

 

 

 

 

반응형
반응형

 

 

 

오토핫키 커뮤니티를 참고하다가 재미있는 소스가 있어서

글을 써보네요!

 

 

https://peuming.tistory.com/65

 

오토핫키(Autohotkey) v1 현재 인터넷,WIFI이 연결되어 있는지 확인

ConnectedToInternet() 함수 입니다.오토핫키 커뮤니티에서 가져왔습니다 . If not ConnectedToInternet(){ msgbox,64,안내,인터넷상태가 원활하지 않습니다. return}ConnectedToInternet(flag=0x40){Return DllCall("Wininet.dll\Inte

peuming.tistory.com

 

위 주소는, 인터넷 혹은 WIFI 가 연결되어 있는지

여부를 확인하는 소스코드입니다

 

 

 


 

 

https://www.autohotkey.com/boards/viewtopic.php?f=6&t=113844

 

Alert on internet connect or disconnect - AutoHotkey Community

Post your working scripts, libraries and tools for AHK v1.1 and older malcev Posts: 1769 Joined: 12 Aug 2014, 12:37 @ Quote 12 Feb 2023, 23:01 https://learn.microsoft.com/en-us/previous-versions/windows/desktop/mpc/network-awareness-on-windows-vista-and-wi

www.autohotkey.com

 

원문 주소입니다

 

https://learn.microsoft.com/en-us/previous-versions/windows/desktop/mpc/network-awareness-on-windows-vista-and-windows-7

 

Network Awareness in Windows Vista and Windows 7

How to create network-aware applications that run on Windows \ 160;Vista and Windows \ 160;7.Note  To download the complete code samples discussed in this topic, see Microsoft Windows Network List Manager (NLM) Samples in Code Gallery. .

learn.microsoft.com

 

 

하단에 적혀있는 스크립트는,

INetWorkListManagerEvents를 포착하여 인터넷 연결해제 / 연결시 이벤트를 발생시키는 구조입니다.

 

 

#Persistent
OnExit, ExitSub
NetworkListManager := ComObjCreate(CLSID_NetworkListManager := "{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")
if (NetworkListManager.GetConnectivity & 0x40) or (NetworkListManager.GetConnectivity & 0x400)   ; NLM_CONNECTIVITY_IPV4_INTERNET or NLM_CONNECTIVITY_IPV6_INTERNET
{
   InternetExist := 1
   msgbox internet ok
}
else
{
   InternetExist := 0
   msgbox no internet
}
Events := [3 ;QueryInterface
          ,1 ;AddRef
          ,1 ;Release
          ,2] ;ConnectivityChanged
VarSetCapacity(CallbackTable, A_PtrSize*Events.MaxIndex(), 0)
For Index, ParameterCount In Events
   NumPut(RegisterCallback("EventHandler", "Fast", ParameterCount, A_Index-1), CallbackTable, A_PtrSize*(A_Index-1))
pSink := DllCall("GlobalAlloc", "uint", 0, "ptr", A_PtrSize+4, "ptr")
NumPut(&CallbackTable, pSink+0, 0)
NumPut(InternetExist, pSink+0, A_PtrSize, "uint")
ConnectionPointContainer := ComObjQuery(NetworkListManager, IID_IConnectionPointContainer := "{B196B284-BAB4-101A-B69C-00AA00341D07}")
VarSetCapacity(CLSID, 16, 0)
DllCall("ole32\CLSIDFromString", "wstr", IID_INetworkListManagerEvents := "{DCB00001-570F-4A9B-8D69-199FDBA5723B}", "ptr", &CLSID)
DllCall(NumGet(NumGet(ConnectionPointContainer + 0) + A_PtrSize*4), "ptr", ConnectionPointContainer, "ptr", &CLSID, "ptr*", ConnectionPoint)   ; IConnectionPointContainer::FindConnectionPoint
ObjRelease(ConnectionPointContainer)
DllCall(NumGet(NumGet(ConnectionPoint + 0) + A_PtrSize*5), "ptr", ConnectionPoint, "ptr", psink, "uint*", nCookie)   ; IConnectionPoint::Advise
return



EventHandler(this, guid = "", ppvObject = "")
{
   static IID_IUnknown, p1, p2, refCount := 1, InternetExist
   if !IID_IUnknown
   {
      VarSetCapacity(p1, 16, 0)
      DllCall("ole32\CLSIDFromString", "wstr", IID_IUnknown := "{00000000-0000-0000-C000-000000000046}", "ptr", &p1)
      VarSetCapacity(p2, 16, 0)
      DllCall("ole32\CLSIDFromString", "wstr", IID_INetworkListManagerEvents := "{DCB00001-570F-4A9B-8D69-199FDBA5723B}", "ptr", &p2)
      InternetExist := NumGet(this+0, A_PtrSize, "uint")
   }
   If (A_EventInfo = 0)
   {
      if DllCall("ole32\IsEqualGUID", "ptr", guid, "ptr", &p1) or DllCall("ole32\IsEqualGUID", "ptr", guid, "ptr", &p2)
      {
         NumPut(this, ppvObject+0)
         refCount++
         return 0
      }
      else
      {
         NumPut(0, ppvObject+0)
         return 0x80004002
      }
   }
   else if (A_EventInfo = 1)
   {
      refCount++
      return refCount
   }
   else if (A_EventInfo = 2)
   {
      if (refCount > 0)
      {
         refCount--
         if (refCount = 0)
            DllCall("GlobalFree", "ptr", this, "ptr")
      }
      return refCount
   }
   else if (A_EventInfo = 3)   ; ConnectivityChanged
   {
      if (guid & 0x40) or (guid & 0x400)   ; NLM_CONNECTIVITY_IPV4_INTERNET or NLM_CONNECTIVITY_IPV6_INTERNET
      {
         if !InternetExist
         {
            InternetExist := 1
            msgbox internet appears
         }
      }
      else
      {
         if InternetExist
         {
            InternetExist := 0
            msgbox internet disappears
         }
      }
      return 0
   }
}

ExitSub:
DllCall(NumGet(NumGet(ConnectionPoint + 0) + A_PtrSize*6), "ptr", ConnectionPoint, "uint", nCookie)   ; IConnectionPoint::Unadvise
ObjRelease(ConnectionPoint)
ObjRelease(pSink)
ExitApp

 

 

 

반응형
반응형

 

 

 

크롬에서 파일을 다운로드 하는데, 이상한 곳으로 다운로드 되어서 고민이신가요 ?

하단의 방법으로 설정만 하시면 언제든지 설정한 위치로 다운로드가 됩니다

 

 

 

 

 

 

크롬을 키시고 오른쪽 상단 점 3개를 클릭하시고,

설정을 눌러주세요

 

 

 

왼쪽 메뉴탭에

 

다운로드를 클릭!

 

다운로드 -> 위치 -> 변경 클릭!

 

 

 

폴더를 지정해주시면 끝! 입니다

 

 

반응형

+ Recent posts