PDA

View Full Version : API&FindWindow&Atom?



houshmand
شنبه 11 مرداد 1382, 12:08 عصر
به راهنمای دلفی Windows SDK توجه کنید
<span dir=ltr>

FindWindow

The FindWindow function retrieves the handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows.

HWND FindWindow(

LPCTSTR lpClassName , // pointer to class name
LPCTSTR lpWindowName // pointer to window name
);


Parameters

lpClassName

Points to a null-terminated string that specifies the class name or is an atom that identifies the class-name string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpClassName ; the high-order word must be zero.
...

</span>
و
<span dir=ltr>

Atoms
In Microsoft ® Windows ® , an atom table is a system-defined table that stores strings and corresponding identifiers. An application places a string in an atom table and receives a 16-bit integer, called an atom , that can be used to access the string. A string that has been placed in an atom table is called an atom name .

</span>


:?: حالا این Atom چه بید؟من که نفهمیدم!

نکنه بمب اتمی! :mrgreen:

Kambiz
شنبه 11 مرداد 1382, 20:23 عصر
یک کلاس جدید مشتق شده از TStringList رو در نظر بگیرید که متدهای Add و Delete آن را به صورت زیر تغییر داده باشیم:

<span dir=ltr>Add(const S: String): Integer</span>
ایندکس خانه محتوی رشته S را پیدا کن.
اگر ایندکس خانه پیدا نشد، رشته S را به لیست اضافه کن و ایندکس آن را نگهدار.
تعداد ارجاع های خانه مربوی به ایندکس را یکی افزایش بده.
ایندکس را برگردان.

<span dir=ltr>Delete(Index: Integer)</span>
تعداد ارجاعهای خانه مربوط به ایندکس را یکی کاهش بده.
اگر تعداد رجاعها صفر بود خانه با ایندکس مربوطه را حذف کن.

عملکرد Atomها در ویندوز همانند کلاس بالاست و هر Atom ایندکس مربوط به رشته ای است که در لیست نگهداری می شود.

کامبیز

Mohammad_Mnt
یک شنبه 12 مرداد 1382, 22:59 عصر
به به ! آقا کامبیز خودمون ! خوش اومدی . :D