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 Label Geklickt - Message? (https://www.delphipraxis.net/25858-label-geklickt-message.html)

StefanDP 13. Jul 2004 23:34


Label Geklickt - Message?
 
Hi!
Ich erstell einige Labels mit Bildern drauf, ungefähr so:
Delphi-Quellcode:
      Field[x,y].hWnd := CreateWindowEx(0, 'STATIC', '',
                                        WS_VISIBLE or WS_CHILD or
                                        SS_BITMAP or SS_REALSIZEIMAGE,
                                        x*16 + 15, y*16 + 30, // Position
                                        10,10,           // Width and Height are ignored
                                        hWnd,
                                        Field[x,y].ID,   // <-- Die ID
                                        hInstance,
                                        nil);
      SendMessage(Field[x,y].hWnd, STM_SETIMAGE, IMAGE_BITMAP, hBmp);
Wie kann ich jetzt abfragen ob das Bild geklickt wurde?
Bei Buttons hat das immer schön mit WM_COMMAND - BN_CLICKED funktioniert.
Was ist hier anderst? Muss ich da mit Subclassing arbeiten oder was?

Weil
Delphi-Quellcode:
...
  WM_COMMAND:
    MessageBox(0,'','',0);
...
müsste ja wenigstens anspringen....

stefan

scp 14. Jul 2004 00:41

Re: Label Geklickt - Message?
 
Füg mal OR SS_NOTIFY zum Fensterstil hinzu, dann müsste es funktionieren.

StefanDP 14. Jul 2004 13:31

Re: Label Geklickt - Message?
 
Zitat:

Zitat von scp
Füg mal OR SS_NOTIFY zum Fensterstil hinzu, dann müsste es funktionieren.

Danke, funzt! :thuimb:

stefan


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:07 Uhr.

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