Daniel, com este codigo seu ele só pega as coordenadas quando estou dentro do form, por isso tive que recorrer ao HOOK.
Ricardo, no vista tbm nao consegui fazer o WH_JOURNALHOOK funcionar, mas estou utilizando no XP SP3. É aquele negocio, enquanto o mouse ta em movimento tudo corre perfeito. Valeu. Att. Maycon Sanches Amaro Analista de Sistemas Jr. Source do Brasil LTDA Phone: +55-19-3847-7220 Fax: +55-19-3847-7269 Cel: +55-19-7803-1527 Ricardo César Cardoso escreveu: > > Se não me engano havia um problema com o WH_JOURNALHOOK no Windows > Vista; esse hook não funciona segundo relatos. Alguém que use o Vista > pode reportar se esse problema procede? > > Grato, > Ricardo. > > --- Em sex, 1/8/08, Maycon Sanches Amaro <[EMAIL PROTECTED] > <mailto:mayconsan%40gmail.com>> escreveu: > De: Maycon Sanches Amaro <[EMAIL PROTECTED] > <mailto:mayconsan%40gmail.com>> > Assunto: [delphi-br] Coordenadas do mouse > Para: delphi-br@yahoogrupos.com.br <mailto:delphi-br%40yahoogrupos.com.br> > Data: Sexta-feira, 1 de Agosto de 2008, 13:31 > > Pessoal to usando uma funcao para capturar as coordenadas do mouse. Mas > > estou com um problema, ela só captura as coordenadas se o mouse estiver > > em movimento. To alimentando um memo e preciso que mesmo com o mouse > > parado ele continue recebendo os valores da posicao, pq depois to > > colocando o mouse pra executar todo o trajeto. Pensei em colocar um > > ttimer mas nao to sabendo como jogar esta funcao la pra dentro. > > To chamando ela assim. > > if FHookStarted then > > begin > > ShowMessage( 'Mouse is already being Journaled, can not restart'); > > Exit; > > end; > > JHook := SetWindowsHookEx( WH_JOURNALRECORD , @JournalProc, hInstance, 0); > > {SetWindowsHookEx starts the Hook } > > if JHook > 0 then > > begin > > FHookStarted := True; > > end > > else > > //FHookStarted := True; > > ShowMessage( 'No Journal Hook availible'); > > end; > > Segue a funcao. > > function JournalProc( Code, wParam: Integer; var EventStrut: TEventMsg): > > Integer; stdcall; > > var > > Char1: PChar; > > b1x,b1y,b2x, b2y,x,y: string; > > i:integer; > > begin > > {this is the JournalRecordProc} > > Result := CallNextHookEx( JHook, Code, wParam, Longint(@EventStrut )); > > {the CallNextHookEX is not really needed for journal hook since it it not > > really in a hook chain, but it's standard for a Hook} > > if Code < 0 then Exit; > > {you should cancel operation if you get HC_SYSMODALON} > > if Code = HC_SYSMODALON then Exit; > > if Code = HC_ACTION then > > begin > > { > > The lParam parameter contains a pointer to a TEventMsg > > structure containing information on > > the message removed from the system message queue. > > } > > x := ''; > > y := ''; > > i:=0; > > SetLength(lArrayx, 0); > > if (EventStrut. message= WM_MOUSEMOVE) then > > begin > > x := 'move'+IntToStr( EventStrut. paramL); > > y := 'move'+IntToStr( EventStrut. paramH); > > end; > > Form1.Memox. Lines.Add( x+','+y); > > end; > > end; > > -- > > Att. > > Maycon Sanches Amaro > > Analista de Sistemas Jr. > > Source do Brasil LTDA > > Phone: +55-19-3847- 7220 > > Fax: +55-19-3847- 7269 > > Cel: +55-19-7803- 1527 > > > > Novos endereços, o Yahoo! que você conhece. Crie um email novo com a > sua cara @ymail.com ou @rocketmail.com. > http://br.new.mail.yahoo.com/addresses > <http://br.new.mail.yahoo.com/addresses> > > [As partes desta mensagem que não continham texto foram removidas] > >