You are on page 1of 1

Tng hp hm API ca Windows dng vi C#

FindWindow: Tm kim ca s chng trnh trong windows [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); FindWindowEx: Tm kim ca s con khi bit c Handle ca ca s cha. [DllImport("user32.dll")] public static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string lpsz1, string lpsz2); SetForegroundWindow: Active mt ca s chng trnh. [DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd); SendMessageW: gi thng ip n ca s ng dng (thng ip unicode) [DllImport("user32.dll")] public static extern IntPtr SendMessageW(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); GetWindowText: ly caption ca ca s ng dng [DllImport("user32.dll")] public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); Cc hm v menu GetMenu: ly menu ca ca s ng dng. [DllImport("user32.dll")] public static extern IntPtr GetMenu(IntPtr hwnd); GetSubMenu: ly submenu khi c gi tr ca Menu [DllImport("user32.dll")] public static extern IntPtr GetSubMenu(IntPtr hMenu, int nPos); GetMenuItemID: ly Id ca menu trong Submenu [DllImport("user32.dll")] public static extern IntPtr GetMenuItemID(IntPtr hMenu, int nPos); EnableMenuItem: set Enable ca menu(tham s wEnable c gi tr: 1 hoc 0) [DllImport("user32.dll")] public static extern IntPtr EnableMenuItem(IntPtr hMenu, IntPtr wIDEnableItem, int wEnable);

TranHaDucHuy (I11c)

You might also like