Article View: borland.public.cppbuilder.nativeapi
Article #129Re: Problem with global hook?
From: Bob Gonder
Date: Thu, 12 Jun 2008 15:17
Date: Thu, 12 Jun 2008 15:17
44 lines
2429 bytes
2429 bytes
Patryk B. wrote:
>Ok, code work like it should, inactive windows are transparent, active
>window not. But when im traying to move window it's move veeeery slow.
>It's laging and I dont know why...
>When I put for example Beep() instead of setting transparency, pc beeping
>when window changing state but it not laging.
The following code is all that is executed during drag,
so that shouldn't be the problem:
>LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
>{
> if(nCode <0)
> { return CallNextHookEx(hWin, nCode, wParam, lParam);
> }
> if(nCode==HC_ACTION)
> { CWPSTRUCT* msg=(CWPSTRUCT*)lParam;
> hWindow=msg->hwnd; <-- not significant,
but you might move this after if(WM_ACTIVATE)
> if(msg->message==WM_ACTIVATE)
> {
// not executed during drag.
> }
> }
> return CallNextHookEx(hWin, nCode, wParam, lParam);
>}
>When I set transparency for window from normal program (exe) it
>works ok. So why it dont work when im trying to set transparency
>from that dll?
When setting from program, only program is affected.
When setting from DLL, _all_ windows affected.
Just a guess, but from the following link, you should be clearing
the WS_EX_LAYERED bit instead of changing the alpha to 255.
Using Layered Windows (bottom of page)
http://msdn.microsoft.com/en-us/library/ms632598(VS.85).aspx
See also Layered Windows at
http://msdn.microsoft.com/en-us/library/ms632599(VS.85).aspx
where it suggests using UpdateLayeredWindow for position changes.
Technical Details
Message-ID:
<8ce2545biafpgdrnirg8be2bto3cragih3@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<bhxmq2m9ts12.1p5w7pvxgm2as.dlg@40tude.net>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,72542b542452aa66 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <none@nowhere.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Problem with global hook? Date: Thu, 12 Jun 2008 08:17:08 -0700 Message-ID: <8ce2545biafpgdrnirg8be2bto3cragih3@4ax.com> References: <bhxmq2m9ts12.1p5w7pvxgm2as.dlg@40tude.net> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.144.12 X-Trace: newsgroups.borland.com 1213283824 67.77.144.12 (12 Jun 2008 08:17:04 -0700) Lines: 45 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail