Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_EX_APPWINDOW = &H40000
Const GWL_EXSTYLE = (-20)
Const SW_HIDE = 0
Const SW_NORMAL = 1
Dim ret&
....
Private Sub Command1_Click()
ShowWindow frmNew.hwnd, SW_HIDE
ret = GetWindowLong(frmNew.hwnd, GWL_EXSTYLE)
SetWindowLong frmNew.hwnd, GWL_EXSTYLE, ret Or S_EX_APPWINDOW
ShowWindow frmNew.hwnd, SW_NORMAL
End Sub
Для показа окна:
Old:=GetWindowLong(Application.Handle,GWL_EXSTYLE);
SetWindowLong (Application.Handle,GWL_EXSTYLE,Old or WS_EX_APPWINDOW)
Это можно сделать в любом!!! месте программы. Для любых!!! форм.
ZlydenGL писал(а):Может быть все же у кого-нибудь остался исходник? А то у меня похоже лыжи не едутъ
Пишу в коде:Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_EX_APPWINDOW = &H40000
Const GWL_EXSTYLE = (-20)
Const SW_HIDE = 0
Const SW_NORMAL = 1
Dim ret&
....
Private Sub Command1_Click()
ShowWindow frmNew.hwnd, SW_HIDE
ret = GetWindowLong(frmNew.hwnd, GWL_EXSTYLE)
SetWindowLong frmNew.hwnd, GWL_EXSTYLE, ret Or S_EX_APPWINDOW
ShowWindow frmNew.hwnd, SW_NORMAL
End Sub
Код выполняется без единой ошибки - но окно не становится таким, какое мне нужно PLEASE, HELP!!!
Option Explicit
...
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_EX_APPWINDOW = &H40000
...
SetWindowLong frmEditNew.hWnd, GWL_EXSTYLE, ret Or WS_EX_APPWINDOW
Option Explicit
Private Declare Function SetWindowPos Lib "user32.dll" (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 Const SWP_FRAMECHANGED As Long = &H20
Private Const SWP_NOACTIVATE As Long = &H10
Private Const SWP_NOMOVE As Long = &H2
Private Const SWP_NOOWNERZORDER As Long = &H200
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_NOZORDER As Long = &H4
Private Sub Command1_Click()
SetWindowPos Me.hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOACTIVATE Or SWP_NOMOVE Or SWP_NOOWNERZORDER Or SWP_NOSIZE
End Sub
ShowWindow Me.hwnd, SW_HIDE
Ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW 'Ret Or WS_EX_APPWINDOW
ShowWindow Me.hwnd, SW_NORMAL
SetWindowLong Me.hwnd, GWL_EXSTYLE, Ret Or WS_EX_APPWINDOW
Application.Windows(TaskButtons.SelectedItem.Index - 1).Activate
SetForegroundWindow ReportWindows(TaskButtons.SelectedItem.Index)
ShowWindow ReportWindows(TaskButtons.SelectedItem.Index), 10
Forms(TaskButtons.SelectedItem.Index + 1).Show
Сейчас этот форум просматривают: Google-бот и гости: 181