ReactOS 0.4.15-dev-8236-g99f0937
odbccp32.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS ODBC Control Panel Applet
3 * FILE: dll/cpl/odbccp32/odbccp32.c
4 * PURPOSE: applet initialization
5 * PROGRAMMER: Johannes Anderwald
6 */
7
8#include "odbccp32.h"
9
13
14
15LONG
18 UINT uMsg,
19 LPARAM lParam1,
20 LPARAM lParam2)
21{
22 switch (uMsg)
23 {
24 case CPL_INIT:
25 return TRUE;
26
27 case CPL_DBLCLK:
28 {
29 if (ODBCProc == NULL)
30 {
31 TCHAR szBuffer[MAX_PATH];
32
33 if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"),
34 szBuffer,
35 sizeof(szBuffer) / sizeof(TCHAR)) > 0)
36 {
37 hLibrary = LoadLibrary(szBuffer);
38 if (hLibrary)
39 {
40 ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet");
41 }
42 }
43 }
44
45 if (ODBCProc)
46 {
47 return ODBCProc(hwndCpl, uMsg, lParam1, lParam2);
48 }
49 else
50 {
51 if (hLibrary)
52 {
54 }
55
57 return (LONG)-1;
58 }
59 }
60 }
61
62 return FALSE;
63}
64
65
66BOOL
70 LPVOID lpReserved)
71{
73 UNREFERENCED_PARAMETER(lpReserved);
74
75 switch(dwReason)
76 {
79 {
80 InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
83
84 hApplet = hinstDLL;
85 break;
86 }
87 }
88
89 return TRUE;
90}
DWORD dwReason
Definition: misc.cpp:154
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
APPLET_PROC ODBCProc
Definition: odbccp32.c:11
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
Definition: odbccp32.c:68
HINSTANCE hApplet
Definition: odbccp32.c:10
HMODULE hLibrary
Definition: odbccp32.c:12
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
Definition: cpl.h:23
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define DLL_THREAD_ATTACH
Definition: compat.h:132
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
unsigned int UINT
Definition: ndis.h:50
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
long LONG
Definition: pedump.c:60
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_UPDOWN_CLASS
Definition: commctrl.h:62
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define _T(x)
Definition: vfdio.h:22
#define ExpandEnvironmentStrings
Definition: winbase.h:3774
#define LoadLibrary
Definition: winbase.h:3862
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
char TCHAR
Definition: xmlstorage.h:189