mirror of
https://github.com/reactos/reactos.git
synced 2025-05-16 15:50:24 +00:00
- beginning of ODBC control panel applet
svn path=/trunk/; revision=26262
This commit is contained in:
parent
260dc41818
commit
c3ebb7990e
13 changed files with 500 additions and 0 deletions
23
reactos/dll/cpl/odbccp32/about.c
Normal file
23
reactos/dll/cpl/odbccp32/about.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PROJECT: ReactOS ODBC Control Panel Applet
|
||||
* FILE: lib/cpl/main/main.c
|
||||
* PURPOSE: ODBC about dialog
|
||||
* PROGRAMMER: Johannes Anderwald
|
||||
*/
|
||||
|
||||
#include "odbccp32.h"
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
AboutProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
23
reactos/dll/cpl/odbccp32/drivers.c
Normal file
23
reactos/dll/cpl/odbccp32/drivers.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* $Id: odbccp32.c 22979 2006-07-09 21:10:40Z fireball $
|
||||
*
|
||||
* PROJECT: ReactOS ODBC Control Panel Applet
|
||||
* FILE: lib/cpl/main/main.c
|
||||
* PURPOSE: ODBC drivers dialog
|
||||
* PROGRAMMER: Johannes Anderwald
|
||||
*/
|
||||
|
||||
#include "odbccp32.h"
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
DriversProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
51
reactos/dll/cpl/odbccp32/dsn.c
Normal file
51
reactos/dll/cpl/odbccp32/dsn.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PROJECT: ReactOS ODBC Control Panel Applet
|
||||
* FILE: lib/cpl/main/main.c
|
||||
* PURPOSE: ODBC DSN functions
|
||||
* PROGRAMMER: Johannes Anderwald
|
||||
*/
|
||||
|
||||
#include "odbccp32.h"
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
UserDSNProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
SystemDSNProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
FileDSNProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
64
reactos/dll/cpl/odbccp32/lang/en-US.rc
Normal file
64
reactos/dll/cpl/odbccp32/lang/en-US.rc
Normal file
|
@ -0,0 +1,64 @@
|
|||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
IDD_USERDSN DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "User DSN"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&User Data Sources:", -1, 10, 15, 80, 12
|
||||
//FIXME textbox
|
||||
PUSHBUTTON "A&dd...", IDC_USERDSN_ADD, 185, 30, 50, 12
|
||||
PUSHBUTTON "&Remove...", IDC_USERDSN_REMOVE, 185, 45, 50, 12
|
||||
PUSHBUTTON "&Configure...", IDC_USERDSN_CONFIGURE, 185, 60, 50, 12
|
||||
// ICON -1, -1, 20, 180, 15, 15
|
||||
LTEXT "An ODBC User data source stores information about how to connect to the indicated data provider. A User data source is only visible to you and can only be used on the current machine.", -1, 45, 150, 180, 40
|
||||
END
|
||||
|
||||
IDD_SYSTEMDSN DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "System DSN"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
|
||||
END
|
||||
|
||||
IDD_FILEDSN DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "File DSN"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
|
||||
END
|
||||
|
||||
IDD_DRIVERS DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Drivers"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
|
||||
END
|
||||
|
||||
IDD_CONNTRACE DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Tracing"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
|
||||
END
|
||||
|
||||
IDD_CONNPOOL DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Connection Pooling"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
|
||||
END
|
||||
|
||||
IDD_ABOUT DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "About"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
|
||||
END
|
||||
|
126
reactos/dll/cpl/odbccp32/odbccp32.c
Normal file
126
reactos/dll/cpl/odbccp32/odbccp32.c
Normal file
|
@ -0,0 +1,126 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PROJECT: ReactOS ODBC Control Panel Applet
|
||||
* FILE: lib/cpl/main/main.c
|
||||
* PURPOSE: applet initialization
|
||||
* PROGRAMMER: Johannes Anderwald
|
||||
*/
|
||||
|
||||
#include "odbccp32.h"
|
||||
|
||||
HINSTANCE hApplet = 0;
|
||||
|
||||
VOID
|
||||
InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
|
||||
{
|
||||
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
|
||||
|
||||
psp->dwSize = sizeof(PROPSHEETPAGE);
|
||||
psp->dwFlags = PSP_DEFAULT;
|
||||
psp->hInstance = hApplet;
|
||||
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
|
||||
psp->pfnDlgProc = DlgProc;
|
||||
}
|
||||
|
||||
|
||||
LONG
|
||||
APIENTRY
|
||||
AppletProc(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
|
||||
{
|
||||
PROPSHEETPAGE psp[7];
|
||||
PROPSHEETHEADER psh;
|
||||
TCHAR szBuffer[256];
|
||||
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(uMsg);
|
||||
UNREFERENCED_PARAMETER(hwnd);
|
||||
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||
psh.dwFlags = PSH_PROPSHEETPAGE;
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.hwndParent = NULL;
|
||||
psh.hInstance = hApplet;
|
||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
|
||||
psh.nStartPage = 0;
|
||||
psh.ppsp = psp;
|
||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||
|
||||
if (LoadString(hApplet, IDS_CPLNAME, szBuffer, sizeof(szBuffer) / sizeof(TCHAR)) < 256)
|
||||
{
|
||||
psh.dwFlags |= PSH_PROPTITLE;
|
||||
psh.pszCaption = szBuffer;
|
||||
}
|
||||
|
||||
InitPropSheetPage(&psp[0], IDD_USERDSN, UserDSNProc);
|
||||
InitPropSheetPage(&psp[1], IDD_SYSTEMDSN, SystemDSNProc);
|
||||
InitPropSheetPage(&psp[2], IDD_FILEDSN, FileDSNProc);
|
||||
InitPropSheetPage(&psp[3], IDD_DRIVERS, DriversProc);
|
||||
InitPropSheetPage(&psp[4], IDD_CONNTRACE, TraceProc);
|
||||
InitPropSheetPage(&psp[5], IDD_CONNPOOL, PoolProc);
|
||||
InitPropSheetPage(&psp[6], IDD_ABOUT, AboutProc);
|
||||
return (LONG)(PropertySheet(&psh) != -1);
|
||||
}
|
||||
|
||||
|
||||
LONG
|
||||
CALLBACK
|
||||
CPlApplet(HWND hwndCpl,
|
||||
UINT uMsg,
|
||||
LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case CPL_INIT:
|
||||
return TRUE;
|
||||
|
||||
case CPL_GETCOUNT:
|
||||
return 1;
|
||||
|
||||
case CPL_INQUIRE:
|
||||
{
|
||||
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
|
||||
|
||||
CPlInfo->lData = lParam1;
|
||||
CPlInfo->idIcon = CPL_ICON;
|
||||
CPlInfo->idName = CPL_NAME;
|
||||
CPlInfo->idInfo = CPL_INFO;
|
||||
break;
|
||||
}
|
||||
|
||||
case CPL_DBLCLK:
|
||||
{
|
||||
AppletProc(hwndCpl, uMsg, lParam1, lParam2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DllMain(HINSTANCE hinstDLL,
|
||||
DWORD dwReason,
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
INITCOMMONCONTROLSEX InitControls;
|
||||
UNREFERENCED_PARAMETER(lpReserved);
|
||||
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
|
||||
InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||
InitControls.dwICC = ICC_LISTVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_BAR_CLASSES;
|
||||
InitCommonControlsEx(&InitControls);
|
||||
|
||||
hApplet = hinstDLL;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
6
reactos/dll/cpl/odbccp32/odbccp32.def
Normal file
6
reactos/dll/cpl/odbccp32/odbccp32.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
LIBRARY odbccp32.cpl
|
||||
|
||||
EXPORTS
|
||||
CPlApplet
|
||||
|
||||
; EOF
|
66
reactos/dll/cpl/odbccp32/odbccp32.h
Normal file
66
reactos/dll/cpl/odbccp32/odbccp32.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
#ifndef ODBCCP32_H__ // odbccp32.h
|
||||
#define ODBCCP32_H__
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <cpl.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
extern HINSTANCE hApplet;
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
UserDSNProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
SystemDSNProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
FileDSNProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
DriversProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
TraceProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
PoolProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
AboutProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam);
|
||||
|
||||
|
||||
|
||||
#endif /* end of ODBCCP32_H__ */
|
21
reactos/dll/cpl/odbccp32/odbccp32.rbuild
Normal file
21
reactos/dll/cpl/odbccp32/odbccp32.rbuild
Normal file
|
@ -0,0 +1,21 @@
|
|||
<module name="odbccp32i" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_ODBCCP32}" installbase="system32" installname="odbccp32.cpl" usewrc="false">
|
||||
<importlibrary definition="odbccp32.def" />
|
||||
<include base="odbccp32">.</include>
|
||||
<define name="UNICODE" />
|
||||
<define name="_UNICODE" />
|
||||
<define name="__REACTOS__" />
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_IE">0x600</define>
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<library>comctl32</library>
|
||||
<library>msvcrt</library>
|
||||
<file>odbccp32.c</file>
|
||||
<file>dsn.c</file>
|
||||
<file>trace.c</file>
|
||||
<file>pool.c</file>
|
||||
<file>about.c</file>
|
||||
<file>drivers.c</file>
|
||||
<file>odbccp32.rc</file>
|
||||
</module>
|
13
reactos/dll/cpl/odbccp32/odbccp32.rc
Normal file
13
reactos/dll/cpl/odbccp32/odbccp32.rc
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS ODBC Control Panel Applet\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "odbccp32\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "odbccp32.cpl\0"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
|
||||
|
||||
#include "rsrc.rc"
|
23
reactos/dll/cpl/odbccp32/pool.c
Normal file
23
reactos/dll/cpl/odbccp32/pool.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PROJECT: ReactOS ODBC Control Panel Applet
|
||||
* FILE: lib/cpl/main/main.c
|
||||
* PURPOSE: ODBC pool functions
|
||||
* PROGRAMMER: Johannes Anderwald
|
||||
*/
|
||||
|
||||
#include "odbccp32.h"
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
PoolProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
54
reactos/dll/cpl/odbccp32/resource.h
Normal file
54
reactos/dll/cpl/odbccp32/resource.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#ifndef RESOURCE_H__ //resource.h
|
||||
#define RESOURCE_H__
|
||||
|
||||
//
|
||||
/// dialog constants
|
||||
///
|
||||
#define IDD_USERDSN 100
|
||||
#define IDD_SYSTEMDSN 101
|
||||
#define IDD_FILEDSN 102
|
||||
#define IDD_DRIVERS 103
|
||||
#define IDD_CONNTRACE 104
|
||||
#define IDD_CONNPOOL 105
|
||||
#define IDD_ABOUT 106
|
||||
|
||||
#define IDC_CPLICON 150
|
||||
#define IDS_CPLNAME 151
|
||||
#define CPL_ICON 152
|
||||
#define CPL_NAME 153
|
||||
#define CPL_INFO 154
|
||||
|
||||
///
|
||||
/// User DSN dialog constants
|
||||
///
|
||||
|
||||
#define IDC_USERDSN_ADD 200
|
||||
#define IDC_USERDSN_REMOVE 201
|
||||
#define IDC_USERDSN_CONFIGURE 202
|
||||
|
||||
///
|
||||
/// System DSN dialog constants
|
||||
///
|
||||
|
||||
///
|
||||
/// File DSN dialog constants
|
||||
///
|
||||
|
||||
///
|
||||
/// Drivers dialog constants
|
||||
///
|
||||
|
||||
///
|
||||
/// Trace dialog constants
|
||||
///
|
||||
|
||||
///
|
||||
/// Connection pooling dialog constants
|
||||
///
|
||||
|
||||
///
|
||||
/// About dialog constants
|
||||
///
|
||||
|
||||
|
||||
#endif /* end of RESOURCE_H__ */
|
7
reactos/dll/cpl/odbccp32/rsrc.rc
Normal file
7
reactos/dll/cpl/odbccp32/rsrc.rc
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "resource.h"
|
||||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#include "lang/en-US.rc"
|
23
reactos/dll/cpl/odbccp32/trace.c
Normal file
23
reactos/dll/cpl/odbccp32/trace.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PROJECT: ReactOS ODBC Control Panel Applet
|
||||
* FILE: lib/cpl/main/main.c
|
||||
* PURPOSE: ODBC trace functions
|
||||
* PROGRAMMER: Johannes Anderwald
|
||||
*/
|
||||
|
||||
#include "odbccp32.h"
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
TraceProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
Loading…
Reference in a new issue