ايران ويج

نسخه‌ی کامل: این چند تا تابع API چیکار میکنن؟
شما در حال مشاهده‌ی نسخه‌ی متنی این صفحه می‌باشید. مشاهده‌ی نسخه‌ی کامل با قالب بندی مناسب.
سلام
چند تا سوال دارم(چندین تا!!!Shy)
این توابع چیکار میکنن:
GetPixel
CreateRectRgn
CombineRgn Lib
اگه میشه یه کم توضیح بدین چیکر میکنن بعد یه توضیح کوچیک راجع به پارامتر هاشون هم بدین و اگه جا داره مثال هم بزنید!!( چقدر کم توقع هستم)Whistle
ممنون
چند تا دیگه هم هست بعدا میپرسم!Rolleyes
کد:
:GetPixel
The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.

Declare :
Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

Parameters:
· hdc
Identifies the device context.

· nXPos
Specifies the logical x-coordinate of the pixel to be examined.

· nYPos
Specifies the logical y-coordinate of the pixel to be examined.

CreateRectRgn:
The CreateRectRgn function creates a rectangular region.
Declare:
Declare Function CreateRectRgn Lib "gdi32" Alias "CreateRectRgn" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Parameters:
· nLeftRect
Specifies the x-coordinate of the upper-left corner of the region.

· nTopRect
Specifies the y-coordinate of the upper-left corner of the region.

· nRightRect
Specifies the x-coordinate of the lower-right corner of the region.

· nBottomRect
Specifies the y-coordinate of the lower-right corner of the region.

CombineRgn:
The CombineRgn function combines two regions and stores the result in a third region. The two regions are combined according to the specified mode.

Declare:
Declare Function CombineRgn Lib "gdi32" Alias "CombineRgn" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long

Parameters:

· hrgnDest
Identifies a new region with dimensions defined by combining two other regions. (This region must exist before CombineRgn is called.)

· hrgnSrc1
Identifies the first of two regions to be combined.

· hrgnSrc2
Identifies the second of two regions to be combined.

· fnCombineMode
Specifies a mode indicating how the two regions will be combined. This parameter can be one of the following values:
RGN_AND
Creates the intersection of the two combined regions.
RGN_COPY
Creates a copy of the region identified by hrgnSrc1.
RGN_DIFF
Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
RGN_OR
Creates the union of two combined regions.
RGN_XOR
Creates the union of two combined regions except for any overlapping areas.
سلام.
آقا پوریا ممنون. البته دو تا از این توابع رو گشتم پیدا کردم. شما هم که کمک کردی دیگه گرفتم. حالا 2-3 تا دیگه اینهاازاسمشونم نفهمیدم چیکار میکنه:
SendMessage
ReleaseCapture
DeleteObject
باید ببخشید کتاب در این زمینه ندارم.سی دی های MSDN من رو هم یکی از دوستان زحمت کشیدند نابود کردند. این چند تا رو هم جواب بدید ممنون میشم.
کد:
SendMessage:
The SendMessage function sends the specified message to a window or windows. The function calls the window procedure for the specified window and does not return until the window procedure has processed the message. The PostMessage function, in contrast, posts a message to a thread’s message queue and returns immediately.

Declare:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Parameters:
· hWnd
Identifies the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.

· Msg
Specifies the message to be sent.

· wParam
Specifies additional message-specific information.

· lParam
Specifies additional message-specific information.

ReleaseCapture:
The ReleaseCapture function releases the mouse capture from a window in the current thread and restores normal mouse input processing.
:Declare
Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Long

Parameters:
Just Call ReleaseCapture

DeleteObject :
The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid.

Declare:
Declare Function DeleteObject Lib "gdi32" Alias "DeleteObject" (ByVal hObject As Long) As Long

Parameters:

· hObject
Identifies a logical pen, brush, font, bitmap, region, or palette.
يه برنامه هست به نام API-Guide توش همه ی api ها هستش. فکر ميکنم که يکی از دوستان هم همينجا توی سايت گزاشته باشه. بگردی پيدا ميکنی.
موفق باشیQuestion
ممنونم.تو سایت AllAPI پیداش کردمShy