السلام عليكم
تعتبر المكتبةCoredll.dll القلب النابض لنظام التشغيل في حواسيب الكف والهواتف الذكية التابعة لمايكروسوفة.
أستعرض في هذا الموضوع أغلب الدوال التي توفرها هذه المكتبة والتي تيسر كثيرا تطوير عدة تطبيقات. الموضوع مرفق أيضا بتطبيقين أحدهما بالسي شارب والآخر بالفيزوال بازيك دوت نت لمزيد فهم وضائف هاته الدوال.
المدخلات
C#
protected static extern uint RegisterHotKey
[DllImport("coredll.dll")]
protected static extern uint UnregisterFunc1
[DllImport("coredll.dll")]
protected static extern short GetAsyncKeyState
[DllImport("coredll.dll")]VB
Protected Shared Function RegisterHotKey
<DllImport("coredll.dll")>
Protected Shared Function UnregisterFunc1
<DllImport("coredll.dll")>
Protected Shared Function GetAsyncKeyState
<DllImport("coredll.dll")>الذاكرة
C#
[DllImport("coredll.dll")]
extern public static IntPtr LocalAlloc
[DllImport("coredll.dll")]
extern public static IntPtr LocalFree
[DllImport("coredll.dll")]
extern public static IntPtr LocalReAllocVB
<DllImport("coredll.dll")>
Public Shared Function LocalAlloc
<DllImport("coredll.dll")>
Public Shared Function LocalFree
<DllImport("coredll.dll")>
Public Shared Function LocalReAllocحال الذاكرة
C#
[DllImport("CoreDll.dll")]
public static extern void GlobalMemoryStatus
[DllImport("CoreDll.dll")]
public static extern int GetSystemMemoryDivision
public class MEMORYSTATUS
VB
<DllImport("CoreDll.dll")>
Public Shared Sub GlobalMemoryStatus
<DllImport("CoreDll.dll")>
Public Shared Function GetSystemMemoryDivision
Public Class MEMORYSTATUS
مقياس الأداء
C#
public static extern int QueryPerformanceFrequency
[DllImport("CoreDll.dll")]
public static extern int QueryPerformanceCounter
[DllImport("CoreDll.dll")]VB
Public Shared Function QueryPerformanceFrequency
<DllImport("CoreDll.dll")>
Public Shared Function QueryPerformanceCounter
<DllImport("CoreDll.dll")>مستوى البطارية
C#
public class SYSTEM_POWER_STATUS_EX2
public class SYSTEM_POWER_STATUS_EX
[DllImport("coredll")]
public static extern uint GetSystemPowerStatusEx
[DllImport("coredll")]
public static extern uint GetSystemPowerStatusEx2VB
Public Class SYSTEM_POWER_STATUS_EX2
Public Class SYSTEM_POWER_STATUS_EX
<DllImport("coredll")>
Public Shared Function GetSystemPowerStatusEx
<DllImport("coredll")>
Public Shared Function GetSystemPowerStatusEx2SIP:Software Input Panel
C#
[DllImport("coredll.dll")]
public extern static void SipShowIM
[DllImport("coredll.dll")]
public extern static uint SipStatus();
public struct RECT
public class SIPINFO
[DllImport("coredll.dll")]
public extern static uint SipGetInfo
[DllImport("coredll.dll")]
public extern static uint SipSetInfoVB
<DllImport("coredll.dll")>
Public Shared Sub SipShowIM
<DllImport("coredll.dll")>
Public Shared Function SipStatus() As Integer
Public Structure RECT
Public Class SIPINFO
<DllImport("coredll.dll")>
Public Shared Function SipGetInfo
<DllImport("coredll.dll")>
Public Shared Function SipSetInfoSystem Reset: أعادة التشغيل الجهاز
C#
[DllImport("Coredll.dll")]
public extern static uint KernelIoControlVB
<DllImport("Coredll.dll")>
Public Shared Function KernelIoControlتوقيت الجهاز
C#
public struct SYSTEMTIME
[DllImport("coredll.dll")]
public extern static void GetSystemTime
[DllImport("coredll.dll")]
public extern static uint SetSystemTimeVB
<DllImport("coredll.dll")>
Public Shared Sub GetSystemTime
<DllImport("coredll.dll")>
Public Shared Function SetSystemTimeWave Out
Public Structure SYSTEMTIME
Wave Out
C#
[DllImport ("coredll.dll")]
protected static extern int waveOutGetNumDevs();
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveOutOpen
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutGetVolume
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutSetVolume
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveOutPrepareHeader
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveOutWrite
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveOutUnprepareHeader
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutClose
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutReset
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutPause
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutRestart
protected class MMTIME
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutGetPosition
protected class WAVEOUTCAPS
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveOutGetDevCapsVB
<DllImport("coredll.dll")>
Protected Shared Function waveOutGetNumDevs() As Integer
<DllImport("coredll.dll")>
Private Shared Function waveOutOpen
<DllImport("coredll.dll")>
Protected Shared Function waveOutGetVolume
<DllImport("coredll.dll")>
Protected Shared Function waveOutSetVolume
<DllImport("coredll.dll")>
Private Shared Function waveOutPrepareHeader
<DllImport("coredll.dll")>
Private Shared Function waveOutWrite
<DllImport("coredll.dll")>
Private Shared Function waveOutUnprepareHeader
<DllImport("coredll.dll")>
Protected Shared Function waveOutClose
<DllImport("coredll.dll")>
Protected Shared Function waveOutReset
<DllImport("coredll.dll")>
Protected Shared Function waveOutPause
<DllImport("coredll.dll")>
Protected Shared Function waveOutRestart
Protected Class MMTIME
<DllImport("coredll.dll")>
Protected Shared Function waveOutGetPosition
Protected Class WAVEOUTCAPS
<DllImport("coredll.dll")>
Protected Shared Function waveOutGetDevCaps
Wave In
C#
[DllImport ("coredll.dll")]
protected static extern int waveInGetNumDevs();
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveInOpen
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveInPrepareHeader
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveInUnprepareHeader
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveInClose
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveInReset
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveInStart
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveInStop
[DllImport ("coredll.dll")]
private static extern Wave.MMSYSERR waveInAddBuffer
protected class WAVEINCAPS
[DllImport ("coredll.dll")]
protected static extern Wave.MMSYSERR waveInGetDevCapsVB
<DllImport("coredll.dll")>
Protected Shared Function waveInGetNumDevs() As Integer
<DllImport("coredll.dll")>
Private Shared Function waveInOpen
<DllImport("coredll.dll")>
Private Shared Function waveInPrepareHeader
<DllImport("coredll.dll")>
Private Shared Function waveInUnprepareHeader
<DllImport("coredll.dll")>
Protected Shared Function waveInClose
<DllImport("coredll.dll")>
Protected Shared Function waveInReset
<DllImport("coredll.dll")>
Protected Shared Function waveInStart
<DllImport("coredll.dll")>
Protected Shared Function waveInStop
<DllImport("coredll.dll")>
Private Shared Function waveInAddBuffer
Protected Class WAVEINCAPS
<DllImport("coredll.dll")>
Protected Shared Function waveInGetDevCaps
نظام التشغيل
C#
[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();
[DllImport("CoreDll")]
public static extern IntPtr FindWindow
[DllImport("CoreDll")]
public static extern bool ShowWindowVB
<DllImport("coredll.dll")>
Public Shared Function GetCapture() As IntPtr
<DllImport("CoreDll")>
Public Shared Function FindWindow
<DllImport("CoreDll")>
Public Shared Function ShowWindowRegistry
C#
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegCreateKeyEx
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegDeleteKey
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegOpenKeyEx
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegQueryValueEx
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegSetValueEx
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegDeleteValue
[DllImport("coredll.dll", SetLastError=true)]
public static extern int RegCloseKeyVB
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegCreateKeyEx
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegDeleteKey
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegOpenKeyEx
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegQueryValueEx
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegSetValueEx
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegDeleteValue
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegCloseKeyالهاتف
C#
private static extern int PhoneMakeCall
[DllImport("Phone.dll")]
private static extern void PhoneOpenCallLog
[DllImport("Phone.dll")]
private static extern void PhoneCloseCallLog
[DllImport("Phone.dll")]
private static extern void PhoneGetCallLogEntry
[DllImport("Phone.dll")]
private static extern void PhoneSeekCallLog
[DllImport("Phone.dll")]VB
<DllImport("Phone.dll")> _
Private Shared Function PhoneMakeCall
<DllImport("Phone.dll")> _
Private Shared Sub PhoneOpenCallLog
<DllImport("Phone.dll")> _
Private Shared Sub PhoneCloseCallLog
<DllImport("Phone.dll")> _
Private Shared Sub PhoneGetCallLogEntry
<DllImport("Phone.dll")> _
Private Shared Sub PhoneSeekCallLog
المجلدات
C#
[DllImport("Coredll.dll")]
static extern int SHGetSpecialFolderPath
[DllImport("coredll.dll")]
public static extern bool GetDiskFreeSpaceExVB
<DllImport("Coredll.dll")> _
Shared Function SHGetSpecialFolderPath
<DllImport("coredll.dll")> _
Public Shared Function GetDiskFreeSpaceEx
لوحة المفاتيح
C#
[DllImport("Coredll.dll")]
static extern uint GetKeyboardStatus'VB
<DllImport("Coredll.dll")> _
Shared Function GetKeyboardStatus