
![]() |
Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
|
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.97.9.175] |
![]() |
|
Сообщ.
#1
,
|
|
|
Думаю такой способ будет лучше, так как у тебя будет при этом видна программа в панели задач, т.е. ты сможешь сворачивать форму и разворачивать как обычную...
Создай обычную форму, со свойствами: BorderStyle = vbSizable ClipControls = True ControlBox = True, вобщем обычная форма, такая какая создается при создании стандартной формы. Далее добавь обычный модуль и впиши в него следующий код: ![]() ![]() Option Explicit 'varzind — http://forum.sources.ru/index.php?showuser=46547 '10/07/2007 'http://forum.sources.ru/index.php?showtopic=194292&st=10 Private Const GWL_STYLE = (-16) Private Const WS_SYSMENU = &H80000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_CAPTION = &HC00000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOREPOSITION = &H200 Private Const SWP_NOZORDER = &H4 Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _ ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _ lpRect As RECT) As Long Public Function ShowTitleBar(ByVal frmForm As Form, ByVal bState As Boolean) 'On Error Resume Next Dim lStyle As Long Dim tR As RECT GetWindowRect frmForm.hwnd, tR lStyle = GetWindowLong(frmForm.hwnd, GWL_STYLE) If (bState) Then frmForm.Caption = frmForm.Tag If frmForm.ControlBox Then lStyle = lStyle Or WS_SYSMENU If frmForm.MaxButton Then lStyle = lStyle Or WS_MAXIMIZEBOX If frmForm.MinButton Then lStyle = lStyle Or WS_MINIMIZEBOX If frmForm.Caption = vbNullString Then lStyle = lStyle Or WS_CAPTION Else frmForm.Tag = frmForm.Caption frmForm.Caption = vbNullString lStyle = lStyle And Not WS_SYSMENU lStyle = lStyle And Not WS_MAXIMIZEBOX lStyle = lStyle And Not WS_MINIMIZEBOX lStyle = lStyle And Not WS_CAPTION End If Call SetWindowLong(frmForm.hwnd, GWL_STYLE, lStyle) Call SetWindowPos(frmForm.hwnd, 0, tR.Left, tR.Top, tR.Right - tR.Left, tR.Bottom - tR.Top, _ SWP_NOREPOSITION Or SWP_NOZORDER Or SWP_FRAMECHANGED) Call frmForm.Refresh End Function Public Sub HideWindowCaption(frm As Form) Call ShowTitleBar(frm, False) Call ShowTitleBar(frm, True) End Sub Private Sub Form_Load() Call HideWindowCaption(Me) End Sub |