mirror of
https://github.com/jgpaiva/GridMove.git
synced 2025-01-18 03:55:50 +00:00
Adding non-essential files with experimental purpose
This commit is contained in:
parent
46effeb352
commit
1a5cf02c33
207
GridCreator.ahk
Normal file
207
GridCreator.ahk
Normal file
@ -0,0 +1,207 @@
|
||||
;GridCreator
|
||||
;By jgpaiva
|
||||
;date: September 2006
|
||||
;function: Visually Create Grids for GridMove
|
||||
|
||||
#singleInstance,force
|
||||
#notrayicon
|
||||
|
||||
ScriptName = GridCreator
|
||||
ScriptVersion = 1.0
|
||||
|
||||
Trigger:=true
|
||||
Current := 1
|
||||
LastAdded := 1
|
||||
|
||||
FileSelectFile,FileName,s 16,%a_workingdir%\new_grid.grid,Select file to write,Grid Files(*.grid)
|
||||
if errorlevel <> 0
|
||||
exitapp
|
||||
|
||||
FileAppend,,%filename%
|
||||
Gui,add,Button,Section vLeft gLeft,<
|
||||
Gui,add,text,xp+35 yp+4 vElement,Element 1
|
||||
Gui,add,Button,xp+60 ys vRight gRight, >
|
||||
Gui,add,Button,xs Section gInstructions,Instructions
|
||||
Gui,add,Button,ys gSave,Save
|
||||
Gui,add,Text,vText_top xs,Top: 10244 , 100`%
|
||||
Gui,add,Text,vText_left xs,Left: 10244 , 100`%
|
||||
Gui,add,Text,vText_Right xs,Right: 10244 , 100`%
|
||||
Gui,add,Text,vText_Bottom xs,Bottom: 10244 , 100`%
|
||||
|
||||
Gui,show,% "x" A_ScreenWidth / 2 + 30,Creator
|
||||
|
||||
Gui,2:+owner1
|
||||
|
||||
Gui,2:Default
|
||||
Gui,+Resize +toolwindow
|
||||
Gui, Add, Button,Default vbutton gAddPercentage w90 h20,&Add Trigger %Current%
|
||||
Gui,show,% "x" A_ScreenWidth / 2 - 90 " autosize toolwindow", %ScriptName% v%scriptVersion%
|
||||
|
||||
Gui,1:Default
|
||||
GuiControl,Disable,Left
|
||||
GuiControl,Disable,Right
|
||||
|
||||
Changed := false
|
||||
GuiControl,Disable,Save
|
||||
|
||||
loop
|
||||
{
|
||||
wingetpos,WinX,WinY,WinWidth,WinHeight, %ScriptName% v%scriptVersion%
|
||||
GetMonitorNumber()
|
||||
MonitorWidth := MonitorRight - MonitorLeft
|
||||
MonitorHeight:= MonitorBottom - MonitorTop
|
||||
GuiControl,,Text_Top,% "Top: "WinY ", " Round((WinY - MonitorTop) /MonitorHeight * 100) "%"
|
||||
GuiControl,,Text_Left,% "Left: "WinX ", " Round((WinX - MonitorLeft) /MonitorWidth * 100) "%"
|
||||
GuiControl,,Text_Right,% "Right: " WinX + WinWidth ", " Round((WinX + WinWidth - MonitorLeft) /MonitorWidth * 100) "%"
|
||||
GuiControl,,Text_Bottom,% "Bottom: " WinY + WinHeight ", " Round((WinY + WinHeight - MonitorTop) /MonitorHeight * 100) "%"
|
||||
sleep,200
|
||||
}
|
||||
return
|
||||
|
||||
2GuiSize:
|
||||
GuiControl,Move,button,% "x" . A_GuiWidth/2 - 45. " Y" . A_GuiHeight /2 - 10
|
||||
return
|
||||
|
||||
2GuiClose:
|
||||
2GuiEscape:
|
||||
GuiClose:
|
||||
GuiEscape:
|
||||
If changed
|
||||
{
|
||||
msgbox,3,save?,would you like to save?
|
||||
ifmsgbox yes
|
||||
{
|
||||
gosub,save
|
||||
exitapp
|
||||
}
|
||||
ifmsgbox no
|
||||
exitapp
|
||||
return
|
||||
}
|
||||
exitapp
|
||||
|
||||
Instructions:
|
||||
return
|
||||
|
||||
Save:
|
||||
IfExist %FileName%
|
||||
FileDelete,%FileName%
|
||||
lastadded --
|
||||
IniWrite,%LastAdded%,%FileName%,Groups,NumberOfGroups
|
||||
Loop,%LastAdded%
|
||||
{
|
||||
TriggerTop :=(%A_Index%TriggerTop )
|
||||
TriggerLeft :=(%A_Index%TriggerLeft )
|
||||
TriggerRight :=(%A_Index%TriggerRight )
|
||||
TriggerBottom :=(%A_Index%TriggerBottom)
|
||||
GridTop :=(%A_Index%GridTop )
|
||||
GridLeft :=(%A_Index%GridLeft )
|
||||
GridRight :=(%A_Index%GridRight )
|
||||
GridBottom :=(%A_Index%GridBottom )
|
||||
IniWrite,%TriggerTop% ,%FileName%,%A_Index%,TriggerTop
|
||||
IniWrite,%TriggerLeft% ,%FileName%,%A_Index%,TriggerLeft
|
||||
IniWrite,%TriggerRight% ,%FileName%,%A_Index%,TriggerRight
|
||||
IniWrite,%TriggerBottom% ,%FileName%,%A_Index%,TriggerBottom
|
||||
IniWrite,%GridTop% ,%FileName%,%A_Index%,GridTop
|
||||
IniWrite,%GridLeft% ,%FileName%,%A_Index%,GridLeft
|
||||
IniWrite,%GridRight% ,%FileName%,%A_Index%,GridRight
|
||||
IniWrite,%GridBottom% ,%FileName%,%A_Index%,GridBottom
|
||||
}
|
||||
Gui,1:Default
|
||||
Changed := false
|
||||
GuiControl,Disable,Save
|
||||
return
|
||||
|
||||
Left:
|
||||
Current -= 1
|
||||
Gui,2:Default
|
||||
GuiControl, Text, Button, &Add Grid %Current%
|
||||
Trigger := True
|
||||
Update()
|
||||
return
|
||||
|
||||
Right:
|
||||
Current += 1
|
||||
Gui,2:Default
|
||||
GuiControl, Text, Button, &Add Grid %Current%
|
||||
Trigger := True
|
||||
Update()
|
||||
return
|
||||
|
||||
AddPercentage:
|
||||
wingetpos,WinX,WinY,WinWidth,WinHeight, %ScriptName% v%scriptVersion%
|
||||
MonitorNumber := GetMonitorNumber()
|
||||
MonitorWidth := MonitorRight - MonitorLeft
|
||||
MonitorHeight:= MonitorBottom - MonitorTop
|
||||
X := (WinX - MonitorLeft)/MonitorWidth
|
||||
Y := (WinY - MonitorTop)/MonitorHeight
|
||||
Right := (WinX + WinWidth - MonitorLeft)/MonitorWidth
|
||||
Bottom:= (WinY + WinHeight - MonitorTop)/MonitorHeight
|
||||
WindowTop = [Monitor%MonitorNumber%Top] + %Y% * [Monitor%MonitorNumber%Height]
|
||||
WindowLeft = [Monitor%MonitorNumber%Left] + %X% * [Monitor%MonitorNumber%Width]
|
||||
WindowRight = [Monitor%MonitorNumber%Left] + %Right% * [Monitor%MonitorNumber%Width]
|
||||
WindowBottom = [Monitor%MonitorNumber%Top] + %Bottom% * [Monitor%MonitorNumber%Height]
|
||||
If trigger
|
||||
{
|
||||
%Current%TriggerTop := WindowTop
|
||||
%Current%TriggerLeft := WindowLeft
|
||||
%Current%TriggerRight := WindowRight
|
||||
%Current%TriggerBottom:= WindowBottom
|
||||
Trigger := false
|
||||
Gui,2:Default
|
||||
GuiControl, Text, Button, &Add Grid %Current%
|
||||
Gui,1:Default
|
||||
Changed := True
|
||||
GuiControl,Enable,Save
|
||||
}
|
||||
else
|
||||
{
|
||||
%Current%GridTop := WindowTop
|
||||
%Current%GridLeft := WindowLeft
|
||||
%Current%GridRight := WindowRight
|
||||
%Current%GridBottom:= WindowBottom
|
||||
Trigger := True
|
||||
Current += 1
|
||||
If Current > %LastAdded%
|
||||
LastAdded += 1
|
||||
Update()
|
||||
Gui,2:Default
|
||||
GuiControl, Text, Button, &Add Trigger %Current%
|
||||
Gui,1:Default
|
||||
Changed := True
|
||||
GuiControl,Enable,Save
|
||||
}
|
||||
return
|
||||
|
||||
GetMonitorNumber(){
|
||||
global Monitor
|
||||
global WinX
|
||||
global WinY
|
||||
SysGet,MonitorCount,MonitorCount
|
||||
Loop,%MonitorCount%
|
||||
{
|
||||
SysGet,MonitorR,Monitor,%A_Index%
|
||||
If (WinX < MonitorRRight AND WinX >= MonitorRLeft AND WinY >= MonitorRTop AND WinY < MonitorRBottom)
|
||||
{
|
||||
Number := a_index
|
||||
break
|
||||
}
|
||||
}
|
||||
Sysget,Monitor,MonitorWorkArea,%Number%
|
||||
return %Number%
|
||||
}
|
||||
|
||||
Update()
|
||||
{
|
||||
global
|
||||
Gui,1:Default
|
||||
if Current > 1
|
||||
GuiControl,enable,Left
|
||||
else
|
||||
GuiControl,Disable,Left
|
||||
If Current < %LastAdded%
|
||||
GuiControl,enable,Right
|
||||
else
|
||||
GuiControl,disable,Right
|
||||
GuiControl,text,Element,Element%Current%
|
||||
}
|
24
GridMoveOptions.ahk
Normal file
24
GridMoveOptions.ahk
Normal file
@ -0,0 +1,24 @@
|
||||
showOptions:
|
||||
|
||||
optionsGui:=5
|
||||
|
||||
gui, %optionsGui%:default
|
||||
|
||||
gui, add, tab2,, Activation|Grid Settings
|
||||
|
||||
gui, add, text,,You can use GridMove in two ways: using the mouse and using the keyboard.`nYou may change the setting for both methods in this tab.
|
||||
|
||||
gui, add, groupbox, r3,Using the mouse
|
||||
Gui, add, checkbox, xp+10 yp+20,By dragging a window by its title
|
||||
Gui, add, checkbox, ,By middle mouse button (anywhere) and dragging window
|
||||
Gui, add, checkbox, ,By dragging a window to the edge of the screen
|
||||
|
||||
gui, add, groupbox, xp-10 yp+30 r3,Using the Keyboard
|
||||
Gui, add, checkbox, xp+10 yp+20,Use shortcut to show the grid and select
|
||||
Gui, add, checkbox, ,By middle mouse button (anywhere) and dragging window
|
||||
Gui, add, checkbox, ,By dragging a window to the edge of the screen
|
||||
|
||||
gui,show
|
||||
|
||||
gui, 1:default
|
||||
return
|
10
InvokingDcuHelperReadme.txt
Normal file
10
InvokingDcuHelperReadme.txt
Normal file
@ -0,0 +1,10 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
1. To register your programs directory with the system updater:
|
||||
dcuhelper.exe -r "program_labelname" "full_path_to_app_directory"
|
||||
|
||||
2. To invoke the updaterwith various commandline options:
|
||||
dcuhelper.exe -[r]i "program_labelname" "full_path_to_app_directory" "missingupdatertitle_or_._for_silent" [commandline options to be passed to updater]
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
110
Strings.txt
Normal file
110
Strings.txt
Normal file
@ -0,0 +1,110 @@
|
||||
tray_help=Aide / À propos...
|
||||
tray_updates=Mettre à jour!
|
||||
tray_ignore=Ignore fenêtre
|
||||
tray_windows=Démarrage avec Windows
|
||||
tray_templates=Modèles
|
||||
tray_options=Options
|
||||
tray_hotkeys=Raccourcis
|
||||
tray_restart=Redémarrer
|
||||
tray_colors=Couleur de la grille
|
||||
tray_exit=Quitter
|
||||
|
||||
tray_refresh=- Rafraîchir cette liste -
|
||||
|
||||
tray_safemode=Mode sans échec
|
||||
tray_showgrid=Afficher la grille
|
||||
tray_shownumbers=Afficher la numérotation de grille
|
||||
tray_lbuttondrag=Utiliser: Mode glisser par le titre
|
||||
tray_mbuttondrag=Utiliser: Mode avec bouton central
|
||||
tray_edgedrag=Utiliser: Mode de bordure
|
||||
tray_edgetime=Définir le délais Mode de bordure...
|
||||
tray_titlesize=Définir la taille de la barre de titre...
|
||||
tray_gridorder=Définir l'odre de la grille...
|
||||
|
||||
tray_usecommand=Utiliser mode commande
|
||||
tray_commandhotkey=Définir le raccourci commande...
|
||||
tray_fastmove=Utiliser le déplacement rapide
|
||||
tray_fastmovemodifiers=Modificateur de déplacement rapide...
|
||||
|
||||
tray_color_orange=Orange
|
||||
tray_color_blue=Bleu
|
||||
tray_color_black=Noir
|
||||
|
||||
error_ngroups=Une erreur s'est produite lors de l'ouverture du fichier grid. La configuration par défaut sera restaurée. Veuillez sélectionner une autre grille du menu modèles. ErrorCode:001
|
||||
error_grid_p1=Une erreur s'est produite lors de la lecture du fichier grid. La configuration par défaut sera restaurée.
|
||||
error_grid_p2=Erreur de lecture pour un élément de la grille
|
||||
|
||||
info_removed_p1=Fenêtre retirée
|
||||
info_removed_p2=des exception
|
||||
info_added_p1=Fenêtre ajoutée
|
||||
info_added_p2=aux exceptions
|
||||
|
||||
tooltip_ignore=Appuyez sur F12 pour ignorer ou non la fenêtre ayant actuellement le focus, F11 pour annuler.
|
||||
|
||||
input_hotkey=Entrez la touche raccourci, Sélectionnez la touche qui sera utilisée pour passer au mode commande de GridMove. ^ signifie ctrl + signifie shift ! signifie alt et # signifie le bouton Windows. ex. ^#g signifie ctrl+BoutonWindows+g. Il est a noter que l'ordre des touches n'a aucune importance...
|
||||
input_fastmove=Entrez la touche filtre pour activer le déplacement rapide, Entrez la touche pour le déplacement rapide. ^ signifie ctrl + signifie shift ! signifie alt et # signifie le bouton Windows. ex. ^# fera donc ctrl+BoutonWindows+1 déplacer la fenêtre active dans la première zone de la grille. Il est a noter que l'ordre des touches n'a aucune importance...
|
||||
input_gridorder=Entrez un ordre pour le défilement des différentes grilles, Il suffit d'entrer les noms comme ils le sont dans le menu "Modèles", separés par des virgules ','.
|
||||
input_edgetime=Entrez un délais pour l'activation du mode de bordure, Entrez un délais avant que la grille apparaisse quand une fenêtre est déplacée en bordure d'écran.
|
||||
input_titlesize=Entrez la taille de délimitation pour la zone de titre , Entrez un nombre de pixels pour la zone de titre qui sera utilisée pour le mode déplacement par le titre.
|
||||
|
||||
helper_1=Vous pouvez maintenant sélectionner l'endroit où déposer votre fenêtre.
|
||||
helper_2=Vous pouvez maintenant glisser la fenêtre pour activer le mode déposer la fenêtre
|
||||
helper_3=Garder la souris ici activera le mode déposer la fenêtre.
|
||||
helper_4=Vous pouvez maintenant glisser la fenêtre en bordure d'écran pour activer le mode déposer la fenêtre
|
||||
|
||||
;;english
|
||||
tray_help=About/Help
|
||||
tray_updates=Check For Updates!
|
||||
tray_ignore=Ignore/Unignore window...
|
||||
tray_windows=Start With Windows
|
||||
tray_templates=Templates
|
||||
tray_options=Options
|
||||
tray_hotkeys=Hotkeys
|
||||
tray_restart=Restart
|
||||
tray_colors=Grid Color
|
||||
tray_exit=Exit
|
||||
|
||||
tray_refresh=- Refresh this list -
|
||||
|
||||
tray_safemode=Safe Mode
|
||||
tray_showgrid=Show Grid
|
||||
tray_shownumbers=Show Numbers On Grid
|
||||
tray_lbuttondrag=Use Drag On Window Title method
|
||||
tray_mbuttondrag=Use Drag With Middle Button method
|
||||
tray_edgedrag=Use Drag Window To Edge method
|
||||
tray_edgetime=Set Edge Time...
|
||||
tray_titlesize=Set Title Size...
|
||||
tray_gridorder=Set Grid Order...
|
||||
|
||||
tray_usecommand=Use Command
|
||||
tray_commandhotkey=Select Command Hotkey...
|
||||
tray_fastmove=Use Fast Move
|
||||
tray_fastmovemodifiers=Select Fast Move Modifiers...
|
||||
|
||||
tray_color_orange=Orange
|
||||
tray_color_blue=Blue
|
||||
tray_color_black=Black
|
||||
|
||||
error_ngroups=There was an error while opening the grid file. Reverting to Default Config. Please select another grid from the templates menu. ErrorCode:001
|
||||
error_grid_p1=There was an error while reading the grid file. Reverting to Default config.
|
||||
error_grid_p2=Read error on grid element
|
||||
|
||||
info_removed_p1=Removed window
|
||||
info_removed_p2=from exceptions
|
||||
info_added_p1=Added window
|
||||
info_added_p2=to exceptions
|
||||
|
||||
tooltip_ignore=Focus the window to ignore/unignore and press F12!! Press F11 to cancel.
|
||||
|
||||
input_hotkey_title=Input the hotkey
|
||||
input_hotkey=Select the hotkey you'd like to use to make GridMove go into Command Mode. ^ stands for ctrl, + stands for shift, ! stands for alt and # stands for Windows key. E.G.: ^#g stands for ctrl+win+g. Notice that the order of the modifiers doesn't matter.
|
||||
input_fastmove=Input the modifier keys for Fast Move, Please input the modifiers for Fast Move. ^ stands for ctrl, + stands for shift, ! stands for alt and # stands for Win key. E.G. : ^# will make ctrl+windows+1 move the active window to the first area. Notice that their order doesn't matter.
|
||||
input_gridorder=Input an order for the grid Cycle, Just type the names as found in the "templates" menu item, separated by commas ','.
|
||||
input_edgetime=Input the delay for the edge method, Please input the delay before the grid comes up when a window is dragged to the edge of the screen.
|
||||
input_titlesize=Input the size of the title of windows, Please input the number of pixels to be considered as the title of a window for the LButton drag method.
|
||||
|
||||
helper_1=You can now select where to drop the window.
|
||||
helper_2=You may now drag the window to go into drop zone mode
|
||||
helper_3=If you keep the mouse here drop zone mode will be activated
|
||||
helper_4=You can now drag the window to the edge of the screen to activate drop zone mode.
|
||||
=
|
195
TitleButton.ahk
Normal file
195
TitleButton.ahk
Normal file
@ -0,0 +1,195 @@
|
||||
; By majkinetor
|
||||
; v0.31
|
||||
|
||||
TitleButtonInitialization:
|
||||
DetectHiddenWindows, On
|
||||
Gui, 5:+LastFound -Caption +ToolWindow +AlwaysOnTop
|
||||
Dock_ClientId := WinExist()
|
||||
Gui, 5:Font,s8 , Webdings
|
||||
Gui, 5:Add, Picture, w16 h16 x0 y0 +0x8000 gOnClick, GridMove.ico
|
||||
WinSet ExStyle, 0x08000008, ahk_id %Dock_ClientId%
|
||||
|
||||
Gui, 5:Color, 0xFF
|
||||
WinSet, TransColor, 0xFF
|
||||
|
||||
|
||||
; Dock("L","T", 25, 5) ;left
|
||||
Dock("R","T",-100, 5) ;right
|
||||
|
||||
Gui, 5:Show, x-1500
|
||||
Gui, 5:Hide
|
||||
return
|
||||
|
||||
OnClick:
|
||||
Hotkey = LButton
|
||||
send {LButton up}
|
||||
GoSub,DropZoneMode
|
||||
return
|
||||
|
||||
|
||||
5GuiContextMenu:
|
||||
hwnd := WinExist("A")
|
||||
WinGetClass class, ahk_id %hwnd%
|
||||
msgbox 36, FM3, Exclude class:`n`n%class%
|
||||
ifMsgBox, No
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
;===============================================================================
|
||||
|
||||
Dock(H="R",V="T", dx=0, dy=0 ) {
|
||||
local hwnd, msg
|
||||
|
||||
|
||||
hwnd := WinExist("ahk_pid " . DllCall("GetCurrentProcessId","Uint"))
|
||||
Dock_msg := 0x550
|
||||
|
||||
HookDll = %A_ScriptDir%/wineventhookq.dll
|
||||
|
||||
Dock_pH := H
|
||||
Dock_pV := V
|
||||
Dock_dx := dx
|
||||
Dock_dy := dy
|
||||
Dock_sizeX := sizeX
|
||||
Dock_sizeY := sizeY
|
||||
|
||||
Dock_hHookDll := API_LoadLibrary(HookDll)
|
||||
|
||||
Dock_hHook2 := Hook(hwnd, Dock_msg, 2) ;alert
|
||||
Dock_hHook0 := Hook(hwnd, Dock_msg, 3) ;EVENT_SYSTEM_FOREGROUND
|
||||
; Dock_hHook1 := Hook(hwnd, Dock_msg, 22, 23) ;EVENT_SYSTEM_MINIMIZEEND
|
||||
Dock_hHook3 := Hook(hwnd, Dock_msg, 0x800B, 0x800B, "Dock_HookHandler") ;EVENT_OBJECT_STATECHANGE ,EVENT_OBJECT_LOCATIONCHANGE
|
||||
|
||||
|
||||
return Dock_hHook & Dock_hHookDll
|
||||
}
|
||||
|
||||
Dock_Update:
|
||||
|
||||
WinGetPos, Dock_hX, Dock_hY, Dock_hW, Dock_hH, ahk_id %Dock_HookHwnd%
|
||||
WinGetPos, Dock_cX, Dock_cY, Dock_cW, Dock_cH, ahk_id %Dock_ClientId%
|
||||
|
||||
|
||||
Dock_x := Dock_hX
|
||||
if (Dock_pH = "R")
|
||||
Dock_x := Dock_hX + Dock_hW
|
||||
else if (Dock_pH = "M")
|
||||
Dock_x := Dock_hX + (Dock_hW//2) - (Dock_cW//2)
|
||||
|
||||
Dock_y := Dock_hY
|
||||
if (Dock_pV = "B")
|
||||
Dock_y := Dock_hY + Dock_hH
|
||||
else if (Dock_pV = "M")
|
||||
Dock_y := Dock_hY + (Dock_hH//2) - (Dock_cH//2)
|
||||
|
||||
Dock_x += Dock_dx, Dock_y += Dock_dy
|
||||
; OutputDebug %Dock_Event%, %Dock_ClientId%, %Dock_X%, %Dock_Y%
|
||||
WinMove, ahk_id %Dock_ClientId%, ,%Dock_X%, %Dock_Y%, %Dock_W%, %Dock_H%
|
||||
;WinSet, Top,, ahk_id %Dock_ClientId%
|
||||
WinShow, ahk_id %Dock_ClientId%
|
||||
return
|
||||
|
||||
|
||||
Undock(){
|
||||
goSub Dock_Update
|
||||
Unhook(Dock_hHook, Dock_msg)
|
||||
API_FreeLibrary(HookDll)
|
||||
}
|
||||
|
||||
Dock_HookHandler(wParam, lParam, msg, hwnd) {
|
||||
local e, cls, title
|
||||
static alert
|
||||
GetHookParams(lparam, Dock_event, Dock_HookHwnd)
|
||||
WinGetClass, Dock_cls, ahk_id %Dock_HookHwnd%
|
||||
WinGetTitle, title, ahk_id %Dock_HookHwnd%
|
||||
WinGet, style, Style, ahk_id %Dock_HookHwnd%
|
||||
; OutputDebug AHK-Dock: ENTER %dock_event% %title% %dock_cls%
|
||||
|
||||
if Dock_cls in %Dock_Exclude% ;skip excluded
|
||||
{
|
||||
; OutputDebug AHK-Dock: exclusion %dock_event% %title% %dock_cls%
|
||||
if (Dock_event != 0x800B)
|
||||
WinHide, ahk_id %Dock_ClientId%
|
||||
return
|
||||
}
|
||||
|
||||
if (title = "") or !(style & 0xC00000) or !(style & 0x10000000) or (style & 0x40000000) { ; WS_CAPTION = C00000 , WS_VISIBLE = 0x10000000, WS_CHILD = 0x40000000
|
||||
return
|
||||
}
|
||||
|
||||
if (Dock_event = 2) {
|
||||
; OutputDebug AHK-Dock: %dock_event% %title% %dock_cls%
|
||||
alert := Dock_HookHwnd ; remember alert win
|
||||
return
|
||||
}
|
||||
if (alert = Dock_HookHwnd) ; skip alert windows
|
||||
return
|
||||
|
||||
if (Dock_event = 3) { ; Foreground
|
||||
; OutputDebug AHK-Dock: %dock_event% %title% %dock_cls%
|
||||
gosub Dock_Update
|
||||
return
|
||||
}
|
||||
|
||||
if (Dock_event=0x800B) ;or (Dock_event=0x800A) or (Dock_event = 23)
|
||||
{
|
||||
; OutputDebug AHK-Dock: %dock_event% %title% %dock_cls%
|
||||
gosub Dock_Update
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GetHookParams(lparam, ByRef event, ByRef hwnd="", ByRef idObject="", ByRef idChild="", ByRef dwEventThread="", ByRef dwmsEventTime="") {
|
||||
event :=GetDeRefInteger(lParam+4)
|
||||
hwnd :=GetDeRefInteger(lParam+8)
|
||||
idObject :=GetDeRefInteger(lParam+12)
|
||||
idChild :=GetDeRefInteger(lParam+16)
|
||||
dwEventThread :=GetDeRefInteger(lParam+20)
|
||||
dwmsEventTime :=GetDeRefInteger(lParam+24)
|
||||
}
|
||||
|
||||
Hook(comm_hwnd, comm_msg, s_event, e_event="", function="", wparam=0) {
|
||||
global HookDll
|
||||
|
||||
r := DllCall(HookDll "\reghook", "UInt", comm_hwnd, "UInt", COMM_MSG, "UInt", s_event, "UInt", e_event ? e_event : s_event, "UInt", wparam)
|
||||
if !r
|
||||
return 0
|
||||
|
||||
if (function)
|
||||
OnMessage(COMM_MSG, function)
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
Unhook(handle, com_msg) {
|
||||
OnMessage(com_msg, "")
|
||||
return DllCall("UnhookWinEvent", "UInt", handle)
|
||||
}
|
||||
|
||||
API_LoadLibrary( dll ) {
|
||||
return DllCall("LoadLibrary", "str", dll)
|
||||
}
|
||||
|
||||
API_FreeLibrary( h ) {
|
||||
return DllCall("FreeLibrary", "uint", h)
|
||||
}
|
||||
|
||||
API_ShowWindow(hwnd, flag){
|
||||
return DllCall("ShowWindow", "UInt", hwnd, "int", flag)
|
||||
}
|
||||
|
||||
|
||||
GetDeRefInteger(pSource, pIsSigned = false, pSize = 4)
|
||||
; pSource is an integer pointer to a raw/binary integer
|
||||
; The caller should pass true for pSigned to interpret the result as signed vs. unsigned.
|
||||
; pSize is the size of PSource's integer in bytes (e.g. 4 bytes for a DWORD or Int).
|
||||
{
|
||||
Loop %pSize% ; Build the integer by adding up its bytes.
|
||||
result += *(pSource + A_Index-1) << 8*(A_Index-1)
|
||||
if (!pIsSigned OR pSize > 4 OR result < 0x80000000)
|
||||
return result ; Signed vs. unsigned doesn't matter in these cases.
|
||||
; Otherwise, convert the value (now known to be 32-bit) to its signed counterpart:
|
||||
return -(0xFFFFFFFF - result + 1)
|
||||
}
|
85
cursor_hide.ahk
Normal file
85
cursor_hide.ahk
Normal file
@ -0,0 +1,85 @@
|
||||
loop, 13
|
||||
ToggleSystemCursor( A_Index, true )
|
||||
|
||||
MsgBox, Just in time for Halloween ...
|
||||
|
||||
loop, 13
|
||||
ToggleSystemCursor( A_Index )
|
||||
return
|
||||
|
||||
ToggleSystemCursor( p_id, p_hide=false )
|
||||
{
|
||||
/*
|
||||
OCR_NORMAL IDC_ARROW 32512 1
|
||||
OCR_IBEAM IDC_IBEAM 32513 2
|
||||
OCR_WAIT IDC_WAIT 32514 3
|
||||
OCR_CROSS IDC_CROSS 32515 4
|
||||
OCR_UP IDC_UPARROW 32516 5
|
||||
OCR_SIZENWSE IDC_SIZENWSE 32642 6
|
||||
OCR_SIZENESW IDC_SIZENESW 32643 7
|
||||
OCR_SIZEWE IDC_SIZEWE 32644 8
|
||||
OCR_SIZENS IDC_SIZENS 32645 9
|
||||
OCR_SIZEALL IDC_SIZEALL 32646 10
|
||||
OCR_NO IDC_NO 32648 11
|
||||
OCR_HAND IDC_HAND 32649 12
|
||||
OCR_APPSTARTING IDC_APPSTARTING 32650 13
|
||||
*/
|
||||
|
||||
static system_cursor_list
|
||||
|
||||
if system_cursor_list=
|
||||
system_cursor_list = |1:32512|2:32513|3:32514|4:32515|5:32516|6:32642|7:32643|8:32644|9:32645|10:32646|11:32648|12:32649|13:32650|
|
||||
|
||||
ix := InStr( system_cursor_list, "|" p_id )
|
||||
ix := InStr( system_cursor_list, ":", false, ix )+1
|
||||
|
||||
StringMid, id, system_cursor_list, ix, 5
|
||||
|
||||
ix_b := ix+6
|
||||
ix_e := InStr( system_cursor_list, "|", false, ix )-1
|
||||
|
||||
SysGet, cursor_w, 13
|
||||
SysGet, cursor_h, 14
|
||||
|
||||
if ( cursor_w != 32 or cursor_h != 32 )
|
||||
{
|
||||
MsgBox, System parameters not supported!
|
||||
return
|
||||
}
|
||||
|
||||
if ( p_hide )
|
||||
{
|
||||
if ( ix_b < ix_e )
|
||||
return
|
||||
|
||||
h_cursor := DllCall( "LoadCursor", "uint", 0, "uint", id )
|
||||
|
||||
h_cursor := DllCall( "CopyImage", "uint", h_cursor, "uint", 2, "int", 0, "int", 0, "uint", 0 )
|
||||
|
||||
StringReplace, system_cursor_list, system_cursor_list, |%p_id%:%id%, |%p_id%:%id%`,%h_cursor%
|
||||
|
||||
VarSetCapacity( AndMask, 32*4, 0xFF )
|
||||
VarSetCapacity( XorMask, 32*4, 0 )
|
||||
|
||||
h_cursor := DllCall( "CreateCursor"
|
||||
, "uint", 0
|
||||
, "int", 0
|
||||
, "int", 0
|
||||
, "int", cursor_w
|
||||
, "int", cursor_h
|
||||
, "uint", &AndMask
|
||||
, "uint", &XorMask )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ix_b > ix_e )
|
||||
return
|
||||
|
||||
StringMid, h_cursor, system_cursor_list, ix_b, ix_e-ix_b+1
|
||||
|
||||
StringReplace, system_cursor_list, system_cursor_list, |%p_id%:%id%`,%h_cursor%, |%p_id%:%id%
|
||||
}
|
||||
|
||||
result := DllCall( "SetSystemCursor", "uint", h_cursor, "uint", id )
|
||||
}
|
||||
|
16
temp_options.ahk
Normal file
16
temp_options.ahk
Normal file
@ -0,0 +1,16 @@
|
||||
Gui, Add, Tab, x6 y7 w430 h530 , Tab1|Tab2
|
||||
Gui, Add, CheckBox, x26 y57 w210 h30 , By dragging a window by its title (left section of title bar)
|
||||
Gui, Add, GroupBox, x16 y37 w400 h120 , GroupBox
|
||||
Gui, Add, CheckBox, x26 y87 w210 h30 , By dragging a window while pressing middle button
|
||||
Gui, Add, CheckBox, x26 y117 w210 h30 , By dragging a window to the edge of the screen
|
||||
Gui, Add, Text, x246 y47 w160 h30 , Delay before grid comes up when dragging to edge (in millisecons)
|
||||
Gui, Tab, Tab1
|
||||
Gui, Add, Text, x246 y97 w160 h30 , Size of the portion of title bar considered "title" (in pixels)
|
||||
Gui, Add, Edit, x246 y127 w160 h20 , Edit
|
||||
Gui, Add, Edit, x246 y77 w160 h20 , Edit
|
||||
; Generated using SmartGUI Creator 4.0
|
||||
Gui, Show, x185 y91 h545 w451, New GUI Window
|
||||
Return
|
||||
|
||||
GuiClose:
|
||||
ExitApp
|
BIN
wineventhookq.dll
Normal file
BIN
wineventhookq.dll
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user