<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Вставка изображения из буфера обмена в Gui]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13006&amp;type=atom" />
	<updated>2017-09-17T10:18:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13006</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вставка изображения из буфера обмена в Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119390#p119390" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
#SingleInstance Force
#NoEnv

Gui, Margin, 0, 0
Gui, Add, Pic, x0 y0 vPic
Gosub, PicView

1::
PicView:
	if !hBitmap := hBitmapFromClipboard(Width)
		Return
	GuiControl, , Pic, % &quot;*w&quot; Width &quot; *h-1 HBITMAP:*&quot; hBitmap
	Gui, Show, AutoSize
	GuiControl, +Redraw, Pic
	Return
	
hBitmapFromClipboard(Byref Width) {
	Static Ptr := A_PtrSize = 8 ? &quot;UPtr&quot; : &quot;UInt&quot;
	if !DllCall(&quot;OpenClipboard&quot;, Ptr, 0)
		Return 0
	if !DllCall(&quot;IsClipboardFormatAvailable&quot;, &quot;UInt&quot;, 8)
		Return 0, DllCall(&quot;CloseClipboard&quot;)
	if !hBitmap := DllCall(&quot;GetClipboardData&quot;, &quot;UInt&quot;, 2, Ptr)
		Return 0, DllCall(&quot;CloseClipboard&quot;)
	DllCall(&quot;CloseClipboard&quot;)
	DllCall(&quot;gdiplus\GdipCreateBitmapFromHBITMAP&quot;, Ptr, hBitmap, Ptr, 0, Ptr &quot;*&quot;, pBitmap)
	DllCall(&quot;DeleteObject&quot;, Ptr, hBitmap)
	DllCall(&quot;gdiplus\GdipGetImageWidth&quot;, Ptr, pBitmap, &quot;UInt*&quot;, Width)
	DllCall(&quot;gdiplus\GdipDisposeImageAttributes&quot;, Ptr, pBitmap)
	Return hBitmap
}

GuiClose:
GuiEscape:
	ExitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-09-17T10:18:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119390#p119390</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вставка изображения из буфера обмена в Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119378#p119378" />
			<content type="html"><![CDATA[<p>Нашел код teadrinker-a , спасибо тебе что ты есть)<br /></p><div class="codebox"><pre><code>DetectHiddenWindows, On
Send, {PRINTSCREEN}
FileAppend,, %A_ScriptDir%\PrScr.bmp
Run, mspaint %A_ScriptDir%\PrScr.bmp,, Hide
WinWait, PrScr.bmp - Paint
PostMessage, 0x111, 57637, 0, , PrScr.bmp - Paint
PostMessage, 0x111, 57603, 0, , PrScr.bmp - Paint
PostMessage, 0x111, 57665, 0, , PrScr.bmp - Paint
WinWaitClose, PrScr.bmp - Paint
gui,add,pic,x0 y0,%A_ScriptDir%\PrScr.bmp
FileDelete,%A_ScriptDir%\PrScr.bmp
gui,show
return

GuiClose:
GuiEscape:
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[shahlik002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=37352</uri>
			</author>
			<updated>2017-09-16T09:11:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119378#p119378</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Вставка изображения из буфера обмена в Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119377#p119377" />
			<content type="html"><![CDATA[<p>Как?))</p>]]></content>
			<author>
				<name><![CDATA[shahlik002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=37352</uri>
			</author>
			<updated>2017-09-16T08:59:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119377#p119377</id>
		</entry>
</feed>
