Skip to content

Commit

Permalink
Renamed demoform.* to lsactivedesktop.* and renamed TWebf to WebForm
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Sep 6, 2010
1 parent b996564 commit 61fd106
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions LSActiveDesktop.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\demoform.cpp"
RelativePath=".\lsactivedesktop.cpp"
>
</File>
<File
Expand Down Expand Up @@ -250,7 +250,7 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\demoform.h"
RelativePath=".\lsactivedesktop.h"
>
</File>
<File
Expand Down
2 changes: 1 addition & 1 deletion demoform.cpp → lsactivedesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <windows.h>
#include "lsadsettings.h"
#include "webform.h"
#include "demoform.h"
#include "lsactivedesktop.h"
#include <tchar.h>
#include <map>
#include <string>
Expand Down
File renamed without changes.
50 changes: 25 additions & 25 deletions webform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#include "TOleClientSite.h"
#include "toleinplaceframe.h"

TWebf::TWebf(WebformDispatchHandler *wdh) :
WebForm::WebForm(WebformDispatchHandler *wdh) :
ref(1), ibrowser(NULL), cookie(0), isnaving(0), url(NULL), kurl(NULL),
hasScrollbars(false), hhost(NULL), hWnd(NULL), dispatchHandler(wdh)
{
}

void TWebf::setupOle()
void WebForm::setupOle()
{
RECT rc;
GetClientRect(hhost, &rc);
Expand Down Expand Up @@ -75,7 +75,7 @@ void TWebf::setupOle()
iole->Release();
}

void TWebf::Close()
void WebForm::Close()
{
if (ibrowser != 0) {
IConnectionPointContainer *cpc = 0;
Expand Down Expand Up @@ -105,7 +105,7 @@ void TWebf::Close()
}
}

TWebf::~TWebf()
WebForm::~WebForm()
{
if (url != 0) {
delete[] url;
Expand Down Expand Up @@ -144,7 +144,7 @@ char *BSTRToLPSTR(BSTR bStr, LPSTR lpstr)
return lpstr;
}

void TWebf::Go(const TCHAR *url)
void WebForm::Go(const TCHAR *url)
{
if (url == NULL || ibrowser == NULL) {
return;
Expand All @@ -167,7 +167,7 @@ void TWebf::Go(const TCHAR *url)
isnaving &= ~4;
}

IHTMLDocument2 *TWebf::GetDoc()
IHTMLDocument2 *WebForm::GetDoc()
{
IDispatch *dispatch = 0;
ibrowser->get_Document(&dispatch);
Expand All @@ -183,7 +183,7 @@ IHTMLDocument2 *TWebf::GetDoc()
return doc;
}

void TWebf::RunJSFunction(std::string cmd)
void WebForm::RunJSFunction(std::string cmd)
{
IHTMLDocument2 *doc = GetDoc();
IHTMLWindow2 *win = NULL;
Expand All @@ -206,7 +206,7 @@ void TWebf::RunJSFunction(std::string cmd)
doc->Release();
}

void TWebf::DocumentComplete(const wchar_t *)
void WebForm::DocumentComplete(const wchar_t *)
{
isnaving &= ~2;

Expand All @@ -218,7 +218,7 @@ void TWebf::DocumentComplete(const wchar_t *)
PostMessage(GetParent(hhost), WM_COMMAND, w, (LPARAM)hhost);
}

HRESULT STDMETHODCALLTYPE TWebf::QueryInterface(REFIID riid, void **ppv)
HRESULT STDMETHODCALLTYPE WebForm::QueryInterface(REFIID riid, void **ppv)
{
*ppv = NULL;

Expand Down Expand Up @@ -246,12 +246,12 @@ HRESULT STDMETHODCALLTYPE TWebf::QueryInterface(REFIID riid, void **ppv)
return E_NOINTERFACE;
}

ULONG STDMETHODCALLTYPE TWebf::AddRef()
ULONG STDMETHODCALLTYPE WebForm::AddRef()
{
return InterlockedIncrement(&ref);
}

ULONG STDMETHODCALLTYPE TWebf::Release()
ULONG STDMETHODCALLTYPE WebForm::Release()
{
int tmp = InterlockedDecrement(&ref);

Expand All @@ -262,10 +262,10 @@ ULONG STDMETHODCALLTYPE TWebf::Release()
return tmp;
}

LRESULT CALLBACK TWebf::WebformWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK WebForm::WebformWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_NCCREATE) {
TWebf *webf = (TWebf*)((LPCREATESTRUCT(lParam))->lpCreateParams);
WebForm *webf = (WebForm*)((LPCREATESTRUCT(lParam))->lpCreateParams);
webf->hWnd = hwnd;

#pragma warning(suppress:4244)
Expand All @@ -275,7 +275,7 @@ LRESULT CALLBACK TWebf::WebformWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
}

#pragma warning(suppress:4312)
TWebf *webf = (TWebf*)GetWindowLongPtr(hwnd, 0);
WebForm *webf = (WebForm*)GetWindowLongPtr(hwnd, 0);

if (webf == NULL) {
return DefWindowProc(hwnd, msg, wParam, lParam);
Expand All @@ -284,7 +284,7 @@ LRESULT CALLBACK TWebf::WebformWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return webf->InstanceWndProc(msg, wParam, lParam);
}

LRESULT TWebf::InstanceWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT WebForm::InstanceWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_CREATE: {
Expand Down Expand Up @@ -327,7 +327,7 @@ LRESULT TWebf::InstanceWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hWnd, msg, wParam, lParam);
}

void TWebf::create(HWND hWndParent, HINSTANCE hInstance, UINT id, bool showScrollbars)
void WebForm::create(HWND hWndParent, HINSTANCE hInstance, UINT id, bool showScrollbars)
{
hasScrollbars = showScrollbars;
this->id = id;
Expand All @@ -336,13 +336,13 @@ void TWebf::create(HWND hWndParent, HINSTANCE hInstance, UINT id, bool showScrol
if (!GetClassInfoEx(hInstance, WEBFORM_CLASS, &wcex)) {
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)TWebf::WebformWndProc;
wcex.lpfnWndProc = (WNDPROC)WebForm::WebformWndProc;
wcex.hInstance = hInstance;
wcex.lpszClassName = WEBFORM_CLASS;
wcex.cbWndExtra = sizeof(TWebf*);
wcex.cbWndExtra = sizeof(WebForm*);

if(!RegisterClassEx(&wcex)) {
MessageBox(NULL, "Could not auto register the webform", "TWebf::create", MB_OK);
MessageBox(NULL, "Could not auto register the webform", "WebForm::create", MB_OK);

return;
}
Expand All @@ -359,7 +359,7 @@ void TWebf::create(HWND hWndParent, HINSTANCE hInstance, UINT id, bool showScrol
setupOle();
}

HRESULT STDMETHODCALLTYPE TWebf::Invoke(DISPID dispIdMember, REFIID riid,
HRESULT STDMETHODCALLTYPE WebForm::Invoke(DISPID dispIdMember, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
Expand Down Expand Up @@ -397,28 +397,28 @@ HRESULT STDMETHODCALLTYPE TWebf::Invoke(DISPID dispIdMember, REFIID riid,
return S_OK;
}

HRESULT STDMETHODCALLTYPE TWebf::GetHostInfo(DOCHOSTUIINFO *pInfo)
HRESULT STDMETHODCALLTYPE WebForm::GetHostInfo(DOCHOSTUIINFO *pInfo)
{
pInfo->dwFlags = (hasScrollbars ? 0 : DOCHOSTUIFLAG_SCROLL_NO) | DOCHOSTUIFLAG_NO3DOUTERBORDER;

return S_OK;
}

HRESULT STDMETHODCALLTYPE TWebf::GetExternal(IDispatch **ppDispatch)
HRESULT STDMETHODCALLTYPE WebForm::GetExternal(IDispatch **ppDispatch)
{
*ppDispatch = static_cast<IDispatch*>(this);

return S_OK;
}

HRESULT STDMETHODCALLTYPE TWebf::GetWindow(HWND *phwnd)
HRESULT STDMETHODCALLTYPE WebForm::GetWindow(HWND *phwnd)
{
*phwnd = hhost;

return S_OK;
}

HRESULT STDMETHODCALLTYPE TWebf::GetWindowContext(IOleInPlaceFrame **ppFrame,
HRESULT STDMETHODCALLTYPE WebForm::GetWindowContext(IOleInPlaceFrame **ppFrame,
IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect,
LPOLEINPLACEFRAMEINFO info)
{
Expand All @@ -435,7 +435,7 @@ HRESULT STDMETHODCALLTYPE TWebf::GetWindowContext(IOleInPlaceFrame **ppFrame,
return S_OK;
}

HRESULT STDMETHODCALLTYPE TWebf::OnPosRectChange(LPCRECT lprcPosRect)
HRESULT STDMETHODCALLTYPE WebForm::OnPosRectChange(LPCRECT lprcPosRect)
{
IOleInPlaceObject *iole = NULL;
ibrowser->QueryInterface(IID_IOleInPlaceObject, (void**)&iole);
Expand Down
6 changes: 3 additions & 3 deletions webform.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma warning(push)
#pragma warning(disable:4584)
class TWebf : public IUnknown, TOleClientSite, TDispatch, TDocHostShowUI, TDocHostUIHandler, TOleInPlaceSite, TOleInPlaceFrame {
class WebForm : public IUnknown, TOleClientSite, TDispatch, TDocHostShowUI, TDocHostUIHandler, TOleInPlaceSite, TOleInPlaceFrame {
#pragma warning(pop)
private:
IHTMLDocument2 *GetDoc();
Expand All @@ -43,8 +43,8 @@ class TWebf : public IUnknown, TOleClientSite, TDispatch, TDocHostShowUI, TDocHo

WebformDispatchHandler *dispatchHandler;

TWebf(WebformDispatchHandler *wdh);
~TWebf();
WebForm(WebformDispatchHandler *wdh);
~WebForm();
void create(HWND hWndParent, HINSTANCE hInstance, UINT id, bool showScrollbars);
void CloseThread();
void Close();
Expand Down
2 changes: 1 addition & 1 deletion webwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void WebWindow::Create(HINSTANCE hInstance, UINT x, UINT y, UINT width, UINT hei
}
}

webForm = new TWebf(webformDispatchHandler);
webForm = new WebForm(webformDispatchHandler);

HWND hWndDesktop = FindWindow("DesktopBackgroundClass", 0);

Expand Down
2 changes: 1 addition & 1 deletion webwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class WebWindow {

public:
WebWindow(WebformDispatchHandler *wdh);
TWebf *webForm;
WebForm *webForm;
void Create(HINSTANCE hInstance, UINT x, UINT y, UINT width, UINT height, bool showScrollbars);
};

Expand Down

0 comments on commit 61fd106

Please sign in to comment.