Модераторы: Akina
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Как отобразить веб-страницу на форме без ActiveX? 
:(
    Опции темы
cardinal
Дата 18.6.2007, 02:56 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Инженер
****


Профиль
Группа: Экс. модератор
Сообщений: 6003
Регистрация: 26.3.2002
Где: Германия

Репутация: 19
Всего: 99



Все очень просто:
Код

Option Explicit

Private Declare Function AtlAxWinInit Lib "atl.dll" () As Long
Private Declare Function CreateWindowExA Lib "user32" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As 
String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, 
ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long

Private Sub Form_Load()
Call AtlAxWinInit
Call CreateWindowExA(0, "AtlAxWin", "http://forum.sources.ru", WS_VISIBLE Or WS_CHILE, 0, 0, 640, 480, Me.hWnd, 0, App.hInstance, 0&)
End Sub

И на форме появится страница форума. ;)

Или хотим показать "Мой компьютер" у себя на форме? Нет ничего проще:
Код

Option Explicit

Private Declare Function AtlAxWinInit Lib "atl.dll" () As Long
Private Declare Function CreateWindowExA Lib "user32" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As 
String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, 
ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long

Private Sub Form_Load()
Call AtlAxWinInit
Call CreateWindowExA(0, "AtlAxWin", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", &H50000000, 0, 0, 640, 480, Me.hWnd, 0, App.hInstance, 
0&)

End Sub

А вот этот код показывает "Панель управления":
Код

Option Explicit

Private Declare Function AtlAxWinInit Lib "atl.dll" () As Long
Private Declare Function CreateWindowExA Lib "user32" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As 
String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, 
ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long

Private Sub Form_Load()
Call AtlAxWinInit
Call CreateWindowExA(0, "AtlAxWin", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", &H50000000, 0, 
0, 640, 480, Me.hWnd, 0, App.hInstance, 0&)

End Sub

И т.д., пока фантазия не кончится. smile

Автор: ALXR
Взято на: http://forum.sources.ru


--------------------
Немецкая оппозиция потребовала упростить натурализацию иммигрантов
В моем блоге: Разные истории из жизни в Германии

"Познание бесконечности требует бесконечного времени, а потому работай не работай - все едино".  А. и Б. Стругацкие
PM   Вверх
Iww
Дата 26.9.2008, 12:35 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 22
Регистрация: 2.4.2008

Репутация: нет
Всего: нет



WS_VISIBLE не определяет. Наверно нада его продекларировать ?
PM MAIL   Вверх
Akina
Дата 26.9.2008, 13:41 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Советчик
****


Профиль
Группа: Модератор
Сообщений: 20581
Регистрация: 8.4.2004
Где: Зеленоград

Репутация: 34
Всего: 454



Вообще неплохо бы не забывать вызывать AtlAxWinTerm() по завершении работы. В Form_Unload().

Цитата(Iww @  26.9.2008,  13:35 Найти цитируемый пост)
WS_VISIBLE не определяет. Наверно нада его продекларировать ? 

Цитата

Window Styles
WS_BORDER   Creates a window that has a border.
WS_CAPTION   Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style.
WS_CHILD   Creates a child window. Cannot be used with the WS_POPUP style.
WS_CLIPCHILDREN   Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window.
WS_CLIPSIBLINGS   Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGS style clips all other overlapped child windows out of the region of the child window to be updated. (If WS_CLIPSIBLINGS is not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with the WS_CHILD style only.
WS_DISABLED   Creates a window that is initially disabled.
WS_DLGFRAME   Creates a window with a double border but no title.
WS_GROUP   Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All controls defined with the WS_GROUP style FALSE after the first control belong to the same group. The next control with the WS_GROUP style starts the next group (that is, one group ends where the next begins).
WS_HSCROLL   Creates a window that has a horizontal scroll bar.
WS_MAXIMIZE   Creates a window of maximum size.
WS_MAXIMIZEBOX   Creates a window that has a Maximize button.
WS_MINIMIZE   Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only.
WS_MINIMIZEBOX   Creates a window that has a Minimize button.
WS_OVERLAPPED   Creates an overlapped window. An overlapped window usually has a caption and a border.
WS_OVERLAPPEDWINDOW   Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles.
WS_POPUP   Creates a pop-up window. Cannot be used with the WS_CHILD style.
WS_POPUPWINDOW   Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.
WS_SYSMENU   Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars.
WS_TABSTOP   Specifies one of any number of controls through which the user can move by using the TAB key. The TAB key moves the user to the next control specified by the WS_TABSTOP style.
WS_THICKFRAME   Creates a window with a thick frame that can be used to size the window.
WS_VISIBLE   Creates a window that is initially visible.
WS_VSCROLL   Creates a window that has a vertical scroll bar. 

   WS_CLIPSIBLINGS      0x04000000
   WS_CLIPCHILDREN      0x02000000
   WS_VISIBLE           0x10000000
   WS_DISABLED          0x08000000
   WS_MINIMIZE          0x20000000
   WS_MAXIMIZE          0x01000000
   WS_CAPTION           0x00C00000
   WS_BORDER            0x00800000
   WS_DLGFRAME          0x00400000
   WS_VSCROLL           0x00200000
   WS_HSCROLL           0x00100000
   WS_SYSMENU           0x00080000
   WS_THICKFRAME        0x00040000
   WS_MINIMIZEBOX       0x00020000
   WS_MAXIMIZEBOX       0x00010000 



--------------------
 О(б)суждение моих действий - в соответствующей теме, пожалуйста. Или в РМ. И высшая инстанция - Администрация форума.

PM MAIL WWW ICQ Jabber   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "VB6"
Akina

Запрещается!

1. Публиковать ссылки на вскрытые компоненты

2. Обсуждать взлом компонентов и делиться вскрытыми компонентами

  • Литературу по VB обсуждаем здесь
  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы по реализации алгоритмов рассматриваются здесь
  • Используйте теги [code=vb][/code] для подсветки кода. Используйтe чекбокс "транслит" (возле кнопок кодов) если у Вас нет русских шрифтов.


Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Akina.

 
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | VB6 | Следующая тема »


 




[ Время генерации скрипта: 0.1083 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.