<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=415037</guid>
        <pubDate>Thu, 29 Jul 2004 23:25:53 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=415037</link>
        <description><![CDATA[swe: Как двигать окно с помощью мыши при нажатой левой кнопке:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;PMSave : TPoint; &nbsp; &nbsp;(* в PMSave сохраняем абсолютные координаты мыши *)</div><div class="code_line">&nbsp;</div><div class="code_line">procedure Win_Move(h:HWnd);</div><div class="code_line">var dx,dy : integer; r : TRect; PM : TPoint;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;GetCursorPos(PM); &nbsp; &nbsp; &nbsp; &nbsp;(* получить абсолютную текущую позицию мыши *)</div><div class="code_line">&nbsp;&nbsp;dx := PM.X - PMSave.X; dy := PM.Y - PMSave.Y; (* изменения координат *)</div><div class="code_line">&nbsp;&nbsp;if (dx = 0) and (dy = 0) then Exit; &nbsp; (* если нет изменений - выйти &nbsp;*)</div><div class="code_line">&nbsp;&nbsp;PMSave := PM; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(* запомнить текущую позицию мыши &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *)</div><div class="code_line">&nbsp;&nbsp;GetWindowRect(h,r); &nbsp; &nbsp; &nbsp;(* выяснить абсолютные координаты окна &nbsp; &nbsp; &nbsp;*)</div><div class="code_line">&nbsp;&nbsp;SetWindowPos(h,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;HWND_TOP, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(* оставлять перемещаемое окно наверху &nbsp; &nbsp; &nbsp;*)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; r.Left+dx,r.Top+dy, (* новые координаты левого верхнего угла &nbsp; &nbsp;*)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,0, &nbsp; &nbsp; &nbsp; &nbsp;(* ширину и высоту не задаём, т.к. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; SWP_NOSIZE); &nbsp; &nbsp; &nbsp; &nbsp;(* т.к. размер окна не меняем &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *)</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure Win_OnLButtonDown(h:HWnd; var Msg:TWMMouse);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;GetCursorPos(PMSave); (* получить и запомнить абсолютные координаты мыши *)</div><div class="code_line">&nbsp;&nbsp;SetCapture(h); &nbsp; &nbsp; &nbsp; &nbsp;(* &quot;захватить&quot; мышь окном h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*)</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure Win_OnLButtonUp(h:HWnd; var Msg:TWMMouse);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;ReleaseCapture; (* освободить захват мыши окном *)</div><div class="code_line">&nbsp;&nbsp;Win_Move(h); &nbsp; &nbsp;(* последний сдвиг окна &nbsp; &nbsp; &nbsp; &nbsp; *)</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure Win_OnMouseMove(h:HWnd; var Msg:TWMMouse);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if (Msg.Keys and MK_LBUTTON) = 1 &nbsp;(* если удерживается левая кнопка мыши *)</div><div class="code_line">&nbsp;&nbsp;then Win_Move(h); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (* то сдвинуть окно &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*)</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function Win_WindowProc(h: HWnd; AMessage, WParam, LParam: Longint): Longint; stdcall; export;</div><div class="code_line">var aMsg : TMessage absolute AMessage;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Win_WindowProc := 0;</div><div class="code_line">(* &nbsp; инструкция &quot;absolute&quot; позволяет обойтись без присваиваний :</div><div class="code_line">&nbsp;&nbsp;AMsg.Msg &nbsp; &nbsp;:= AMessage;</div><div class="code_line">&nbsp;&nbsp;aMsg.WParam := WParam;</div><div class="code_line">&nbsp;&nbsp;aMsg.LParam := LParam;</div><div class="code_line">&nbsp;&nbsp;aMsg.Result := 0;</div><div class="code_line">*)</div><div class="code_line">&nbsp;&nbsp;case AMessage of</div><div class="code_line">&nbsp;&nbsp; &nbsp;wm_Destroy: begin PostQuitMessage(0); Exit; end;</div><div class="code_line">// &nbsp;wm_Paint &nbsp; &nbsp; &nbsp; : Win_OnPaint &nbsp; &nbsp; &nbsp;(h,TWMPaint(aMsg));</div><div class="code_line">&nbsp;&nbsp; &nbsp;wm_MouseMove &nbsp; : Win_OnMouseMove &nbsp;(h,TWMMouse(aMsg));</div><div class="code_line">&nbsp;&nbsp; &nbsp;wm_LButtonDown : Win_OnLButtonDown(h,TWMMouse(aMsg));</div><div class="code_line">&nbsp;&nbsp; &nbsp;wm_LButtonUp &nbsp; : Win_OnLButtonUp &nbsp;(h,TWMMouse(aMsg));</div><div class="code_line">// &nbsp;wm_KeyDown &nbsp; &nbsp; : Win_OnKeyDown</div><div class="code_line">&nbsp;&nbsp;end; (* case *)</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;Win_WindowProc := DefWindowProc(h, AMessage, WParam, LParam); (* DefaultProc *)</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='8' style='font-size:8pt;'><strong class='tag-b'>Добавлено в <time class="tag-mergetime" datetime="2004-07-30T03:41:24+04:00">29.07.04, 23:41</time></strong>:</span></span><br>
2<strong class='tag-b'>taifun</strong> вместо SetWindowLong я использую CreateWindowEx - см. сообщение #8<br>
<br>
2<strong class='tag-b'>oygan</strong> по поводу сворачивания окна - можно сделать соответствующую обработку на wm_KeyDown.<br>
По поводу кнопочек, я бы сделал так:<br>
- выделил несколько (список) Rect в своём окне, заполнил их нужными картинками, затем при обработке щелчка мыши сравнивал её координаты со списком координат Rect, выдавал номер найденного Rect или -1. Далее, если номер &gt;= 0 вызывал бы по Case нужную функцию.]]></description>
        <author>swe</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=408249</guid>
        <pubDate>Thu, 22 Jul 2004 08:31:36 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=408249</link>
        <description><![CDATA[Mischka: тута нет Application - только чистый Window API]]></description>
        <author>Mischka</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=408241</guid>
        <pubDate>Thu, 22 Jul 2004 08:20:45 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=408241</link>
        <description><![CDATA[taifun: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>P.O.D &#064; 15.07.04, 10:13</span><div class='quote '><strong class='tag-b'>swe</strong>, можно <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">SetWindowLong(Handle, GWL_EXSTYLE, (GetWindowLong(Handle, GWL_EXSTYLE) and (not WS_EX_APPWINDOW)) or WS_EX_TOOLWINDOW);</div></ol></div></div></div></div></div></div><br>
можно так, а еще в коде программы вставить  примерно такую строчку Application.ShowForm:=false]]></description>
        <author>taifun</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=407319</guid>
        <pubDate>Wed, 21 Jul 2004 06:13:09 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=407319</link>
        <description><![CDATA[Mischka: Вопрос, в общем-то, продолжает тему. Но лучше все-таки создать отдельную ;) <strong class='tag-b'>ZEE</strong> прав.]]></description>
        <author>Mischka</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=407304</guid>
        <pubDate>Wed, 21 Jul 2004 06:00:49 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=407304</link>
        <description><![CDATA[ZEE: <strong class='tag-b'>oygan</strong> - задавай вопросы в отдельной теме  :rulez:]]></description>
        <author>ZEE</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=407276</guid>
        <pubDate>Wed, 21 Jul 2004 05:36:52 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=407276</link>
        <description><![CDATA[oygan: Как создать класс содержащий в себе процедуры открытия различных окон.<br><br>Ещё , охото иметь &quot;продвинутое&quot; окно , которо можно двигать , сворачивать и с кнопочками :).<br><br>С уважением ,]]></description>
        <author>oygan</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=406315</guid>
        <pubDate>Mon, 19 Jul 2004 23:46:33 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=406315</link>
        <description><![CDATA[swe: Итак, резюме:<br>
<br>
Чтобы получить самое простое (по виду похожее на Label) окно прямо на рабочем столе, чтобы при этом не появилась кнопка в TaskBar&#39;е нужно:<br>
<br>
вместо CreateWindow использовать CreateWindowEx, где первый параметр - расширенный стиль окна должен быть <br>
WS_EX_TOOLWINDOW (чтобы не было кнопки на панели задач). Стиль окна должен быть (должен включать) WS_POPUP, чтобы окно было без заголовка и, кроме того, родительским окном должна быть переменная типа HWnd полученная с помощью функции GetDesktopWindow <br>
<br>
вот пример кода:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;hMyWnd &nbsp; &nbsp; &nbsp;: HWnd; &nbsp; (* наше простое окно &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*) </div><div class="code_line">&nbsp;&nbsp;hWndDeskTop : HWnd; &nbsp; (* окно DeskTop - родительское для нашего *)</div><div class="code_line">&nbsp;&nbsp;WinClassNm &nbsp;: string; (* имя оконного класса &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*)</div><div class="code_line">//...</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;hWndDeskTop := GetDesktopWindow;</div><div class="code_line">&nbsp;&nbsp;WinClassNm &nbsp;:= &#39;STATIC&#39;; &nbsp;(* это класс для Label либо надо зарегистрировать свой класс *) &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;hMyWnd :=</div><div class="code_line">&nbsp;&nbsp;CreateWindowEx(</div><div class="code_line">&nbsp;&nbsp; WS_EX_TOOLWINDOW, &nbsp;// &nbsp;- чтобы не было кнопки на панели задач</div><div class="code_line">&nbsp;&nbsp; WinClassNm, &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;- имя оконного класса</div><div class="code_line">&nbsp;&nbsp; &#39;&#39;, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;- имя окна</div><div class="code_line">(* стиль окна *)</div><div class="code_line">&nbsp;&nbsp; WS_POPUP or &nbsp; &nbsp; &nbsp; &nbsp;// 00 0000 &nbsp; &nbsp;- без заголовка окна</div><div class="code_line">&nbsp;&nbsp; WS_BORDER, &nbsp; &nbsp; &nbsp; &nbsp; // {text}80 0000 &nbsp; &nbsp;- тоненькая граница цвета Border</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; 0, &nbsp; &nbsp; 0, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// x0 &nbsp; , y0</div><div class="code_line">&nbsp;&nbsp; 300, 100, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// width, height</div><div class="code_line">&nbsp;&nbsp; hWndDeskTop, &nbsp; &nbsp; &nbsp; // hParentWindow,</div><div class="code_line">&nbsp;&nbsp; 0, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // hMenu</div><div class="code_line">&nbsp;&nbsp; hInstance, &nbsp; &nbsp; &nbsp; &nbsp; // глобальная переменная модуля SysInit</div><div class="code_line">&nbsp;&nbsp; Nil );</div><div class="code_line">end;</div></ol></div></div></div></div>]]></description>
        <author>swe</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=403069</guid>
        <pubDate>Thu, 15 Jul 2004 07:13:22 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=403069</link>
        <description><![CDATA[P.O.D: <strong class='tag-b'>swe</strong>, можно <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">SetWindowLong(Handle, GWL_EXSTYLE, (GetWindowLong(Handle, GWL_EXSTYLE) and (not WS_EX_APPWINDOW)) or WS_EX_TOOLWINDOW);</div></ol></div></div></div></div>]]></description>
        <author>P.O.D</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=403053</guid>
        <pubDate>Thu, 15 Jul 2004 06:56:38 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=403053</link>
        <description><![CDATA[ZEE: тада надо сделать одно окошко на Десктопе и сделать его не видимым - т.е. без WS_VISIBLE, потом другое у кот. hWndParent = первому окошку, а стили = WS_POPUP or WS_VISIBLE - думаю так <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='8' style='font-size:8pt;'><strong class='tag-b'>Добавлено в <time class="tag-mergetime" datetime="2004-07-15T06:59:04+00:00">15.07.04, 06:59</time></strong>:</span></span><br>
хотя щас подумал о др. варианте:<br>
можно попробывать вместо WS_POPUP поставить WS_CHILD<br>
но я такой способ не проверял...]]></description>
        <author>ZEE</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=403029</guid>
        <pubDate>Thu, 15 Jul 2004 05:57:24 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=403029</link>
        <description><![CDATA[swe: 2<strong class='tag-b'>ZEE</strong> спасибо, всё работает. Только на ТаскБаре при запуске такого окошка появляется кнопка (которая позволяет сделать окно активным). Можно ли сделать так, чтобы этой кнопки не было?]]></description>
        <author>swe</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402066</guid>
        <pubDate>Wed, 14 Jul 2004 06:01:48 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402066</link>
        <description><![CDATA[ZEE: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>swe</strong>, 14.07.04, 07:59<br>
нужно задать какие-то правильные параметры в CreateWindow. </div></div><br>
dwStyle = WS_POPUP<br>
размеры и положение = по своему усмотрению :) <br>
hWndParent = GetDesktopWindow<br>
...]]></description>
        <author>ZEE</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402035</guid>
        <pubDate>Wed, 14 Jul 2004 04:59:23 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402035</link>
        <description><![CDATA[swe: нужно задать какие-то правильные параметры в CreateWindow. Какаие именно - никак не пойму.<br>(И нужно выбрать правильный WindowClass.)<br>Label собственно мне не нужна]]></description>
        <author>swe</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402029</guid>
        <pubDate>Wed, 14 Jul 2004 04:40:07 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402029</link>
        <description><![CDATA[p_kolya: Ну сделать BorderStyle:=bsNone; - для окна... так тебе label или окно на рабочем столе надо?<br>Если label, то натянуть какоу-нить label на это окно, поставить Align:=alClient; вроде все...:)]]></description>
        <author>p_kolya</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402023</guid>
        <pubDate>Wed, 14 Jul 2004 04:15:37 +0000</pubDate>
        <title>Label на Рабочем Столе</title>
        <link>https://forum.sources.ru/index.php?showtopic=59733&amp;view=findpost&amp;p=402023</link>
        <description><![CDATA[swe: Как сделать окно без заголовка (гольный Canvas) не на форме, а прямо на рабочем столе?<br>(типа как WinAmp делает, или как окошечки хинтов)]]></description>
        <author>swe</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      </channel>
      </rss>
	