Re: Where is TApplication located?



Adam Sandler wrote:
I'm trying to correct some buggy mouse wheel behavior in the DBGrid...
A colleague told me how to fix it and sent me this URL...
http://delphi.about.com/cs/adptips2002/a/bltip1102_3.htm

Whoever wrote that article is a little weird. Use the routine given, but make it a method of your form:


procedure TForm1.OnMessage
   (var Msg: TMsg; var Handled: Boolean) ;
var
   i: SmallInt;
begin
   if Msg.message = WM_MOUSEWHEEL then
   begin
     Msg.message := WM_KEYDOWN;
     Msg.lParam := 0;
     i := HiWord(Msg.wParam) ;
     if i > 0 then
       Msg.wParam := VK_UP
     else
       Msg.wParam := VK_DOWN;

     Handled := False;
   end;
end;

Then in your form's oncreate:

application.onmessage:=onmessage;

Cheers,
Nicholas Sherlock
.



Relevant Pages

  • Re: Calculate the string statement
    ... verkn:(vkn:char; ... funkt:(fkt:string; ... var fkt,dfkt: p; ... var fehler: boolean; ...
    (comp.lang.pascal.borland)
  • Re: WM_NCHitTest, WM_NCLButtonDown - Ungereimtheiten
    ... Handled: Boolean); ... procedure TnTransform.HandleMessage(var Msg: TMessage; var Handled: ... procedure TnTransform.HandleMouseDown(X, Y: Integer; const HitTest: ... procedure WndProc(var Message: TMessage); ...
    (de.comp.lang.delphi.misc)
  • Re: Handling exceptions in functions
    ... Procedure TryThis (var Result: boolean); ... a value *and* have an untrapped exception. ...
    (borland.public.delphi.non-technical)
  • Re: Moved from C++ to Delphi
    ... Be careful if var is an integer. ... Thus, in C/C++ ... The Delphi language has very ... Cast to ByteBool if you must use integers to hold boolean values, ...
    (borland.public.delphi.language.objectpascal)
  • Re: How to decode a TNEF Stream?
    ... TStream; ExtractRTF: boolean); ... var Conv:TTNEFConverter; ... attAttachData: ... if LastAttach nil then SetAttachmentFileName(PChar ...
    (microsoft.public.win32.programmer.messaging)