|
// MainDlg.cpp : implementation of the CMainDlg class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include <strsafe.h>
#include "flash10a.tlh"
#include "MainDlg.h"
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// center the dialog on the screen
CenterWindow();
// set icons
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
SetIcon(hIcon, TRUE);
HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
SetIcon(hIconSmall, FALSE);
TCHAR szPath[MAX_PATH] = { 0 };
if ( ::GetModuleFileName(NULL, szPath, MAX_PATH) > 0 )
{
LPTSTR pszSep = _tcsrchr(szPath, TCHAR('\\'));
pszSep++;
*pszSep = 0;
::StringCchCat(szPath, MAX_PATH, _T("Construction.swf"));
}
// Initialize Flash Player (Shockwave .swf)
HRESULT hr;
ActiveXSite* pSite;
pSite = CAxWindowlessHost<CMainDlg>::GetControlSite(IDC_SHOCKWAVEFLASH);
if ( pSite != NULL )
{
CComQIPtr<IShockwaveFlash> spFlash = pSite->ActiveXControl();
hr = spFlash->put_WMode( CComBSTR("Transparent") );
hr = spFlash->put_Movie( CComBSTR(szPath) );
//hr = spFlash->put_Movie( CComBSTR("http://www.youtube.com/v/7Y4thikv-OM&rel=1") );
}
return TRUE;
}
LRESULT CMainDlg::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CSimpleDialog<IDD_ABOUTBOX, FALSE> dlg;
dlg.DoModal();
return 0;
}
LRESULT CMainDlg::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: Add validation code
EndDialog(wID);
return 0;
}
LRESULT CMainDlg::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Ernest is a multi-discipline software engineer.
Skilled at software design and development for all Windows platforms.
-
MCSD (C#, .NET)
Interests: User Interface, GDI/GDI+, Scripting, Android, iOS, Windows Mobile.
Programming Skills: C/C++, C#, Java (Android), VB and ASP.NET.
I hope you will enjoy my contributions.