WebBrowser & XPStyle

Создание, использование компонентов ActiveX
Alexanbar
Продвинутый гуру
Продвинутый гуру
Аватара пользователя
 
Сообщения: 1727
Зарегистрирован: 13.04.2004 (Вт) 23:04
Откуда: Волгоградская обл.

WebBrowser & XPStyle

Сообщение Alexanbar » 15.03.2005 (Вт) 2:21

Открыл я как-то одну страничку с кнопками с помощью своей формы, на которой есть webbrowser (нужно ответить на вопрос Да/нет). Потом эту же страницу открыл в Internet Explorer.

Разница была в том, что в последнем случае кнопки соответствовали теме, установленной в Windows XP, чего и мне в своей программе хотелось бы.

Манифест у меня есть. Форма с webbrowser-ом загружается по мере необходимости.

GSerg
Шаман
Шаман
 
Сообщения: 14286
Зарегистрирован: 14.12.2002 (Сб) 5:25
Откуда: Магадан

Сообщение GSerg » 15.03.2005 (Вт) 5:25

(глупый вопрос, но на всякий случай)

А initcommoncontrolsex делаешь? :)
Как только вы переберёте все варианты решения и не найдёте нужного, тут же обнаружится решение, простое и очевидное для всех, кроме вас

Alexanbar
Продвинутый гуру
Продвинутый гуру
Аватара пользователя
 
Сообщения: 1727
Зарегистрирован: 13.04.2004 (Вт) 23:04
Откуда: Волгоградская обл.

Сообщение Alexanbar » 15.03.2005 (Вт) 18:23

Да вроде делаю. Может быть, параметры не те:

sub main
.....
Dim iccex As tagInitCommonControlsEx
With iccex
.lngSize = LenB(iccex)
.lngICC = ICC_USEREX_CLASSES
End With

Call InitCommonControlsEx(iccex)

....

end sub


А адрес странички вот: http://songkino.ru/other/sp_mp.html

Alexanbar
Продвинутый гуру
Продвинутый гуру
Аватара пользователя
 
Сообщения: 1727
Зарегистрирован: 13.04.2004 (Вт) 23:04
Откуда: Волгоградская обл.

Сообщение Alexanbar » 15.03.2005 (Вт) 21:51

Как говорится, кто ищет, тот всегда (или почти всегда) найдёт:

Private m_hMod As Long
Private m_hMod2 As Long
Private Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As tagInitCommonControlsEx) As Boolean
Private Type tagInitCommonControlsEx
lngSize As Long
lngICC As Long
End Type
Private Const ICC_USEREX_CLASSES = &H200

Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long

Private Sub Form_Initialize()
Dim iccex As tagInitCommonControlsEx
iccex.lngSize = LenB(iccex)
iccex.lngICC = ICC_USEREX_CLASSES
InitCommonControlsEx iccex

m_hMod = LoadLibrary("shell32.dll")
m_hMod2 = LoadLibrary("explorer.exe")
End Sub

Private Sub Form_Load()
WebBrowser1.Navigate2 "http://www.google.com/"
End Sub

Private Sub Form_Terminate()
If m_hMod Then FreeLibrary m_hMod
If m_hMod2 Then FreeLibrary m_hMod2
End Sub


Т.е. основная идея - загрузить explorer.exe.

hCORe
VB - Экстремал
VB - Экстремал
Аватара пользователя
 
Сообщения: 2332
Зарегистрирован: 22.02.2003 (Сб) 15:21
Откуда: parent directory

Сообщение hCORe » 15.03.2005 (Вт) 21:55

MSDN писал(а):Using Visual Styles with HTML Content

There are many applications, written in HTML and deployed as an HTML Application (HTA) or a Win32 application, that use HTML or host the WebObject in their UI elements. When running on Windows XP, these applications can have the same look that is consistent with Win32-based applications running on the same operating system. The following are some considerations when applying visual styles to HTML content.

Visual styles in relation to HTML content applies only to Intrinsic HTML Controls such as buttons, scrollbars, and select controls. The Windows XP visual style is applied automatically to controls on HTML pages. If you do not want your page to have a visual style applied, use the META tag with its attribute set to NO. The META tag is documented in a following section.
HTML pages that modify the Cascading Style Sheets (CSS) properties such as background or border do not have a visual style applied to them. They display the specified CSS attribute.
When specified as part of the content, most CSS properties do apply to elements that have visual styles applied.
You must add a metatag to the <head> section of your pages. You need to add this tag only once; visual styles apply it to all the page content. This also applies to content packaged as HTAs. The metatag must be as follows:
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
Be aware that visual styles might change the layout of your content. Also, if you set certain attributes on Intrinsic HTML Controls, such as the width of a button, you might find that the label on the button is unreadable under certain visual styles.
You must thoroughly test your content using visual styles to determine whether applying visual styles has an adverse impact on your content and layout. Make any changes required to make your content work successfully.


(см. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp)
Моду создают модоки, а распространяют модозвоны.

Alexanbar
Продвинутый гуру
Продвинутый гуру
Аватара пользователя
 
Сообщения: 1727
Зарегистрирован: 13.04.2004 (Вт) 23:04
Откуда: Волгоградская обл.

Сообщение Alexanbar » 16.03.2005 (Ср) 0:11

Вопрос был не в том, как создавать web-страницы, а как правильно отобразить уже созданные с учётом замечания hcore.

Если не писать строку LoadLibrary("explorer.exe") , страницы, созданные с поддержкой визуальных стилей, отображаются как обычные.


Вернуться в Компоненты

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1

    TopList