Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EXE source file

0 views
Skip to first unread message

John Doe

unread,
Feb 11, 2005, 12:06:23 AM2/11/05
to
#include <afxwin.h>
#include <stdio.h>
#include <mmsystem.h>
#include <G:\LShaping\scripting\hook\definitions.h>
#include "resource.h"
#include "keypadDLL.h"
class CMyApp:public CWinApp
{
public:
CMyApp()
{
}
virtual BOOL InitInstance();
virtual int ExitInstance();
};
class CMainFrame:public CFrameWnd
{
protected:
DECLARE_DYNCREATE(CMainFrame)
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnPaint();
afx_msg LRESULT ReceivedFromDLL(UINT wParam, LONG lParam);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
if(!KeypadDLLInit())
{
AfxMessageBox(_T("This indicates a critical error."));
return FALSE;
}
CMainFrame*pMainFrame=new CMainFrame;
if(!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
m_pMainWnd=pMainFrame;
return TRUE;
}
int CMyApp::ExitInstance()
{
KeypadDLLTerm();
return CWinApp::ExitInstance();
}
IMPLEMENT_DYNCREATE(CMainFrame,CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame,CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_PAINT()
//}}AFX_MSG_MAP
ON_MESSAGE(KeyMessageToEXE,ReceivedFromDLL)
END_MESSAGE_MAP()
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CFrameWnd::OnCreate(lpCreateStruct)==-1)
return -1;
return 0;
}
void CMainFrame::OnPaint()
{
CPaintDC dc(this);
CString s("Shortcut keys only. ");
CRect rc;
GetClientRect(&rc);
dc.DrawText(s,&rc,DT_VCENTER);
}
LRESULT CMainFrame::ReceivedFromDLL(UINT wParam, LONG lParam)
{//EXE
switch(wParam)
{//EXE-SW_SIG
case 65:
{//EXE-SW_SIG-
FileHandle=FindFirstFile("C:\\PadWorks\\scripts\\*KeyA.txt",&FindData);
strcpy(FileName," .txt");
break;
}//EXE-SW_SIG-
default:
{//EXE-SW_SIG-non alphanumeric key
PlaySound("C:\\Program Files\\Shortcuts\\sounds\\letters or numbers only.wav",
NULL,SND_FILENAME|SND_ASYNC|SND_NOWAIT|SND_NODEFAULT);
return 0;
}//EXE-SW_SIG-non alphanumeric key
}//EXE-SW_SIG

return 0;
}//EXE

0 new messages