Code: Select all
#z::Run notepad, , Max
Moderator: Flipeador
Code: Select all
#z::Run notepad, , Max
Code: Select all
Run F:\Desktop\1.txt,, Max
Code: Select all
Path := "F:\Desktop\1.txt"
Run % Chr(34) . A_WinDir . "\Notepad.exe" . Chr(34) . A_Space . Chr(34) . Path . Chr(34),, Max
Code: Select all
#IfWinActive, ahk_class Notepad
^q:: ;notepad fullscreen on
WinGet, hWnd, ID, A
WinGetClass, vWinClass, ahk_id %hWnd%
if vWinClass not in Notepad
Return
WinGet, vWinMinMax, MinMax, ahk_id %hWnd%
if (vWinMinMax = 1) ;1=max/0=res/1=min
WinRestore, ahk_id %hWnd%
if (hMenu%hWnd% = "")
hMenu%hWnd% := DllCall("GetMenu", "uint", hWnd)
if (vPos%hWnd% = "") OR (vWinMinMax = 0)
{
WinGetPos, vPosX, vPosY, vPosW, vPosH, ahk_id %hWnd%
vPos%hWnd% := vPosX "," vPosY "," vPosW "," vPosH
}
WinSet, Style, -0xC00000, ahk_id %hWnd% ;hide title bar
DllCall("SetMenu", "uint", hWnd, "uint", 0) ;hide menu bar
WinMove, ahk_id %hWnd%, , 0, 0, % A_ScreenWidth + 20, % A_ScreenHeight + 20
Return
;==================================================
^w:: ;notepad fullscreen off
WinGet, hWndZ, ID, A
WinGetClass, vWinClassZ, ahk_id %hWndZ%
if vWinClassZ not in Notepad
Return
hMenuZ := hMenu%hWndZ%
if (hMenuZ = "")
Return
vPosZ := vPos%hWndZ%
WinSet, Style, +0xC00000, ahk_id %hWndZ% ;show title bar
DllCall("SetMenu", "uint", hWndZ, "uint", hMenuZ) ;show menu bar
StringSplit, vPosZ, vPosZ, `,
WinMove, ahk_id %hWnd%, , %vPosZ1%, %vPosZ2%, %vPosZ3%, %vPosZ4%
Return
#IfWinActive
seguro eso se puede hacer con un RegEx con el titulo de la ventana, mas si te importa Notepad en general pues lo mejor es no tomar como referencia el titulo sino la clase de la ventana (la cual es la misma por tadas la ventanas perteneciendo al proceso Notepad)Pienso que un método sería a través del reconocimiento del contenido de la barra del título (opción WinTitle) y luego maximizando. La barra del título de la ventana del Bloc de notas (de un archivo existente en el Explorador) siempre tiene la siguiente presentación:
Nombre_del_archivo.txt Bloc de notas
Entonces cuando AHK reconozca ese título (por cierto hay que usar wilcards como *) desencadenar el comando WinMaximize o similar.
Mi problema es que soy principiante en AHK y para desgracia no sé un lenguaje de programación.
Saludos
Code: Select all
ahk_class Notepad
Code: Select all
while (true) {
WinWaitActive ahk_class Notepad
WinMaximize ahk_class Notepad
WinWaitNotActive ahk_class Notepad
}
Code: Select all
RegWrite, REG_SZ, HKCR\txtfile\shell\open\command,, cmd /c start /max notepad `%1
if (ErrorLevel)
MsgBox ERROR!
le mejor es hacerlo via el registroPuedes hacerlo con un script AHK como te ha dicho A_AhkUser, pero es un consumo de CPU y memoria totalmente innecesario.
Code: Select all
RegWrite, REG_SZ, HKCR\txtfile\shell\open\command,, cmd /c start /max notepad `%1
if (ErrorLevel)
MsgBox ERROR!
Code: Select all
ScrollLock::Run notepad , , Max
Code: Select all
~+Mbutton::WinMaximize, A
Code: Select all
#IfWinActive ahk_exe firefox.exe ;también ahk_class MozillaWindowClass
^Mbutton::Send ^w ;Cerrar pestaña
#IfWinActive ahk_exe FoxitReader.exe ;también ahk_class classFoxitReader. No uso Adobe Reader.
^Mbutton::Send ^w ;Cerrar pestaña
#IfWinActive
Si editas especialmente tus ahk script en el bloc de notas solo tienes que modicar el codigo de Flipeador.cholito wrote:Y para maximizar otros archivos que abro con el Bloc de notas (por ejemplo los .ahk).
Code: Select all
RegWrite REG_SZ, HKCR, AutoHotkeyScript\Shell\Edit\Command,, cmd /c start /max notepad `%1
if (ErrorLevel)
MsgBox ERROR!
Je t'en t'en prie, il n'y pas de quoicholito wrote:muchas gracias por tu interés en ayudar. Otra vez merci beaucoup!
Code: Select all
cmd /c start /max notepad %1
Users browsing this forum: No registered users and 23 guests