Results 1 to 15 of 15
Thread: !
Hybrid View
-
23rd April 2017 10:46 #1Registered User
Join Date: Jun:2004
Posts: 2,134
!
, , , , . , , ... , . , , 10 , . , , . /

/ ?
-
23rd April 2017 11:08 #2
- Autohotkey - , , , , exe.
AHK, GUI , . , , ..
, - AHK. , .
, , , -, IRC- . (.. , ), .
, , . AHK "", , , ,
.
, - 10 . Windows .Last edited by tedych; 23rd April 2017 at 11:10.
-
23rd April 2017 11:25 #3Registered User
Join Date: Jun:2004
Posts: 2,134

, , , , ( )
-
23rd April 2017 11:55 #4
, , , . - , . , . ,
. - .
, onExit, exit ( ), "" . , - onExit handler-a.
, - handling, , , , , / / . , , . / , (onExit handler-a) , .
restore , -, WinMinimize, WinRestore . , . ! Alt, + Shift, ^ Ctrl, # Win .
- .
(username), . , , .
Code:; AutoHotkey Version: 1.x ; Language: English ; Author: Tedych ; ; Script Function: ; Shows/hides the skype contactlist window of two skype accounts (second account is optional). ; Unlike the skype built-in global hotkey function, this script hides the window ; and removes the taskbar button. ; If the window is open but does not have focus, it is focused. ; There is a side effect: Skype program fails to know whether it's hidden or not (it thinks it is never hidden) ; so it cannot show itself automatically, e.g. after you receive a call, or select Open Skype from the tray. ; For keyboard users this shouldn't be an issue. ; ; This script has been extended to support other windows as well, not only skype, ; so they can be shown/hidden with a global hotkey. The windows could lack tray icons ; but it is advisable that they have a tray icon so the user is not confused. ; Just copy/paste one of the bottom sections and change accordingly inside, ; and copy/paste one of the sections in the OnExit handler at the very bottom. ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ;------ set your skype accounts here skype_account_name:= "my_skype_username" clpvtitle:= "Free Clipboard Viewer 2.0" SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SetTitleMatchMode, 2 ;to match partial titles DetectHiddenWindows, Off OnExit, ExitSub PrevActiveId() ; notskype=0) { WinGet, idlist, list,,, Program Manager Loop, %idlist% { this_id := idlist%A_Index% WinGetClass, this_class, ahk_id %this_id% ;if ((notskype = 0 and this_class != "Shell_TrayWnd" and this_class != "Button" and this_class != "tSkMainForm") or (notskype=1 and A_Index > 3)) if (A_Index > 3) ; skip bogus 3 window hwnds (Shell_TratWnd, Button and the current Window's Form class) { WinGet, thiswinid, MinMax, ahk_id %this_id% if (thiswinid = -1) ; minimized, it was last active, but most likely the desktop is active { return 0 } else { return %this_id% } } } return 0 } GroupAdd, skypegrp1, - %skype_account_name% GroupAdd, fcbvgrp, %clpvtitle% ;--------------------------------------------------- SKYPE ACCOUNT SHOW/HIDE ;------ WINDOW HAS FOCUS #IfWinActive, ahk_group skypegrp1 ^#q:: ;PostMessage, 0x112, 0xF060,,, - %skype_account_name%, ; 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE prev_active_id := PrevActiveId() if (prev_active_id != 0) { WinActivate, ahk_id %prev_active_id% } WinHide, - %skype_account_name% return #IfWinActive ;------ WINDOW DOES NOT HAVE FOCUS OR DOES NOT EXIST ^#q:: DetectHiddenWindows, On WinGet, skypewinvar, MinMax, - %skype_account_name% if skypewinvar = 0 ; hidden { ;PostMessage, 0x112, 0xF120,,, - %skype_account_name%, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, - %skype_account_name% ;WinWait, - %skype_account_name%,,1 WinActivate, - %skype_account_name% } else { IfWinExist, - %skype_account_name% { if skypewinvar = -1 ; minimized { PostMessage, 0x112, 0xF120,,, - %skype_account_name%, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE } else { WinActivate } } } DetectHiddenWindows, Off return ;------------------------------------------------- END SKYPE ACCOUNT ;------------------------------------------------- KVIrc ;------ WINDOW HAS FOCUS #IfWinActive, KVIrc 4. ^#e:: ;PostMessage, 0x112, 0xF060,,, KVIrc 4., ; 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE prev_active_id := PrevActiveId() if (prev_active_id != 0) { WinActivate, ahk_id %prev_active_id% } WinHide, KVIrc 4. return #IfWinActive ;------ WINDOW DOES NOT HAVE FOCUS OR DOES NOT EXIST ^#e:: DetectHiddenWindows, On WinGet, kvircminmax, MinMax, KVIrc 4. if kvircminmax = 0 ; hidden { ;PostMessage, 0x112, 0xF120,,, KVIrc 4., ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, KVIrc 4. ;WinWait, KVIrc 4.,,1 WinActivate, KVIrc 4. } else { IfWinExist, KVIrc 4. { if kvircminmax = -1 ; minimized { PostMessage, 0x112, 0xF120,,, KVIrc 4., ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE } else { WinActivate } } } DetectHiddenWindows, Off return ;------------------------------------------------- END KVIrc ;------------------------------------------------- Free Clipboard Viewer ;------ WINDOW HAS FOCUS #IfWinActive, ahk_group fcbvgrp #!c:: ;PostMessage, 0x112, 0xF060,,, %clpvtitle%, ; 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE prev_active_id := PrevActiveId() if (prev_active_id != 0) { WinActivate, ahk_id %prev_active_id% } WinHide, %clpvtitle% return #IfWinActive ;------ WINDOW DOES NOT HAVE FOCUS OR DOES NOT EXIST #!c:: DetectHiddenWindows, On WinGet, fcbvwinvar, MinMax, %clpvtitle% if fcbvwinvar = 0 ; hidden { ;PostMessage, 0x112, 0xF120,,, %clpvtitle%, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, %clpvtitle% ;WinWait, %clpvtitle%,,1 WinActivate, %clpvtitle% } else { IfWinExist, %clpvtitle% { if fcbvwinvar = -1 ; minimized { PostMessage, 0x112, 0xF120,,, %clpvtitle%, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE } else { WinActivate } } } DetectHiddenWindows, Off return ;------------------------------------------------- END Free Clipboard Viewer ;------------------------------------------------- VIBER ;------ WINDOW HAS FOCUS #IfWinActive, Viber +359888888888 ^#w:: prev_active_id := PrevActiveId() if (prev_active_id != 0) { WinActivate, ahk_id %prev_active_id% } WinHide, Viber +359888888888 return #IfWinActive ;------ WINDOW DOES NOT HAVE FOCUS OR DOES NOT EXIST ^#w:: DetectHiddenWindows, On WinGet, viberminmax, MinMax, Viber +359888888888 if viberminmax = 0 ; hidden { ;PostMessage, 0x112, 0xF120,,, KVIrc 4., ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, Viber +359888888888 ;WinWait, Viber +359888888888,,1 WinActivate, Viber +359888888888 } else { IfWinExist, Viber +359888888888 { if viberminmax = -1 ; minimized { PostMessage, 0x112, 0xF120,,, Viber +359888888888, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE } else { WinActivate } } } DetectHiddenWindows, Off return ;------------------------------------------------- END VIBER return ;--------------------------------------------- onexit subroutine ExitSub: SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SetTitleMatchMode 2 ;to match partial titles DetectHiddenWindows, On WinGet, skypewinvar, MinMax, - %skype_account_name% if skypewinvar = 0 ; hidden, unhide it { ;PostMessage, 0x112, 0xF120,,, - %skype_account_name%, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, - %skype_account_name% ;WinWait, - %skype_account_name%,,1 ;WinActivate, - %skype_account_name% } ;------------------- KVIrc WinGet, kvircminmax, MinMax, KVIrc 4. if kvircminmax = 0 ; hidden, unhide it { ;PostMessage, 0x112, 0xF120,,, KVIrc 4., ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, KVIrc 4. ;WinWait, KVIrc 4.,,1 ;WinActivate, KVIrc 4. } ;------------------- Clipboard Viewer WinGet, fcbvminmax, MinMax, %clpvtitle% if fcbvminmax = 0 ; hidden, unhide it { ;PostMessage, 0x112, 0xF120,,, %clpvtitle%, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, %clpvtitle% ;WinWait, %clpvtitle%,,1 ;WinActivate, %clpvtitle% } ;------------------- Viber WinGet, viberminmax, MinMax, Viber +359888888888 if viberminmax = 0 ; hidden, unhide it { ;PostMessage, 0x112, 0xF120,,, Viber +359888888888, ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE WinShow, Viber +359888888888 ;WinWait, Viber +359888888888,,1 ;WinActivate, Viber +359888888888 } ExitAppLast edited by tedych; 23rd April 2017 at 11:59.
-
23rd April 2017 15:35 #5Registered User
Join Date: Jun:2004
Posts: 2,134
,

:
- - - - - -
, , , . , , :
Magic :Code:#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. Magic(SearchMode, Title, ToHide) { SetTitleMatchMode, %SearchMode% if %ToHide% { DetectHiddenWindows, On } else { DetectHiddenWindows, Off } IfWinExist, %Title% { IfWinActive { if %ToHide% { WinMinimize WinHide } else { WinMinimize } } else { if %ToHide% { WinShow } WinActivate } } } ^+a:: Magic(1, "Skype", false) return ^+v:: Magic(1, "Viber +359", false) return ^#w:: Magic(1, "Untitled - Notepad", false) return
- : 1 - ; 2 - ; 3
-
- true/false
-
23rd April 2017 15:53 #6
, , , 2 - .
. , , -. , . WinHide, PostMessage .
. 2-3 - , .
- "Skype", , , "skype". .
. window handle , - .




Reply With Quote
7th May 2023, 16:02 in PC