-
Notifications
You must be signed in to change notification settings - Fork 0
/
vk_com_api_auth_browser_dlg.cpp
48 lines (40 loc) · 1.23 KB
/
vk_com_api_auth_browser_dlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "stdafx.h"
#include "vk_com_api.h"
namespace
{
CComModule g_module;
class myinitquit : public initquit
{
void on_init () override { g_module.Init (NULL, NULL, &LIBID_ATLLib); }
void on_quit () override { g_module.Term (); }
};
initquit_factory_t<myinitquit> g_initquit;
cfgDialogPosition g_dlg_pos (vk_com_api::externals::guid_browser_dlg_cfg);
}
namespace vk_com_api
{
void browser_dialog::on_init_dialog ()
{
DlgResize_Init (true, false);
g_dlg_pos.AddWindow (*this);
// Query IWebBrowser2 interface
CAxWindow ie = GetDlgItem (IDC_IE);
if (ie.IsWindow () != TRUE || ie.QueryControl (&m_wb2) != S_OK)
close ();
else {
SetWindowText (pfc::stringcvt::string_os_from_utf8 (m_title));
navigate (m_inital_location);
ShowWindow (SW_SHOWNORMAL);
}
}
void browser_dialog::on_destroy ()
{
g_dlg_pos.RemoveWindow (*this);
if (m_wb2) m_wb2.Release ();
}
void __stdcall browser_dialog::on_navigate_complete2 (IDispatch*, VARIANT *p_url)
{
m_current_location = pfc::stringcvt::string_utf8_from_os (p_url->bstrVal);
m_callback (this);
}
}