AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi nonVCL (Edit Control) ESC-Notification an Parent
Thema durchsuchen
Ansicht
Themen-Optionen

nonVCL (Edit Control) ESC-Notification an Parent

Ein Thema von sirius · begonnen am 18. Mär 2007 · letzter Beitrag vom 24. Mär 2007
 
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#2

Re: nonVCL (Edit Control) ESC-Notification an Parent

  Alt 18. Mär 2007, 21:25
Da hilft nur Subclassen und auf WM_KEYDOWN usw. zu reagieren. Ich habe mal ein Edit gesubclassed (wattn deutsch ), damit man dort nur Ziffern eingeben konnte:
WndProc des Edits:
Delphi-Quellcode:
function EditWndProc(hEdit, uMsg, wParam, lParam: DWORD): DWORD; stdcall;
begin
  Result := 0;
  case uMsg of
    WM_CHAR:
      case Byte(wParam) of
        Byte('0')..Byte('9'),
          Byte(','), VK_DELETE,
          VK_BACK:
          CallWindowProc(OldWndProc, hEdit, uMsg, wParam, lParam);
      end;
  else
    Result := CallWindowProc(OldWndProc, hEdit, uMsg, wParam, lParam);
  end;
end;
WndProc für das Edit umbiegen:
OldWndProc := Pointer(SetWindowLong(GetDlgItem(hWnd, 103), GWL_WNDPROC, Integer(@EditWndProc)));
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:25 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