Hallo,
ich bin zurzeit dabei eine MS Office basierte Datenbank Applikation zu programmieren bei der die Handschrift Erkennung von Microsoft in Office eingebunden wird.
Dazu will ich das pull down Mouse Menü in allen Office Programmen um einen Eintrag erweitern der die Handschrift Erkennung aufruft. Bei diesem Aufruf wird auch das Window des aktuellen Dokumentes mit übergeben (darauf wird die Handschrift Erkennung laufen).
Das Problem ist nur ich habe leider keine Große Ahnung von C++, C# oder VBA Programmierung. Deshalb hoffe ich jemand kann mir helfen und ein paar Tipps geben wie ich das Pull down Menü erweitern kann(vielleicht er Macro?) und wie ich aus Office eine andere externe Klasse oder EXE aufrufen kann mit diesem Übergabe Parameter.
Ich habe eine Beispiel Klasse gefunden die eventuell als Basis der Handschrift Erkennung dienen könnte. Nur hier wird ein neues Window generiert auf dem die Handschrift Erkennung läuft Nur weiß ich leider nicht wie ich die Methode umschreiben muss um ein spezielles Fenster zu nutzen.
/////////////////////////////////////////////////////////
//
// WinMain
//
// The WinMain function is called by the system as the
// initial entry point for a Win32-based application.
// It contains typical boilerplate code to create and
// show the main window, and pump messages.
//
// Parameters:
// HINSTANCE hInstance, : [in] handle to current instance
// HINSTANCE hPrevInstance, : [in] handle to previous instance
// LPSTR lpCmdLine, : [in] command line
// int nCmdShow : [in] show state
//
// Return Values:
// 0 : The function terminated before entering the message loop.
// non zero: Value of the wParam when receiving the WM_QUIT message
//
/////////////////////////////////////////////////////////
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
if (!RegisterWindowClass(hInstance))
return 0;
CoInitialize(NULL);
// Create the application window
HWND hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, gc_szAppName, gc_szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL);
if (NULL == hWnd)
{
MessageBox(NULL, TEXT("Error creating the window"), TEXT("Error"),
MB_OK | MB_ICONINFORMATION);
return 0;
}
// Show the main window
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
// Start the boilerplate message loop
MSG msg;
while (GetMessage(&msg, NULL, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
CleanUp();
CoUninitialize();
return msg.wParam;
}
/////////////////////////////////////////////////////////
//
// RegisterWindowClass
//
// The RegisterWindowClass function registers a window class for
// subsequent use in calls to the CreateWindow or CreateWindowEx function.
//
// Parameters:
// HINSTANCE hInstance : [in] Handle to the instance that
// contains the window procedure for the class.
//
// Return Values:
// TRUE : Success
// FALSE : Failure to register the class
//
/////////////////////////////////////////////////////////
BOOL RegisterWindowClass(HINSTANCE hInstance)
{
WNDCLASSEX WndClassEx;
WndClassEx.cbSize = sizeof(WndClassEx);
WndClassEx.style = CS_HREDRAW | CS_VREDRAW;
WndClassEx.lpfnWndProc = WndProc;
WndClassEx.cbClsExtra = 0;
WndClassEx.cbWndExtra = 0;
WndClassEx.hInstance = hInstance;
WndClassEx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON));
WndClassEx.hIconSm = WndClassEx.hIcon;
WndClassEx.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClassEx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WndClassEx.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
WndClassEx.lpszClassName = gc_szAppName;
if (!RegisterClassEx(&WndClassEx))
{
MessageBox(NULL, TEXT("Failed to register window class!"),
gc_szAppName, MB_ICONERROR);
return false;
}
return true;
}
Bin für jede Hilfe dankbar,
Thomas
ich bin zurzeit dabei eine MS Office basierte Datenbank Applikation zu programmieren bei der die Handschrift Erkennung von Microsoft in Office eingebunden wird.
Dazu will ich das pull down Mouse Menü in allen Office Programmen um einen Eintrag erweitern der die Handschrift Erkennung aufruft. Bei diesem Aufruf wird auch das Window des aktuellen Dokumentes mit übergeben (darauf wird die Handschrift Erkennung laufen).
Das Problem ist nur ich habe leider keine Große Ahnung von C++, C# oder VBA Programmierung. Deshalb hoffe ich jemand kann mir helfen und ein paar Tipps geben wie ich das Pull down Menü erweitern kann(vielleicht er Macro?) und wie ich aus Office eine andere externe Klasse oder EXE aufrufen kann mit diesem Übergabe Parameter.
Ich habe eine Beispiel Klasse gefunden die eventuell als Basis der Handschrift Erkennung dienen könnte. Nur hier wird ein neues Window generiert auf dem die Handschrift Erkennung läuft Nur weiß ich leider nicht wie ich die Methode umschreiben muss um ein spezielles Fenster zu nutzen.
/////////////////////////////////////////////////////////
//
// WinMain
//
// The WinMain function is called by the system as the
// initial entry point for a Win32-based application.
// It contains typical boilerplate code to create and
// show the main window, and pump messages.
//
// Parameters:
// HINSTANCE hInstance, : [in] handle to current instance
// HINSTANCE hPrevInstance, : [in] handle to previous instance
// LPSTR lpCmdLine, : [in] command line
// int nCmdShow : [in] show state
//
// Return Values:
// 0 : The function terminated before entering the message loop.
// non zero: Value of the wParam when receiving the WM_QUIT message
//
/////////////////////////////////////////////////////////
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
if (!RegisterWindowClass(hInstance))
return 0;
CoInitialize(NULL);
// Create the application window
HWND hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, gc_szAppName, gc_szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL);
if (NULL == hWnd)
{
MessageBox(NULL, TEXT("Error creating the window"), TEXT("Error"),
MB_OK | MB_ICONINFORMATION);
return 0;
}
// Show the main window
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
// Start the boilerplate message loop
MSG msg;
while (GetMessage(&msg, NULL, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
CleanUp();
CoUninitialize();
return msg.wParam;
}
/////////////////////////////////////////////////////////
//
// RegisterWindowClass
//
// The RegisterWindowClass function registers a window class for
// subsequent use in calls to the CreateWindow or CreateWindowEx function.
//
// Parameters:
// HINSTANCE hInstance : [in] Handle to the instance that
// contains the window procedure for the class.
//
// Return Values:
// TRUE : Success
// FALSE : Failure to register the class
//
/////////////////////////////////////////////////////////
BOOL RegisterWindowClass(HINSTANCE hInstance)
{
WNDCLASSEX WndClassEx;
WndClassEx.cbSize = sizeof(WndClassEx);
WndClassEx.style = CS_HREDRAW | CS_VREDRAW;
WndClassEx.lpfnWndProc = WndProc;
WndClassEx.cbClsExtra = 0;
WndClassEx.cbWndExtra = 0;
WndClassEx.hInstance = hInstance;
WndClassEx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON));
WndClassEx.hIconSm = WndClassEx.hIcon;
WndClassEx.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClassEx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WndClassEx.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
WndClassEx.lpszClassName = gc_szAppName;
if (!RegisterClassEx(&WndClassEx))
{
MessageBox(NULL, TEXT("Failed to register window class!"),
gc_szAppName, MB_ICONERROR);
return false;
}
return true;
}
Bin für jede Hilfe dankbar,
Thomas