Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Message kommt nicht an. (https://www.delphipraxis.net/35508-message-kommt-nicht.html)

QuickAndDirty 8. Dez 2004 10:51


Message kommt nicht an.
 
Also ich hab hier ne Message WM_SetSelectedCell, man kann sie
Senden, Posten oder sonst was damit machen aber sie kommt nicht
an. bevor ich hier noch die Tastatur vor verzewiflung esse, könntet
ihr mir vielleicht helfen.
hier ist der relevante code:

Von hier geht die message aus.
Delphi-Quellcode:
Procedure LeaveLocatedSet;Virtual;
Delphi-Quellcode:
Procedure TCustomItemEditor.LeaveLocatedSet;
Begin
  if Locatedset.col + Locatedset.Attributes.Count < Grid.ColCount then
  Begin
    Postmessage(WM_SetSelectedCell, Locatedset.Grid.Handle , LocatedSet.Col + LocatedSet.Attributes.Count, Row);
  end
  else
  Begin
    postmessage(WM_SetSelectedCell, Grid.Handle, Locatedset.Col + LocatedSet.Attributes.Count - 1 , Row);
    SendKeys(Grid.Handle,VK_TAB,true);
  end;
end;


und hier wird sie leider nicht empfangen
Delphi-Quellcode:
Procedure WMSetSelectedCell(var message: TMessage); message WM_SetSelectedCell;
Delphi-Quellcode:
Procedure Tadcstringgrid.WMSetSelectedCell(var message: TMessage);
Begin
  MoveColRow( Message.WParam, Message.LParam, False, True );
end;
Delphi-Quellcode:
Procedure Sendkeys(Handle :THandle; VK: Word;Post:Boolean = True);
begin
  if post then
    PostMessage(Handle, WM_KEYDOWN, VK ,$740000)
  else
    SendMessage(Handle, WM_KEYDOWN, VK ,$740000);
end;

Jens Schumann 8. Dez 2004 11:11

Re: Message kommt nicht an.
 
Hallo,
erst kommt das Handle, dann die Message
Delphi-Quellcode:
postmessage(Grid.Handle,WM_SetSelectedCell, Locatedset.Col + LocatedSet.Attributes.Count - 1 , Row);

QuickAndDirty 8. Dez 2004 11:19

Re: Message kommt nicht an.
 
Oh, Ups. :wall:
Danke :angel:


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:42 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz