Article View: borland.public.cppbuilder.nativeapi
Article #14213Re: Urgent FindWindow() with minimized window!!
From: Schandler
Date: Thu, 21 Aug 2003 08:28
Date: Thu, 21 Aug 2003 08:28
83 lines
3432 bytes
3432 bytes
thanks Remy
I will try this out
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3f43a370@newsgroups.borland.com...
>
> "Schandler" <theslider@programmer.net> wrote in message
> news:3f433f98@newsgroups.borland.com...
>
> > I'm not expierenced with memory mapped file, so if there is
> > an example or something that demonestrates the usage of
> > CreateFileMapping() and MapViewOfFile(), it would be
> > nice if u tell me where can I find it
>
> struct _HookInfo
> {
> HHOOK hHook;
> HWND hWnd;
> } HOOKINFO, *PHOOKINFO;
>
> HANDLE hFileMapping = NULL;
> PHOOKINFO pHookInfo = NULL;
>
> BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID
> lpvReserved)
> {
> switch( fdwReason )
> {
> case DLL_PROCESS_ATTACH:
> hFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE,
NULL,
> PAGE_READWRITE, 0, sizeof(HOOKINFO), "MyHook");
> if( hFileMapping )
> pHookInfo = (MyStruct*)MapViewOfFile(hFileMapping,
> FILE_MAP_WRITE, 0, 0, 0);
> break;
>
> case DLL_PROCESS_DETACH:
> UnmapViewOfFile(pHookInfo);
> pHookInfo = NULL;
> CloseHandle(hFileMapping);
> hFileMapping = NULL;
> break;
> }
>
> return TRUE;
> }
>
> extern "C" __declspec(dllexport) int __stdcall SetHook(HWND hWnd)
> {
> if( pHookInfo )
> {
> if( pHookInfo->hHook == NULL )
> pHookIno->hHook = SetWindowsHookEx(...);
> pHookInfo->hWnd = hWnd;
> return ( pHookInfo->hHook != NULL );
> }
> return FALSE;
> }
>
> extern "C" __declspec(dllexport) void __stdcall UnsetHook()
> {
> if( pHookInfo )
> {
> if( pHookInfo->hHook )
> {
> UnhookWindowsHookEx(pHookIno->hHook);
> pHookInfo->hHook = NULL;
> }
> }
> }
>
>
> Gambit
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/03
>
>
Technical Details
Message-ID:
<3f44827f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f41defb@newsgroups.borland.com> <3f425676$1@newsgroups.borland.com> <3f428826@newsgroups.borland.com> <3f42a13b$1@newsgroups.borland.com> <3f433f98@newsgroups.borland.com> <3f43a370@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2982d6ee34563d56 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-21 01:38:16 PST From: "Schandler" <theslider@programmer.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f41defb@newsgroups.borland.com> <3f425676$1@newsgroups.borland.com> <3f428826@newsgroups.borland.com> <3f42a13b$1@newsgroups.borland.com> <3f433f98@newsgroups.borland.com> <3f43a370@newsgroups.borland.com> Subject: Re: Urgent FindWindow() with minimized window!! Date: Thu, 21 Aug 2003 11:28:35 +0300 Lines: 85 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 NNTP-Posting-Host: 62.68.242.128 Message-ID: <3f44827f@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1061454463 62.68.242.128 (21 Aug 2003 01:27:43 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail