<?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=194486&amp;view=findpost&amp;p=1630009</guid>
        <pubDate>Tue, 10 Jul 2007 05:44:22 +0000</pubDate>
        <title>Скрыть заголовок окна</title>
        <link>https://forum.sources.ru/index.php?showtopic=194486&amp;view=findpost&amp;p=1630009</link>
        <description><![CDATA[varzind: Думаю такой способ будет лучше, так как у тебя будет при этом видна программа в панели задач, т.е. ты сможешь сворачивать форму и разворачивать как обычную...<br>
<br>
Создай обычную форму, со свойствами:<br>
<br>
 BorderStyle = vbSizable <br>
 ClipControls = True<br>
 ControlBox = True, вобщем обычная форма, такая какая создается при создании стандартной формы.<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">Option Explicit</div><div class="code_line">&nbsp;</div><div class="code_line">&#39;varzind — http://forum.sources.ru/index.php?showuser=46547</div><div class="code_line">&#39;10/07/2007</div><div class="code_line">&#39;http://forum.sources.ru/index.php?showtopic=194292&amp;st=10</div><div class="code_line">&nbsp;</div><div class="code_line">Private Const GWL_STYLE = (-16)</div><div class="code_line">Private Const WS_SYSMENU = &amp;H80000</div><div class="code_line">Private Const WS_MAXIMIZEBOX = &amp;H10000</div><div class="code_line">Private Const WS_MINIMIZEBOX = &amp;H20000</div><div class="code_line">Private Const WS_CAPTION = &amp;HC00000</div><div class="code_line">Private Const SWP_FRAMECHANGED = &amp;H20</div><div class="code_line">Private Const SWP_NOREPOSITION = &amp;H200</div><div class="code_line">Private Const SWP_NOZORDER = &amp;H4</div><div class="code_line">&nbsp;</div><div class="code_line">Private Type RECT</div><div class="code_line">&nbsp;&nbsp;Left As Long</div><div class="code_line">&nbsp;&nbsp;Top As Long</div><div class="code_line">&nbsp;&nbsp;Right As Long</div><div class="code_line">&nbsp;&nbsp;Bottom As Long</div><div class="code_line">End Type</div><div class="code_line">&nbsp;</div><div class="code_line">Private Declare Function SetWindowLong Lib &quot;user32&quot; Alias &quot;SetWindowLongA&quot; _</div><div class="code_line">&nbsp;&nbsp;(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long</div><div class="code_line">Private Declare Function GetWindowLong Lib &quot;user32&quot; Alias &quot;GetWindowLongA&quot; _</div><div class="code_line">&nbsp;&nbsp;(ByVal hwnd As Long, ByVal nIndex As Long) As Long</div><div class="code_line">Private Declare Function SetWindowPos Lib &quot;user32&quot; (ByVal hwnd As Long, _</div><div class="code_line">&nbsp;&nbsp;ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _</div><div class="code_line">&nbsp;&nbsp;ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long</div><div class="code_line">Private Declare Function GetWindowRect Lib &quot;user32&quot; (ByVal hwnd As Long, _</div><div class="code_line">&nbsp;&nbsp;lpRect As RECT) As Long</div><div class="code_line">&nbsp;</div><div class="code_line">Public Function ShowTitleBar(ByVal frmForm As Form, ByVal bState As Boolean)</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#39;On Error Resume Next</div><div class="code_line">&nbsp;&nbsp; &nbsp;Dim lStyle As Long</div><div class="code_line">&nbsp;&nbsp; &nbsp;Dim tR As RECT</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;GetWindowRect frmForm.hwnd, tR</div><div class="code_line">&nbsp;&nbsp; &nbsp;lStyle = GetWindowLong(frmForm.hwnd, GWL_STYLE)</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;If (bState) Then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;frmForm.Caption = frmForm.Tag</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;If frmForm.ControlBox Then lStyle = lStyle Or WS_SYSMENU</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;If frmForm.MaxButton Then lStyle = lStyle Or WS_MAXIMIZEBOX</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;If frmForm.MinButton Then lStyle = lStyle Or WS_MINIMIZEBOX</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;If frmForm.Caption = vbNullString Then lStyle = lStyle Or WS_CAPTION</div><div class="code_line">&nbsp;&nbsp; &nbsp;Else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;frmForm.Tag = frmForm.Caption</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;frmForm.Caption = vbNullString</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lStyle = lStyle And Not WS_SYSMENU</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lStyle = lStyle And Not WS_MAXIMIZEBOX</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lStyle = lStyle And Not WS_MINIMIZEBOX</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;lStyle = lStyle And Not WS_CAPTION</div><div class="code_line">&nbsp;&nbsp; &nbsp;End If</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;Call SetWindowLong(frmForm.hwnd, GWL_STYLE, lStyle)</div><div class="code_line">&nbsp;&nbsp; &nbsp;Call SetWindowPos(frmForm.hwnd, 0, tR.Left, tR.Top, tR.Right - tR.Left, tR.Bottom - tR.Top, _</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;SWP_NOREPOSITION Or SWP_NOZORDER Or SWP_FRAMECHANGED)</div><div class="code_line">&nbsp;&nbsp; &nbsp;Call frmForm.Refresh</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">End Function</div><div class="code_line">&nbsp;</div><div class="code_line">Public Sub HideWindowCaption(frm As Form)</div><div class="code_line">&nbsp;&nbsp;Call ShowTitleBar(frm, False)</div><div class="code_line">&nbsp;&nbsp;Call ShowTitleBar(frm, True)</div><div class="code_line">End Sub</div><div class="code_line">&nbsp;</div><div class="code_line">Private Sub Form_Load()</div><div class="code_line">&nbsp;&nbsp;Call HideWindowCaption(Me)</div><div class="code_line">End Sub</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>varzind</author>
        <category>Формы, окна, диалоги, десктоп</category>
      </item>
	
      </channel>
      </rss>
	