<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15185</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15185&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Вывести  msgbox  поверх всех окон не останавливая работу».]]></description>
		<lastBuildDate>Sun, 16 Feb 2020 15:12:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137851#p137851</link>
			<description><![CDATA[<p>Согласен.<br />Можно для начала <a href="https://www.autohotkey.com/boards/viewtopic.php?f=6&amp;t=20983">отсюда взять</a>, я добавил параметр Wait.<br /></p><div class="codebox"><pre><code>

MsgBoxEx(&quot;Text&quot;, &quot;Title&quot;, &quot;&quot;, [27, &quot;imageres.dll&quot;], &quot;&quot;, &quot;AlwaysOnTop&quot;, &quot;&quot;, 0, &quot;s18 c0x000000&quot;, &quot;Showcard Gothic&quot;, &quot;0x00FF00&quot;, 0)
MsgBox

MsgBoxEx(Text, Title := &quot;&quot;, Buttons := &quot;&quot;, Icon := &quot;&quot;, ByRef CheckText := &quot;&quot;, Styles := &quot;&quot;, Owner := &quot;&quot;, Timeout := &quot;&quot;, FontOptions := &quot;&quot;, FontName := &quot;&quot;, BGColor := &quot;&quot;, Wait := 1, Callback := &quot;&quot;) {
    Static hWnd, y2, p, px, pw, c, cw, cy, ch, f, o, gL, hBtn, lb, DHW, ww, Off, k, v, RetVal
    Static Sound := {2: &quot;*48&quot;, 4: &quot;*16&quot;, 5: &quot;*64&quot;}

    Gui New, hWndhWnd LabelMsgBoxEx -0xA0000
    Gui % (Owner) ? &quot;+Owner&quot; . Owner : &quot;&quot;
    Gui Font
    Gui Font, % (FontOptions) ? FontOptions : &quot;s9&quot;, % (FontName) ? FontName : &quot;Segoe UI&quot;
    Gui Color, % (BGColor) ? BGColor : &quot;White&quot;
    Gui Margin, 10, 12

    If (IsObject(Icon)) {
        Gui Add, Picture, % &quot;x20 y24 w32 h32 Icon&quot; . Icon[1], % (Icon[2] != &quot;&quot;) ? Icon[2] : &quot;shell32.dll&quot;
    } Else If (Icon + 0) {
        Gui Add, Picture, x20 y24 Icon%Icon% w32 h32, user32.dll
        SoundPlay % Sound[Icon]
    }

    Gui Add, Link, % &quot;x&quot; . (Icon ? 65 : 20) . &quot; y&quot; . (InStr(Text, &quot;`n&quot;) ? 24 : 32) . &quot; vc&quot;, %Text%
    GuicontrolGet c, Pos
    GuiControl Move, c, % &quot;w&quot; . (cw + 30)
    y2 := (cy + ch &lt; 52) ? 90 : cy + ch + 34

    Gui Add, Text, vf -Background ; Footer

    Gui Font
    Gui Font, s9, Segoe UI
    px := 42
    If (CheckText != &quot;&quot;) {
        CheckText := StrReplace(CheckText, &quot;*&quot;,, ErrorLevel)
        Gui Add, CheckBox, vCheckText x12 y%y2% h26 -Wrap -Background AltSubmit Checked%ErrorLevel%, %CheckText%
        GuicontrolGet p, Pos, CheckText
        px := px + pw + 10
    }

    o := {}
    Loop Parse, Buttons, |, *
    {
        gL := (Callback != &quot;&quot; &amp;&amp; InStr(A_LoopField, &quot;...&quot;)) ? Callback : &quot;MsgBoxExBUTTON&quot;
        Gui Add, Button, hWndhBtn g%gL% x%px% w90 y%y2% h26 -Wrap, %A_Loopfield%
        lb := hBtn
        o[hBtn] := px
        px += 98
    }
    GuiControl +Default, % (RegExMatch(Buttons, &quot;([^\*\|]*)\*&quot;, Match)) ? Match1 : StrSplit(Buttons, &quot;|&quot;)[1]

    Gui Show, Autosize Center Hide, %Title%
    DHW := A_DetectHiddenWindows
    DetectHiddenWindows On
    WinGetPos,,, ww,, ahk_id %hWnd%
    GuiControlGet p, Pos, %lb% ; Last button
    Off := ww - (((px + pw + 14) * A_ScreenDPI) // 96)
    For k, v in o {
        GuiControl Move, %k%, % &quot;x&quot; . (v + Off)
    }
    Guicontrol MoveDraw, f, % &quot;x-1 y&quot; . (y2 - 10) . &quot; w&quot; . ww . &quot; h&quot; . 48

    Gui Show
    Gui +SysMenu %Styles%
    DetectHiddenWindows %DHW%

    If (Timeout) {
        SetTimer MsgBoxExTIMEOUT, % Round(Timeout) * 1000
    }

    If (Owner) {
        WinSet Disable,, ahk_id %Owner%
    }

    GuiControl Focus, f
    Gui Font
	If Wait
		WinWaitClose ahk_id %hWnd%
    Return RetVal

    MsgBoxExESCAPE:
    MsgBoxExCLOSE:
    MsgBoxExTIMEOUT:
    MsgBoxExBUTTON:
        SetTimer MsgBoxExTIMEOUT, Delete

        If (A_ThisLabel == &quot;MsgBoxExBUTTON&quot;) {
            RetVal := StrReplace(A_GuiControl, &quot;&amp;&quot;)
        } Else {
            RetVal := (A_ThisLabel == &quot;MsgBoxExTIMEOUT&quot;) ? &quot;Timeout&quot; : &quot;Cancel&quot;
        }

        If (Owner) {
            WinSet Enable,, ahk_id %Owner%
        }

        Gui Submit
        Gui %hWnd%: Destroy
    Return
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 16 Feb 2020 15:12:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137851#p137851</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137850#p137850</link>
			<description><![CDATA[<p>Это для каких-нибудь системных уведомлений, я б такое не стал в скрипте использовать.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 16 Feb 2020 15:03:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137850#p137850</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137849#p137849</link>
			<description><![CDATA[<p>Заголовок во втором параметре задаётся.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>не пропадает при завершении скрипта.</p></blockquote></div><p>Да, оно принадлежит рабочему столу.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 16 Feb 2020 15:01:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137849#p137849</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137846#p137846</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong>, последний код выдаёт сообщение с заголовком &quot;Ошибка&quot;, которое не пропадает при завершении скрипта.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 16 Feb 2020 14:47:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137846#p137846</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137839#p137839</link>
			<description><![CDATA[<p>Или так:<br /></p><div class="codebox"><pre><code>
Text := clipboard

WTSSendMessage(Text, &quot;&quot;, 0x0, 0, 0)
 
Loop
	MsgBox,,, %A_TickCount%, 0.6
Return

WTSSendMessage(Text, Title := &quot;&quot;, Options := 0, Timeout := 0, Wait := True, Session := -1, Server := 0, ByRef Response := 0) {
    DllCall(&quot;winsta.dll\WinStationSendMessage&quot;
        , &quot;Ptr&quot; , Server
        , &quot;UInt&quot;, Session
        , &quot;Str&quot; , Title
        , &quot;UInt&quot;, StrLen(Title) * 2
        , &quot;Str&quot; , Text
        , &quot;UInt&quot;, StrLen(Text) * 2
        , &quot;UInt&quot;, Options
        , &quot;UInt&quot;, Timeout
        , &quot;Int*&quot;, Response
        , &quot;UInt&quot;, !Wait)

    Return {1: &quot;OK&quot;, 2: &quot;Cancel&quot;, 3: &quot;Abort&quot;, 4: &quot;Retry&quot;, 5: &quot;Ignore&quot;, 6: &quot;Yes&quot;, 7: &quot;No&quot;, 10: &quot;Try Again&quot;, 11: &quot;Continue&quot;, 32000: &quot;Timeout&quot;}[Response]
}	
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 16 Feb 2020 10:55:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137839#p137839</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137837#p137837</link>
			<description><![CDATA[<div class="codebox"><pre><code>
SetTimer, Continue, -111
MsgBox
Continue:
Loop
	MsgBox,,, %A_TickCount%,0.3
Return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 16 Feb 2020 10:36:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137837#p137837</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137833#p137833</link>
			<description><![CDATA[<p>Используйте обычное окно Gui вместо MsgBox.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 15 Feb 2020 13:31:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137833#p137833</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Вывести  msgbox  поверх всех окон не останавливая работу]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137832#p137832</link>
			<description><![CDATA[<p>Всем привет. Необходимо вывести на экран msgbox&nbsp; с заранее скопированным текстом. Но msgbox&nbsp; должен быть поверх всех окон, давая возможность его прочитать, в то время как скрипт продолжает выполняться.<br />Пробовал такие опции, но все равно ждет нажатия кнопки Ок.<br /></p><div class="quotebox"><blockquote><p>MsgBox, 4096,, %clipboard%</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Leone_Galante)]]></author>
			<pubDate>Sat, 15 Feb 2020 10:33:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137832#p137832</guid>
		</item>
	</channel>
</rss>
