<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Деактивация строки ввода]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=14030&amp;type=atom" />
	<updated>2018-08-20T13:14:47Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=14030</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=128130#p128130" />
			<content type="html"><![CDATA[<p>Может дело в том, что gui ahk показывается как Dialog Box, а не как Client Object (если смотреть через MSAA).<br />Например, в этом коде при каждой активации окна в фокусе находится Client:<br /></p><div class="codebox"><pre><code>;[updated: 2017-04-19]

#SingleInstance force
#KeyHistory 0
#UseHook
#NoEnv
ListLines, Off
Menu, Tray, Click, 1
AutoTrim, Off

#Persistent
DetectHiddenWindows, On
;SplitPath, A_ScriptName,,,, vScriptNameNoExt
;Menu, Tray, Tip, % vScriptNameNoExt

;AHK v1.1 script
;remake by jeeswg of:
;[tutorial] Creating windows without GUI commands - Scripts and Functions - AutoHotkey Community
;https://autohotkey.com/board/topic/21124-tutorial-creating-windows-without-gui-commands/

hFont := JEE_FontCreate(&quot;Courier New&quot;, 10)
JEE_ConstantsWinStyles()

vText := &quot; ;continuation section
(LTrim
	Volume in drive C has no label.
	Volume Serial Number is B857-7430

	Directory of C:\Documents and Settings\mmilic

	07.09.2007  16:18    &lt;DIR&gt;          .
	07.09.2007  16:18    &lt;DIR&gt;          ..
	07.09.2007  10:12    &lt;DIR&gt;          Desktop
	19.01.2007  16:01    &lt;DIR&gt;          Favorites
	28.08.2007  15:28    &lt;DIR&gt;          My Documents
	07.09.2007  16:18               532 out
	14.02.2007  16:57    &lt;DIR&gt;          Start Menu
	1 File(s)            532 bytes
	6 Dir(s)  180.445.904.896 bytes free
)&quot;

;DT_EDITCONTROL := 0x2000 ;DT_NOPREFIX := 0x800
;DT_CALCRECT := 0x400 ;DT_NOCLIP := 0x100
;DT_EXPANDTABS := 0x40 ;DT_SINGLELINE := 0x20
;DT_WORDBREAK := 0x10
vLimW := 500, vLimH := 500
JEE_StrGetDim(vText, hFont, vTextW, vTextH, 0x2D50, vLimW, vLimH)

;==================================================

;create window class e.g. AutoHotkeyGUI
;hIcon := LoadPicture(A_AhkPath, &quot;&quot;, vType) ;AHK icon
;hIconSm := LoadPicture(A_AhkPath, &quot;w16 h16&quot;, vType) ;AHK icon
;hIcon := LoadPicture(A_AhkPath, &quot;Icon-160&quot;, vType) ;AHK file icon
;hIconSm := LoadPicture(A_AhkPath, &quot;w16 h16 Icon-160&quot;, vType) ;AHK file icon
hIcon := hIconSm := 0
JEE_RegisterClassExCFI(&quot;JEEClass&quot;, &quot;MyWndProc&quot;, hIcon, hIconSm)

;==================================================

;create window
;SplitPath, A_ScriptName,,,, vScriptNameNoExt
SysGet, vCaptionH, 31 ;SM_CYSIZE

vWinClass := &quot;JEEClass&quot;
vWinText := A_ScriptName ;window title
vWinStyle := WS_SYSMENU ;start off hidden with WS_VISIBLE off
vWinExStyle := WS_EX_DLGMODALFRAME | WS_EX_ACCEPTFILES
vPosX := 100, vPosY := 100
vPosW := vTextW+40, vPosH := vTextH+vCaptionH+80
hWndParent := 0, hMenu := 0, hInstance := 0, vParam := 0
hGui := JEE_DCCreateWindowEx(vWinExStyle, vWinClass, vWinText, vWinStyle, vPosX, vPosY, vPosW, vPosH, hWndParent, hMenu, hInstance, vParam)

;==================================================

;create Static control
;SS_EDITCONTROL := 0x2000 ;SS_NOPREFIX := 0x80

vWinClass := &quot;Static&quot;
vWinText := vText
vWinStyle := WS_VISIBLE | WS_CHILD | 0x2080
vWinExStyle := 0
vPosX := 0, vPosY := 0, vPosW := vTextW, vPosH := vTextH
hWndParent := hGui, hMenu := 0, hInstance := 0, vParam := 0
hStatic := JEE_DCCreateWindowEx(vWinExStyle, vWinClass, vWinText, vWinStyle, vPosX, vPosY, vPosW, vPosH, hWndParent, hMenu, hInstance, vParam)

SendMessage, 0x30, % hFont, 1,, % &quot;ahk_id &quot; hStatic ;WM_SETFONT := 0x30

;pStaticProc := RegisterCallback(&quot;MyStaticProc&quot;, &quot;&quot;)
;GWL_WNDPROC := -4
;vSfx := (A_PtrSize=8) ? &quot;Ptr&quot; : &quot;&quot;
;pStaticProcOld := DllCall(&quot;SetWindowLong&quot; vSfx, Ptr,hStatic, Int,-4, Ptr,pStaticProc, Ptr)

;==================================================

;create Button control
vWinClass := &quot;Button&quot;
vWinText := &quot;OK&quot;
vWinStyle := WS_VISIBLE | WS_CHILD
vWinExStyle := 0
vPosX := 10, vPosY := vTextH+30, vPosW := 50, vPosH := 25
hWndParent := hGui, hMenu := 0, hInstance := 0, vParam := 0
hBtn := JEE_DCCreateWindowEx(vWinExStyle, vWinClass, vWinText, vWinStyle, vPosX, vPosY, vPosW, vPosH, hWndParent, hMenu, hInstance, vParam)

pBtnProc := RegisterCallback(&quot;MyBtnProc&quot;, &quot;&quot;)
;GWL_WNDPROC := -4
vSfx := (A_PtrSize=8) ? &quot;Ptr&quot; : &quot;&quot;
pBtnProcOld := DllCall(&quot;SetWindowLong&quot; vSfx, Ptr,hBtn, Int,-4, Ptr,pBtnProc, Ptr)

;==================================================

ControlFocus,, % &quot;ahk_id &quot; hBtn
WinShow, % &quot;ahk_id &quot; hGui
WinActivate, % &quot;ahk_id &quot; hGui
return

;==================================================

MyWndProc(hWnd, uMsg, wParam, lParam)
{
	DetectHiddenWindows, On
	global hGui, hBtn

	;VK_ESCAPE := 0x1B ;VK_RETURN := 0xD
	if (uMsg = 0x102) ;WM_CHAR := 0x102
	&amp;&amp; ((wParam = 0x1B) || (wParam = 0xD))
	&amp;&amp; (hWnd = hGui)
		DllCall(&quot;DestroyWindow&quot;, Ptr,hWnd)

	;BN_CLICKED := 0
	if (uMsg = 0x111) ;WM_COMMAND := 0x111
	&amp;&amp; (wParam &gt;&gt; 16 = 0) &amp;&amp; (lParam = hBtn)
		DllCall(&quot;DestroyWindow&quot;, Ptr,hWnd)

	return DllCall(&quot;DefWindowProc&quot;, Ptr,hWnd, UInt,uMsg, UPtr,wParam, Ptr,lParam, Ptr)
}

;==================================================

MyBtnProc(hWnd, uMsg, wParam, lParam)
{
	global pBtnProcOld, hGui

	;VK_ESCAPE := 0x1B ;VK_RETURN := 0xD
	if (uMsg = 0x102) ;WM_CHAR := 0x102
	&amp;&amp; ((wParam = 0x1B) || (wParam = 0xD))
		DllCall(&quot;DestroyWindow&quot;, Ptr,hGui)

	return DllCall(&quot;CallWindowProc&quot;, Ptr,pBtnProcOld, Ptr,hWnd, UInt,uMsg, UPtr,wParam, Ptr,lParam)
}

;==================================================

;;;FUNCTIONS

;JEE_FontCreate
;JEE_ConstantsWinStyles
;JEE_StrGetDim
;JEE_RegisterClassExCFI
;JEE_DCCreateWindowEx

;==================================================

;JEE_WinStylesInit
JEE_ConstantsWinStyles()
{
	global
	WS_OVERLAPPED := 0x0
	WS_TABSTOP := 0x10000
	WS_MAXIMIZEBOX := 0x10000
	WS_MINIMIZEBOX := 0x20000
	WS_GROUP := 0x20000
	WS_THICKFRAME := 0x40000
	WS_SYSMENU := 0x80000
	WS_HSCROLL := 0x100000
	WS_VSCROLL := 0x200000
	WS_DLGFRAME := 0x400000
	WS_BORDER := 0x800000
	WS_CAPTION := 0xC00000
	WS_OVERLAPPEDWINDOW := 0xCF0000
	WS_MAXIMIZE := 0x1000000
	WS_CLIPCHILDREN := 0x2000000
	WS_CLIPSIBLINGS := 0x4000000
	WS_DISABLED := 0x8000000
	WS_VISIBLE := 0x10000000
	WS_MINIMIZE := 0x20000000
	WS_CHILD := 0x40000000
	WS_POPUP := 0x80000000
	WS_POPUPWINDOW := 0x80880000

	WS_EX_LEFT := 0x0
	WS_EX_LTRREADING := 0x0
	WS_EX_RIGHTSCROLLBAR := 0x0
	WS_EX_DLGMODALFRAME := 0x1
	WS_EX_NOPARENTNOTIFY := 0x4
	WS_EX_TOPMOST := 0x8
	WS_EX_ACCEPTFILES := 0x10
	WS_EX_TRANSPARENT := 0x20
	WS_EX_MDICHILD := 0x40
	WS_EX_TOOLWINDOW := 0x80
	WS_EX_WINDOWEDGE := 0x100
	WS_EX_CLIENTEDGE := 0x200
	WS_EX_CONTEXTHELP := 0x400
	WS_EX_RIGHT := 0x1000
	WS_EX_RTLREADING := 0x2000
	WS_EX_LEFTSCROLLBAR := 0x4000
	WS_EX_CONTROLPARENT := 0x10000
	WS_EX_STATICEDGE := 0x20000
	WS_EX_APPWINDOW := 0x40000
	WS_EX_OVERLAPPEDWINDOW := 0x300
	WS_EX_PALETTEWINDOW := 0x188
}

;==================================================

JEE_DCCreateWindowEx(vWinExStyle, vWinClass, vWinText, vWinStyle, vPosX, vPosY, vPosW, vPosH, hWndParent, hMenu, hInstance, vParam)
{
	return DllCall(&quot;CreateWindowEx&quot;,UInt,vWinExStyle,Str,vWinClass,Str,vWinText,UInt,vWinStyle,Int,vPosX,Int,vPosY,Int,vPosW,Int,vPosH, Ptr,hWndParent, Ptr,hMenu,Ptr,hInstance,Ptr,vParam,Ptr)
}

;==================================================

;e.g. hFont := JEE_FontCreate(&quot;Arial&quot;, 12, &quot;bius&quot;)

;JEE_CreateFont
JEE_FontCreate(vName, vSize, vFontStyle=&quot;&quot;, vWeight=&quot;&quot;)
{
	vHeight := -DllCall(&quot;kernel32\MulDiv&quot;, Int,vSize, Int,A_ScreenDPI, Int,72)
	vWidth := 0
	vEscapement := 0
	vOrientation := 0
	vWeight := (InStr(vFontStyle, &quot;b&quot;) &amp;&amp; (vWeight=&quot;&quot;)) ? 700 : 400
	vItalic := InStr(vFontStyle, &quot;i&quot;) ? 1 : 0
	vUnderline := InStr(vFontStyle, &quot;u&quot;) ? 1 : 0
	vStrikeOut := InStr(vFontStyle, &quot;s&quot;) ? 1 : 0
	vCharSet := 0
	vOutPrecision := 0
	vClipPrecision := 0
	vQuality := 0
	vPitchAndFamily := 0
	vFaceName := vName
	vOutPrecision := 3
	vClipPrecision := 2
	vQuality := 1
	vPitchAndFamily := 34
	return DllCall(&quot;CreateFont&quot;, Int,vHeight, Int,vWidth, Int,vEscapement, Int,vOrientation, Int,vWeight, UInt,vItalic, UInt,vUnderline,UInt,vStrikeOut, UInt,vCharSet, UInt,vOutPrecision,UInt,vClipPrecision,UInt,vQuality,UInt,vPitchAndFamily,Str,vFaceName,Ptr)
}

;==================================================

JEE_RegisterClassExCFI(vWinClass, vFunc, hIcon=0, hIconSm=&quot;&quot;)
{
	pWndProc := RegisterCallback(vFunc, &quot;F&quot;)
	hCursor := DllCall(&quot;LoadCursor&quot;, Ptr,0, Ptr,32512, Ptr) ;IDC_ARROW := 32512
	if (hIconSm = &quot;&quot;)
		hIconSm := hIcon

	vPIs64 := (A_PtrSize=8)
	vSize := vPIs64?80:48
	VarSetCapacity(WNDCLASSEX, vSize, 0)
	NumPut(vSize, WNDCLASSEX, 0, &quot;UInt&quot;) ;cbSize
	NumPut(3, WNDCLASSEX, 4, &quot;UInt&quot;) ;style
	NumPut(pWndProc, WNDCLASSEX, 8, &quot;Ptr&quot;) ;lpfnWndProc
	NumPut(0, WNDCLASSEX, vPIs64?16:12, &quot;Int&quot;) ;cbClsExtra
	NumPut(0, WNDCLASSEX, vPIs64?20:16, &quot;Int&quot;) ;cbWndExtra
	NumPut(0, WNDCLASSEX, vPIs64?24:20, &quot;Ptr&quot;) ;hInstance
	NumPut(hIcon, WNDCLASSEX, vPIs64?32:24, &quot;Ptr&quot;) ;hIcon
	NumPut(hCursor, WNDCLASSEX, vPIs64?40:28, &quot;Ptr&quot;) ;hCursor
	NumPut(16, WNDCLASSEX, vPIs64?48:32, &quot;Ptr&quot;) ;hbrBackground
	NumPut(0, WNDCLASSEX, vPIs64?56:36, &quot;Ptr&quot;) ;lpszMenuName
	NumPut(&amp;vWinClass, WNDCLASSEX, vPIs64?64:40, &quot;Ptr&quot;) ;lpszClassName
	NumPut(hIconSm, WNDCLASSEX, vPIs64?72:44, &quot;Ptr&quot;) ;hIconSm
	return DllCall(&quot;RegisterClassEx&quot;, Ptr,&amp;WNDCLASSEX, UShort)
}

;==================================================

;JEE DrawText
JEE_StrGetDim(vText, hFont, ByRef vTextW, ByRef vTextH, vDTFlags:=0x400, vLimW:=&quot;&quot;, vLimH:=&quot;&quot;)
{
	;DT_EDITCONTROL := 0x2000 ;DT_NOPREFIX := 0x800
	;DT_CALCRECT := 0x400 ;DT_NOCLIP := 0x100
	;DT_EXPANDTABS := 0x40 ;DT_SINGLELINE := 0x20
	;DT_WORDBREAK := 0x10

	;HWND_DESKTOP := 0
	hDC := DllCall(&quot;user32\GetDC&quot;, Ptr,0, Ptr)
	hFontOld := DllCall(&quot;gdi32\SelectObject&quot;, Ptr,hDC, Ptr,hFont)
	VarSetCapacity(SIZE, 8, 0)
	vTabLengthText := &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;
	DllCall(&quot;GetTextExtentPoint32&quot;, Ptr,hDC, Str,vTabLengthText, Int,52, Ptr,&amp;SIZE)
	vTabLength := NumGet(SIZE, 0, &quot;Int&quot;)
	vTabLength := Floor((vTabLength/52)+0.5)
	vTabLength := Round(vTabLength*(72/A_ScreenDPI))
	vLen := StrLen(vText)

	VarSetCapacity(DRAWTEXTPARAMS, 20, 0)
	NumPut(20, DRAWTEXTPARAMS, 0, &quot;UInt&quot;) ;cbSize
	NumPut(vTabLength, DRAWTEXTPARAMS, 4, &quot;Int&quot;) ;iTabLength
	;NumPut(0, DRAWTEXTPARAMS, 8, &quot;Int&quot;) ;iLeftMargin
	;NumPut(0, DRAWTEXTPARAMS, 12, &quot;Int&quot;) ;iRightMargin
	NumPut(vLen, DRAWTEXTPARAMS, 16, &quot;UInt&quot;) ;uiLengthDrawn

	VarSetCapacity(RECT, 16, 0)
	if !(vLimW = &quot;&quot;)
		NumPut(vLimW, RECT, 8, &quot;Int&quot;)
	if !(vLimH = &quot;&quot;)
		NumPut(vLimH, RECT, 12, &quot;Int&quot;)
	DllCall(&quot;user32\DrawTextEx&quot;, Ptr,hDC, Str,vText, Int,vLen, Ptr,&amp;RECT, UInt,vDTFlags, Ptr,&amp;DRAWTEXTPARAMS)
	DllCall(&quot;gdi32\SelectObject&quot;, Ptr,hDC, Ptr,hFontOld)
	DllCall(&quot;user32\ReleaseDC&quot;, Ptr,0, Ptr,hDC)

	vTextW := NumGet(RECT, 8, &quot;Int&quot;)
	vTextH := NumGet(RECT, 12, &quot;Int&quot;)
}

;==================================================</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-08-20T13:14:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=128130#p128130</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=128108#p128108" />
			<content type="html"><![CDATA[<p>Проще так:<br /></p><div class="codebox"><pre><code>Gui, Show, w200 h200
Gui, Add, Edit
return</code></pre></div><p>Но, имхо, это не вариант.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-08-18T19:45:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=128108#p128108</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=128107#p128107" />
			<content type="html"><![CDATA[<p>Со стандартными, при создании окна тоже можно убрать фокус:<br /></p><div class="codebox"><pre><code>GUI +0x10000000 ; WS_VISIBLE
Gui, add, edit, Center y75 x45
Gui, show, w200 h200
return</code></pre></div><p>Полагаю, что можно провернуть это дело и по горячей кнопке.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-08-18T15:29:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=128107#p128107</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=128106#p128106" />
			<content type="html"><![CDATA[<p>Я говорил про &quot;любую область окна самого скрипта&quot;. В GUI используются стандартные элементы управления, в хроме наверно какие-то свои.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2018-08-18T13:46:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=128106#p128106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=128105#p128105" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Пока окно активно, фокус обязательно будет на каком-нибудь элементе управления</p></blockquote></div><p>А в хроме не так.<br />Окно активно, контрол присутствует, но&nbsp; фокус пустой.<br />Видимо зависит от того, в каком фреймворке создавать.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-08-18T12:29:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=128105#p128105</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127808#p127808" />
			<content type="html"><![CDATA[<p>Да, неправильно. Задайте вопрос по ссылке &quot;Тема для обсуждения&quot; из того топика, а то здесь уже совсем оффтоп.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-08-11T15:06:39Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127808#p127808</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127807#p127807" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, как бы я не вставлял </p><div class="codebox"><pre><code>Hotkey_Arr(&quot;KillFocus&quot;, true)</code></pre></div><p> перед созданием контроллов, у меня это не работает. Или я что-то не так делаю?<br />Беру пример из поста, после первого return вставляю библиотеку и перед созданием edit&#039;ов вставляю эту строку <br /></p><div class="codebox"><pre><code>Hotkey_Arr(&quot;KillFocus&quot;, true)
Gui, Add, Edit, Center w300 r1 hwndhMyHotkey1 gWriteIni, % Hotkey_Read(&quot;MyHotkey1&quot;, &quot;Section&quot;, PathIni)
Gui, Add, Edit, Center wp y+10 r1 hwndhMyHotkey2 gWriteIni, % Hotkey_Read(&quot;MyHotkey2&quot;, &quot;Section&quot;, PathIni)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-08-11T14:51:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127807#p127807</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127806#p127806" />
			<content type="html"><![CDATA[<p>Кстати самому это не нравилось, добавил опционально, так как это не стандартное поведение. Ищите в описании &quot;KillFocus&quot;.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-08-11T14:27:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127806#p127806</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127805#p127805" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, используя <a href="http://forum.script-coding.com/viewtopic.php?pid=72549#p72549">Ваш код</a>, возникла проблема со сменой языка в окне скрипта. Вот надо мне не &quot;я&quot;, a &quot;z&quot;, или наоборот, а изменить нельзя т.к. строка ввода остаётся активной и shift+alt перехватывает скрипт.</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-08-11T13:32:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127805#p127805</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127804#p127804" />
			<content type="html"><![CDATA[<p>А можно узнать, почему у вас возник такой вопрос?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-08-11T12:33:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127804#p127804</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127803#p127803" />
			<content type="html"><![CDATA[<p>Всем большое спасибо за ответы. Всё получилось!</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-08-11T11:26:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127803#p127803</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127801#p127801" />
			<content type="html"><![CDATA[<p>Проще так:<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, Center w100 h20  
Gui, Add, Edit, Center xp y+5 wp hp     
Gui, Add, Edit, Center xp y+5 wp-22 hp
Gui, Add, Text, xp y+5 wp hp border
Gui, Add, Text, w0 h0 Hidden +HWNDhDummy
Gui, Add, Button, , knopka
Gui, Show

for, k, v in {WM_LBUTTONDOWN:0x201,WM_LBUTTONUP:0x202,WM_NCLBUTTONDOWN:0xA1} 
	fn := Func(&quot;DummyClick&quot;), OnMessage(v, fn) 
	
ControlFocus, , ahk_id %hDummy%
Return 

DummyClick(wParam, lParam, msg, hwnd) { 
	Global
	if !DllCall(&quot;GetParent&quot;, Ptr, hwnd)
		ControlFocus, , ahk_id %hDummy%
	Else
		ControlFocus, , ahk_id %hwnd%
} </code></pre></div><p>Всё таки надо добавить Else ControlFocus, , ahk_id %hwnd%, так как Static может иметь метку перехода, и быть видимым для кликов, но не перехватывать фокус.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-08-11T09:49:54Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127801#p127801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127799#p127799" />
			<content type="html"><![CDATA[<p>В вашем примере получится, что если будет Edit без переменной, то его нельзя будет активировать, то есть надо назначать переменные для всех контролов.</p><p>Может проще смотреть клик в окно или в заголовок, и в этом случае фокусировать пустышку.<br /></p><div class="codebox"><pre><code>
GUI, +HWNDhGui
GUI, Add, Edit, Center w100 h20  
GUI, Add, Edit, Center xp y+5 wp hp     
GUI, Add, Edit, Center xp y+5 wp-22 hp
GUI, Add, Text, xp y+5 wp hp border
GUI, Add, Text, w0 h0 Hidden +HWNDhDummy
GUI, Add, Button, , knopka
GUI, Show 
OnMessage(0x201, &quot;DummyClick&quot;)  ;	WM_LBUTTONDOWN 
OnMessage(0x202, &quot;DummyClick&quot;)  ;	WM_LBUTTONUP 
OnMessage(0xA1, &quot;DummyClick&quot;)  ;	WM_NCLBUTTONDOWN   
ControlFocus, , ahk_id %hDummy%
Return 

DummyClick(wParam, lParam, msg, hwnd) { 
	Global
	if (hwnd = hGui || msg = 0xA1)  ;	0xA1 := WM_NCLBUTTONDOWN
		ControlFocus, , ahk_id %hDummy% 
} 
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-08-11T09:40:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127799#p127799</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127797#p127797" />
			<content type="html"><![CDATA[<p>Чтобы проверить все значения из интервала на равенство, не обязательно их все перечислять, достаточно узнать, находится ли искомое внутри него, указав для сравнения границы интервала, например:<br /></p><div class="codebox"><pre><code>
x := 45
if (x &gt; 44 &amp;&amp; x &lt; 146)
	MsgBox, x внутри диапазона
else
	MsgBox, x вне диапазона 
</code></pre></div><p>Полю Edit нужно присвоить переменную, тогда при клике в него &quot;A_GuiControl&quot; будет содержать её имя, а значит, если &quot;A_GuiControl&quot; не равно этому имени, а ещё лучше, пустое, то фокусироваться на пустышке, хендл которой нужно объявить глобальным, чтобы к нему можно было обращаться из тела функции DummyClick():<br /></p><div class="codebox"><pre><code>
Global dummy
GUI, Add, Edit, Center y75 x45 w100 h20 vmyEdit
GUI, Add, Picture, +HWNDdummy
GUI, Add, Button, gNBTTN, knopka
GUI, Show, w200 h200
OnMessage(0x202, &quot;DummyClick&quot;)
ControlFocus, , ahk_id %dummy%
Return
NBTTN:
	MsgBox,,Title, Knopka
Return
DummyClick() {
	if (A_GuiControl == &quot;&quot;)
		ControlFocus, , ahk_id %dummy%
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2018-08-11T00:46:31Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127797#p127797</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Деактивация строки ввода]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=127796#p127796" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong>,плохо у меня получается отследить положение клика:<br /></p><div class="codebox"><pre><code>

GUI, Add, Edit, Center y75 x45 w100 h20
GUI, Add, Picture, +HWNDdummy
GUI, Show, w200 h200

LButton::
{MouseGetPos,x,y
if  x!=45 or x!=46 or x!=47 or x!=48 or x!=49 or x!=50 or x!=51 or x!=52 or x!=53 or x!=54 or x!=55 or x!=56 or x!=57 or x!=58 or x!=59 or x!=60 or x!=61 or x!=62 or x!=63 or x!=64 or x!=65 or x!=66 or x!=67 or x!=68 or x!=69 or x!=70 or x!=71 or x!=72 or x!=73 or x!=74 or x!=75 or x!=76 or x!=77 or x!=78 or x!=79 or x!=80 or x!=81 or x!=82 or x!=83 or x!=84 or x!=85 or x!=86 or x!=87 or x!=88 or x!=89 or x!=90 or x!=91 or x!=92 or x!=93 or x!=94 or x!=95 or x!=96 or x!=97 or x!=98 or x!=99 or x!=100 or x!=101 or x!=102 or x!=103 or x!=104 or x!=105 or x!=106 or x!=107 or x!=108 or x!=109 or x!=110 or x!=111 or x!=112 or x!=113 or x!=114 or x!=115 or x!=116 or x!=117 or x!=118 or x!=119 or x!=120 or x!=121 or x!=122 or x!=123 or x!=124 or x!=125 or x!=126 or x!=127 or x!=128 or x!=129 or x!=130 or x!=131 or x!=132 or x!=133 or x!=134 or x!=135 or x!=136 or x!=137 or x!=138 or x!=139 or x!=140 or x!=141 or x!=142 or x!=143 or x!=144 or x!=145
	{
	if  y!=75 or y!=76 or y!=77 or y!=78 or y!=79 or y!=80 or y!=81 or y!=82 or y!=83 or y!=84 or y!=85 or y!=86 or y!=87 or y!=88 or y!=89 or y!=90 or y!=91 or y!=92 or y!=93 or y!=94 or y!=95
		{
		ControlFocus, , ahk_id %dummy%
		}
	else 
		Click
	}
}
return

F10::ExitApp

Guiclose:
ExitApp
</code></pre></div><p>Вычислил положения Edit1, и если клик произошёл не на нём, он фокусируется на пустышку, а если на нём... то должен был быть Click, но он не происходит.<br />Как же быть?</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-08-10T23:50:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=127796#p127796</id>
		</entry>
</feed>
