diff options
author | hobbs2 <hobbs2> | 2008-02-23 22:16:53 (GMT) |
---|---|---|
committer | hobbs2 <hobbs2> | 2008-02-23 22:16:53 (GMT) |
commit | 8cc084b70b8b075a7a5e6fb7306c0ca057e68a75 (patch) | |
tree | 7f702e99770af13fdb2613f6b3995707965374b1 | |
parent | ad1819fa353bf8962d13f2afa6312e017ae4b325 (diff) | |
download | tktreectrl-8cc084b70b8b075a7a5e6fb7306c0ca057e68a75.zip tktreectrl-8cc084b70b8b075a7a5e6fb7306c0ca057e68a75.tar.gz tktreectrl-8cc084b70b8b075a7a5e6fb7306c0ca057e68a75.tar.bz2 |
* generic/tkTreeTheme.c (DllMain): get module at dll load time to
avoid GetModuleHandleEx call.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tkTreeTheme.c | 20 |
2 files changed, 24 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2008-02-23 Jeff Hobbs <jeffh@ActiveState.com> + + * generic/tkTreeTheme.c (DllMain): get module at dll load time to + avoid GetModuleHandleEx call. + 2008-02-22 Jeff Hobbs <jeffh@ActiveState.com> * demos/demo.tcl, doc/What's New in TkTreeCtrl.html: diff --git a/generic/tkTreeTheme.c b/generic/tkTreeTheme.c index ca3228d..5e427fa 100644 --- a/generic/tkTreeTheme.c +++ b/generic/tkTreeTheme.c @@ -5,7 +5,7 @@ * * Copyright (c) 2006-2008 Tim Baker * - * RCS: @(#) $Id: tkTreeTheme.c,v 1.23 2008/02/09 03:46:02 treectrl Exp $ + * RCS: @(#) $Id: tkTreeTheme.c,v 1.24 2008/02/23 22:16:53 hobbs2 Exp $ */ #if defined(WIN32) || defined(_WIN32) @@ -156,10 +156,15 @@ GetActCtxProcs(void) return NULL; } +static HMODULE thisModule = NULL; + /* Return the HMODULE for this treectrl.dll. */ static HMODULE GetMyHandle(void) { +#if 1 + return thisModule; +#else HMODULE hModule = NULL; /* FIXME: Only >=NT so I shouldn't link to it? But I already linked to @@ -169,6 +174,19 @@ GetMyHandle(void) (LPCTSTR)&appThemeData, &hModule); return hModule; +#endif +} + +BOOL WINAPI +DllMain(hInst, reason, reserved) + HINSTANCE hInst; /* Library instance handle. */ + DWORD reason; /* Reason this function is being called. */ + LPVOID reserved; /* Not used. */ +{ + if (reason == DLL_PROCESS_ATTACH) { + thisModule = (HMODULE) hInst; + } + return TRUE; } static HANDLE |