W기술과 생활

닫기 검색결과 전체 보기

    [AHK] 바이두 클라우드 프록시 전환

    Tip/AHKmacro 2014. 2. 2. 23:53

    안녕하세요.

    이번에도 역시 오토핫키(AutoHotKey)를 이용하여 간단한 유틸을 만들어봤습니다.

    다름이 아니고 http://w3tech.tistory.com/201 이 포스트에서 소개한 바와 같이 프록시 서버 설정을 하면 다운이나 업로드 진행이 안 되던 파일들이 진행이 되는 팁을 소개하였습니다.

    하지만 제가 직접 프록시 서버를 변경하면서 사용하다보니 프록시 서버 변경하는게 상당히 귀찮은 작업이더군요.

    클라우드 실행 -> 설정 -> 넷웤 -> 프록시 설정 종료 후 재시작

    이 작업이 상당히 번거롭게 느껴졌습니다.


    그래서 오토핫키로 만들어봤습니다.

    기본 뼈대는 기존의 패쳐에서 가지고 왔습니다.

    동작을 간단하게 설명하자면

    1. 해당하는 클라우드 그림 밑의 버튼을 클릭하면

    2. 레지스트리를 읽어서 클라우드 설치 경로를 읽습니다.

    3. 클라우드 클라이언트를 종료시킵니다.

    4-1. 유틸을 처음 시작했고 프록시 서버 설정이 기본값이면 프록시 서버 설정을 입력 받습니다.

    4-2. 프록시 서버 설정으로 사용 중이라면 현재 프록시 서버 설정값을 ProxySetting_temp.ini 파일로 백업합니다.

    5. 프록시 설정 초기값(0)과 저장된 프록시 서버 설정값을 버튼 누를때마다 서로 맞교환합니다.

    6. 변경 후 설정된 현재값을 표시합니다.


    간단합니다.

    중간에 refreshTray 라벨은 클라이언트 강제 종료시 트레이 아이콘이 남은것을 없애주는 동작입니다.

    기능 건의, 버그 댓글 주시면 고쳐나가도록 하겠습니다.

    다운로드

    ↓↓↓↓↓


    BaiduSwapProxy20140413.zip











    추가 변경된 소스

    + 클라이언트 아이콘 클릭시 바로 실행

    + 변경전 묻기

    + 툴팁 설명 표시


    == 코드 삭제 ==

    추가된 코드

    + 가운데에 현재 프록시 설정을 출력

    + 프록시 설정 변경 확인 후 클라이언트 종료하게 변경

    + GUI 세로 크기 축소

    + 내부 코드 변경 및 함수 처리

    -- 2014.04.13 변경점 --

    + 포터블에서도 가능하게 변경

    + 경로 읽을때 실행파일이 아닌 프록시 설정 파일 위치 기준으로 변경


    #NoTrayIcon 
    #NoTrayIcon 
    #NoEnv
    #SingleInstance force
    SetBatchLines,-1
    CoordMode,ToolTip,Screen
    CoordMode,Mouse,Screen
    CoordMode,Pixel,Screen
    FileCreateDir, %A_Temp%\BaiduProxy
    FileInstall, img\title_proxy.png, %A_Temp%\BaiduProxy\title_proxy.png, 1
    FileInstall, img\baiduyunguanjia.png, %A_Temp%\BaiduProxy\baiduyunguanjia.png, 1
    FileInstall, img\baiduyun.png, %A_Temp%\BaiduProxy\baiduyun.png, 1
    FileInstall, img\trayicon_BaiduYun.bmp, %A_Temp%\BaiduProxy\trayicon_BaiduYun.bmp, 1
    FileInstall, img\trayicon_BaiduYunGuanjia.bmp, %A_Temp%\BaiduProxy\trayicon_BaiduYunGuanjia.bmp, 1
    FileInstall, img\trayicon_BaiduYun_off.bmp, %A_Temp%\BaiduProxy\trayicon_BaiduYun_off.bmp, 1
    FileInstall, img\trayicon_BaiduYunGuanjia_off.bmp, %A_Temp%\BaiduProxy\trayicon_BaiduYunGuanjia_off.bmp, 1
    Gui, Color, FFFFFF
    Gui, Add, Picture, x17 y68 w88 h88 vPop1 gRunBaiduyunguanjia, %A_Temp%\BaiduProxy\baiduyunguanjia.png
    Gui, Add, Picture, x227 y68 w88 h88 vPop2 gRunBaiduyun, %A_Temp%\BaiduProxy\baiduyun.png
    Gui, Add, Picture, x3 y10 w320 h50 , %A_Temp%\BaiduProxy\title_proxy.png
    Gui, Add, Button, x16 y160 w90 h50 vButton1 , 웹하드방식
    Gui, Add, Button, x226 y160 w90 h50 vButton2 , 동기화방식
    Gui, Add, Text,x110 y80 w110 h120 vBYG +Center
    Gui, Font, s8
    Gui, Add, Link, x55 y215 w245 h20 +Right, 제작 : <a href="http://w3tech.tistory.com/196">http://w3tech.tistory.com/203</a> 
    Gui, Show, h235 w326, 바이두 클라우드 프록시 설정
    OnMessage( 0x200, "WM_MOUSEMOVE" )
    Pop1_TT:="Baiduyunguanjia.exe 실행"
    Pop2_TT:="Baiduyun.exe 실행"
    Button1_TT:="실행중인 클라이언트 종료 후 프록시 설정이 진행됩니다."
    Button2_TT:="실행중인 클라이언트 종료 후 프록시 설정이 진행됩니다."
    Return
    
    global client,path
    
    readINI(path,ByRef proxy,ByRef addr,ByRef port){
    	IniRead, proxy, %path%\users\ProxySetting.ini, proxy_setting, proxy_type
    	IniRead, addr, %path%\users\ProxySetting.ini, proxy_setting, proxy_addr
    	IniRead, port, %path%\users\ProxySetting.ini, proxy_setting, proxy_port
    	if ( proxy = 0 ){
    		proxy:="프록시없음"
    	}
    	if ( proxy = 1 ){
    		proxy:="HTTP프록시"
    	}
    	if ( proxy = 2 ){
    		proxy:="SOCK프록시"
    	}
    	if ( proxy = 3 ){
    		proxy:="IE프록시"
    	}	
    	GuiControl,,BYG,%client%`n`n%proxy%`n`nIP : %addr%`n`nPORT : %port%
    	return
    }
    
    printP(client){
    	if ( path = "" ){
    		if A_OSVersion in WIN_NT4,WIN_95,WIN_98,WIN_ME,WIN_XP,WIN_2000
    		{
    			RegRead, path, HKLM,Software\Baidu\%client%,installDir
    		}else{
    			RegRead, path, HKCU,Software\Baidu\%client%,installDir
    		}
    	}
    	if path
    	{
    		readINI(path,proxy,addr,port)	
    	}else{
    		proxy:=
    		addr:=
    		port:=
    		path:=
    		GuiControl,,BYG,
    	}
    	return
    }
    
    WM_MOUSEMOVE( wparam, lparam, msg, hwnd )
    {
    	static CurrControl, PrevControl, _TT
    	CurrControl := A_GuiControl
    	If (CurrControl <> PrevControl){
    		SetTimer, DisplayToolTip, -1000
    		PrevControl := CurrControl
    	}
    	
    	if ( CurrControl = "Pop1" or CurrControl = "Button1" ){
    		client=BaiduYunGuanjia
    		printP(client)
    	}else if ( CurrControl = "Pop2" or CurrControl = "Button2" ){
    		client=BaiduYun
    		printP(client)
    	}
    	
    	DisplayToolTip:
    	try{
    		ToolTip % %CurrControl%_TT
    	}catch{
    		ToolTip
    	}	
    	SetTimer, RemoveToolTip, -1000
    	return
    	
    	RemoveToolTip:
    	ToolTip
    	return
    }
    
    readReg:
    if ( path = "" ){ 
    	if A_OSVersion in WIN_NT4,WIN_95,WIN_98,WIN_ME,WIN_XP,WIN_2000
    	{
    		RegRead, path, HKLM,Software\Baidu\%client%,installDir
    	}else{
    		RegRead, path, HKCU,Software\Baidu\%client%,installDir
    	}
    	if ( ErrorLevel = 1 ){
    		MsgBox, 설치된 경로를 못 찾았습니다!`n직접 폴더를 선택하세요. (ProxySetting.ini)
    		FileSelectFolder, path, ,0
    		if ErrorLevel = 1
    		{
    			MsgBox, 취소되었습니다.
    			Exit
    		}
    		IfNotExist, %path%\ProxySetting.ini
    		{
    			MsgBox,ProxySetting.ini 설정파일이 없는 폴더입니다.
    			Exit
    		}else{
    			StringLen,pathLen,path
    			StringLeft, path, path, % pathLen-6
    		}
    	}
    }
    return
    
    result:
    Process, Close, %client%.exe
    Sleep,500
    gosub, refreshTray
    readINI(path,proxy,addr,port)
    MsgBox, 변경 완료!`n프록시 종류 : %proxy%`n주소 : %addr%`n포트 : %port%`n`n최신 버전은`n http://w3tech.tistory.com `n에 방문해주세요!
    return
    
    refreshTray:
    MouseGetPos,PosX,PosY
    WinGet,Tray_ID,ID,ahk_class Shell_TrayWnd
    WinGetPos, X1, Y1, cWidth, cHeight, ahk_id %Tray_ID%
    X2 := X1+cWidth
    Y2 := Y1+cHeight
    ImageSearch, reX, reY, X1, Y1, X2, Y2, *10 %A_Temp%\BaiduProxy\trayicon_%client%.bmp
    if ( ErrorLevel = 0 )
    {
    	MouseMove, reX+5, reY+5,0
    }else{
    	ImageSearch, reX, reY, X1, Y1, X2, Y2, *10 %A_Temp%\BaiduProxy\trayicon_%client%_off.bmp
    	if ( ErrorLevel = 0 )
    	{
    		MouseMove, reX+5, reY+5,0
    	}
    }
    MouseMove,%PosX%,%PosY%,0
    Return
    
    SwapProxySetting:
    gosub, readReg
    if path
    {	
    	IfNotExist,%path%\users\ProxySetting_temp.ini
    	{	
    		IfExist, %path%\users\ProxySetting.ini
    		{		
    			IniRead, Is_Proxy,%path%\users\ProxySetting.ini,proxy_setting,proxy_type		
    			if ( Is_Proxy = 0 ) {
    				InputBox, addr, 프록시 서버 주소, 주소를 입력하세요 (ex 123.123.123.123)
    				if ( addr = "" ){
    					MsgBox, 취소됨
    					Exit
    				}
    				InputBox, port, 프록시 서버 포트, 포트를 입력하세요 (ex 8080)
    				if ( port = "" ){
    					MsgBox, 취소됨
    					Exit
    				}
    				FileCopy, % path . "\users\ProxySetting.ini", % path . "\users\ProxySetting_temp.ini", 1
    				IniWrite, 1, %path%\users\ProxySetting.ini, proxy_setting, proxy_type
    				IniWrite, %addr%, %path%\users\ProxySetting.ini, proxy_setting, proxy_addr
    				IniWrite, %port%, %path%\users\ProxySetting.ini, proxy_setting, proxy_port
    				gosub,result				
    			}else{
    				FileCopy, % path . "\users\ProxySetting.ini", % path . "\users\ProxySetting_temp.ini", 1
    				IniWrite, 0, %path%\users\ProxySetting.ini, proxy_setting, proxy_type
    				IniWrite, %A_Space%, %path%\users\ProxySetting.ini, proxy_setting, proxy_addr
    				IniWrite, %A_Space%, %path%\users\ProxySetting.ini, proxy_setting, proxy_port
    				gosub,result
    			}
    		}else{
    			MsgBox, %path%\users\ProxySetting.ini `n파일을 찾지 못 했습니다.
    		}
    	}else{
    		IniRead, Is_Proxy,%path%\users\ProxySetting.ini,proxy_setting,proxy_type
    		if ( Is_Proxy = 0 ) {
    			IniRead, temp_type, %path%\users\ProxySetting_temp.ini, proxy_setting, proxy_type
    			IniRead, temp_addr, %path%\users\ProxySetting_temp.ini, proxy_setting, proxy_addr
    			IniRead, temp_port, %path%\users\ProxySetting_temp.ini, proxy_setting, proxy_port
    			MsgBox,4,, 프록시 서버를 설정합니까?`n서버 : %temp_addr%`n포트 : %temp_port%
    			IfMsgBox No
    				Exit			
    			IniWrite, %temp_type%, %path%\users\ProxySetting.ini, proxy_setting, proxy_type
    			IniWrite, %temp_addr%, %path%\users\ProxySetting.ini, proxy_setting, proxy_addr
    			IniWrite, %temp_port%, %path%\users\ProxySetting.ini, proxy_setting, proxy_port
    		}else{
    			MsgBox,4,, 프록시 서버 설정을 초기화합니까? (프록시 설정은 백업됨)
    			IfMsgBox No
    				Exit
    			FileCopy, % path . "\users\ProxySetting.ini", % path . "\users\ProxySetting_temp.ini", 1
    			IniWrite, 0, %path%\users\ProxySetting.ini, proxy_setting, proxy_type
    			IniWrite, %A_Space%, %path%\users\ProxySetting.ini, proxy_setting, proxy_addr
    			IniWrite, %A_Space%, %path%\users\ProxySetting.ini, proxy_setting, proxy_port
    		}
    		gosub,result
    	}
    }
    return
    
    
    Button웹하드방식:
    client=BaiduYunGuanjia
    gosub,SwapProxySetting
    return
    
    Button동기화방식:
    client=BaiduYun
    gosub,SwapProxySetting
    return
    
    RunBaiduyunguanjia:
    client=BaiduYunGuanjia
    gosub, readReg
    IfExist,% path "\" client ".exe"
    	Run, % path "\" client ".exe"
    else
    	MsgBox, % path "\" client ".exe 실행파일이 없습니다." 
    return
    
    RunBaiduyun:
    client=BaiduYun
    gosub, readReg
    IfExist,% path "\" client ".exe"
    	Run, % path "\" client ".exe"
    else
    	MsgBox, % path "\" client ".exe 실행파일이 없습니다." 
    return
    
    Exit:
    GuiClose:
    FileRemoveDir, %A_Temp%\BaiduProxy, 1
    ExitApp
    return
    


    저작자표시 비영리 변경금지 (새창열림)
    'Tip/AHKmacro' 관련 글 more
    • thumbnail
      [AHK] 조아라 자동 로그인 + 마나 모으기 매크로 2014.04.01
    • thumbnail
      [AHK] 오토핫키 컴파일된 exe 파일... 괜찮을까? 2014.02.04
    • thumbnail
      [AHK] 바이두 클라우드 모든 버전에 대응하는 패쳐 만들기 2013.12.17
    • thumbnail
      바이두 클라우드 한국어 패치 프로그램 AHK로 만들기 2013.09.26
    Posted by 확인소장

바로가기

  • thumbnail 이미지 외부링크용 구글 드라이브
  • thumbnail 대기오염 실시간 확인

블로그 내용 검색

블로그 이미지

인터넷 기술, 오토핫키, 바이두 클라우드 한글화

by 확인소장

공지사항

    최근...

  • 포스트
  • 댓글
  • 더 보기

태그

  • BaiduYunApp
  • 한글화
  • 바이두 한글
  • 한국어
  • 바이두
  • Android
  • GUI
  • 한국어 패치
  • baiduyun app
  • 百度音乐
  • Baidu Cloud
  • 百度
  • baidu
  • 바이두 클라우드
  • BaiduYun
  • 百度云管家
  • ADD
  • BaiduCloud
  • baidunetdisk
  • autohotkey
  • BaiduYunGuanjia
  • AHK
  • 百度云
  • 클라우드 한글화
  • 바이두 앱
  • apk 한글화
  • Baidu cloud app
  • 바이두 뮤직
  • 바이두 한글화
  • 한글패치

글 보관함

«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

링크

카테고리

  • 모든 글타래 (266)
    • Patch (158)
      • BaiduCloud (147)
      • BaiduMusic (7)
      • XiamiMusic (2)
    • Tip (86)
      • AHKmacro (20)
      • BaiduCloud (36)
      • PC활용 (29)
    • Monologue (13)
    • ETC (3)
    • Temp (6)

카운터

Total
Today
Yesterday
  • 홈
  • 방명록
  • 링크추가
확인소장's Blog is powered by daumkakao
Skin info material T Mark 5+ by 뭐하라
favicon

W기술과 생활

인터넷 기술, 오토핫키, 바이두 클라우드 한글화

  • 홈
  • 방명록
  • 링크추가

관리자 메뉴

  • 관리자 모드
  • 글쓰기
  • 모든 글타래 (266)
    • Patch (158)
      • BaiduCloud (147)
      • BaiduMusic (7)
      • XiamiMusic (2)
    • Tip (86)
      • AHKmacro (20)
      • BaiduCloud (36)
      • PC활용 (29)
    • Monologue (13)
    • ETC (3)
    • Temp (6)

카테고리

PC화면 보기
티스토리
Daum

티스토리툴바