سلام
کسی می تونه بگه فرایندی که از فشاردن دکمه چپ ماوس تا اجرای یه برنامه پیش می اد چیه ...
میشه عمل کلیک کردن رو به صورت نرم افزاری انجام داد ...یعنی برنامه ایی بنویسی که رو یه دکمه فرمان کلیک رو اجرا کنه...
سلام
توی سیستم عامل به بعضی از عملکردها،کلمه رویداد(event ) اطلاق میشه!
فشار دادن دکمه چپ موس یا همون کلیک کردن،تحت عنوان رویداد mouse-button ازش یاد میشه که وقتی شما دکمه چپ موس رو فشار میدی،یه سیگنال الکتریکی به سمت مادربورد فرستاده میشه و طی عملیاتی...،این رویداد سیستم عامل فراخونی میشه و عملیات مربوط به اون اجرا میشه!
شما حتی در برنامه نویسی هم (مثلاً تو یه برنامه C ) می تونی از این رویداد استفاده کنی و مثلاً با کشیدن موس روی یه قسمت از خروجی برنامه ات،یه کار سفارشی انجام بشه!
البته این موضوع،بحث نسبتاً مفصلیه و برای تکمیل اون پیشنهاد می کنم طرز کار موس های نوری،موس های با گوی غلتان و ...رو مطالعه کنی تا با فرآیند دریافت فرمان و ارسال سیگنال هم آشنا بشی!
حالا من یه کوچولو در مورد رویداد تو برنامه نویسی توضیح می دم:
کنترلها،عناصری هستن که تو برنامه ویژوال C++ از اونا استفاده میشه،شکل زیر:
هر کنترل ویژوال C++ یه تعدادی رویداد مربوط به خودش داره،مثلاً ایجاد شدن کنترل،کلیک کردن موس،دبل کلیک،فشار دادن کلیدی از صفحه کلید و...
هر کدوم از رویدادها هم می تونن دارای روال پاسخگویی مخصوص به خودشون باشن.
مثلاً رویداد WM-MOUSEMOVE : وقتی کرسر روی کادر محاوره ای MFC حرکت کنه،این رویداد فراخونی میشه!
رویدادهای مربوط به ماوس،حدوداً 8 تاس،مثلاً وقتیکه دکمه چپ ماوس فشار داده بشه،رویداد WM-LBUTTONDOWN فراخونی میشه که برای بکارگیری اون تو برنامه باید تابع این رویداد به برنامه اضافه بشه.
در ضمن جدولای زیرم دقیقاً از کتابخونه MSDN کپی کردم:
Microsoft DirectX 8.1 (C++)
Video Control Events
This topic applies to Windows XP Home Edition and Windows XP Professional only.
This section lists the methods (also known as event handlers) that applications must implement to handle events from the video control and its associated objects. When an event occurs, the object calls the event handler in your application, if the handler is implemented. No event handler is required to be implemented, although some provide the only way to achieve desired functionality.
Event
Description
Click
Called by the MSVidCtl object when a user clicks anywhere on the video rectangle.
DblClick
Called by the MSVidCtl object when a user double-clicks on the video rectangle.
Error
Called by the MSVidCtl object when an error occurs in the Video Control or in the underlying filter graph. Currently, no errors are defined for this event.
KeyDown
Called by the MSVidCtl object when the user presses a key.
KeyPress
Called by the MSVidCtl object when the user presses and releases a key.
KeyUp
Called by the MSVidCtl object when the user releases a key.
MouseDown
Called by the MSVidCtl object when the user presses the left mouse key down while the mouse pointer is over the Video Control.
MouseMove
Called by the MSVidCtl object when the user moves the mouse pointer over the Video Control.
MouseUp
Called by the MSVidCtl object when the user releases the left mouse button while the mouse pointer is over the Video Control.
OverlayUnavailable
Called by the Video Mixing Renderer when the hardware overlay surface is unavailable.
StateChange (MSVidCtl)
Called by the Video Control when the state of the control changes.
StateChange (IMSVidDevice)
Called by a device object when the state of the device changes.
TuneChanged
Called by the currently active tuner device when it cannot tune to the requested channel or frequency.