vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
NEU! sevCoolbar 3.0 - Professionelle Toolbars im modernen Design!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Visual-Basic Einsteiger
Re: sendmessage 
Autor: VBStein
Datum: 29.09.08 18:03

Hai,

mit WM_COMMAND und der ControlID des Button.

Nach der MSDN:

WM_COMMAND Notification

--------------------------------------------------------------------------------

The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.

Syntax

WM_COMMAND

WPARAM wParam
LPARAM lParam;

Parameters

wParam
The high-order word specifies the notification code if the message is from a control. If the message is from an accelerator, this value is 1. If the message is from a menu, this value is zero.
The low-order word specifies the identifier of the menu item, control, or accelerator.

lParam
Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
Return Value

If an application processes this message, it should return zero.




Remarks

Accelerator keystrokes that select items from the window menu are translated into WM_SYSCOMMAND messages.

If an accelerator keystroke occurs that corresponds to a menu item when the window that owns the menu is minimized, no WM_COMMAND message is sent. However, if an accelerator keystroke occurs that does not match any of the items in the window's menu or in the window menu, a WM_COMMAND message is sent, even if the window is minimized.

If an application enables a menu separator, the system sends a WM_COMMAND message with the low-word of the wParam parameter set to zero when the user selects the separator.

Windows 98/Me, Windows 2000/XP: If a menu is defined with a MENUINFO.dwStyle value of MNS_NOTIFYBYPOS, WM_MENUCOMMAND is sent instead of WM_COMMAND.

Notification Requirements

Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

LoWord von wParam ist die ControlID und HiWord von wParam ist das Event, das von dem Button ausgeht.
In Deinem Fall also: BN_CLICK, gleichbedeutend mit 0 weshalb die ControlID für wParam von WM_COMMAND genügt. lParam kann leer bleiben.
Beachte, dass WM_COMMAND direkt dem nächst übergeordneten Window gesandt wird, nicht das Button selbst! Ein gewiefter Progger hat aber höchstwahrscheinlich das Event abgefangen ;) und prüft, ob tatsächlich das Button mit der Maus geklickt wurde - oder der Segen über SendMessage() kam.

Beitrag wurde zuletzt am 29.09.08 um 18:09:10 editiert.
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
sendmessage960Oly29.09.08 17:09
Re: sendmessage754VBStein29.09.08 18:03
Re: sendmessage688Oly29.09.08 18:32
Re: sendmessage729VBStein29.09.08 18:45
Re: sendmessage724Oly29.09.08 18:59
Re: sendmessage687VBStein29.09.08 19:03
Re: sendmessage718Oly29.09.08 19:13
Re: sendmessage717VBStein29.09.08 19:17
Re: sendmessage717Oly29.09.08 19:22
Re: sendmessage705VBStein29.09.08 20:00

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel