資源描述:
《windows API c#調(diào)用》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、WindowsAPI用C#調(diào)用1.設(shè)置鉤子[DllImport("user32",EntryPoint="SetWindowsHookEx")]publicstaticexternintSetWindowsHookExA(intidHook,intlpfn,inthmod,intdwThreadId)2.根據(jù)窗口名找到窗口句柄[DllImport("user32",EntryPoint="FindWindow")]publicstaticexternintFindWindowA(stringlpCla
2、ssName,stringlpWindowName)3[DllImport("user32")]publicstaticexternintGetWindowRect(inthwnd,refRECTlpRect)3.[DllImport("user32")]publicstaticexternintActivateKeyboardLayout(intHKL,intflags)4.[DllImport("user32")]publicstaticexternintAdjustWindowRect(refR
3、ECTlpRect,intdwStyle,intbMenu)5.[DllImport("user32")]publicstaticexternintAdjustWindowRectEx(refRECTlpRect,intdsStyle,intbMenu,intdwEsStyle)6.[DllImport("user32")]publicstaticexternintAnyPopup(inthwnd)7.[DllImport("user32")]publicstaticexternintArrangeI
4、conicWindows(inthwnd)8.[DllImport("user32")]publicstaticexternintAttachThreadInput(intidAttach,intidAttachTo,intfAttach)9.[DllImport("user32")]publicstaticexternintBeginDeferWindowPos(intnNumWindows)10.[DllImport("user32")]publicstaticexternintBeginPain
5、t(inthwnd,refPAINTSTRUCTlpPaint)11.[DllImport("user32")]publicstaticexternintBringWindowToTop(inthwnd)12.[DllImport("user32")]publicstaticexternintBroadcastSystemMessage(intdw,refintpdw,intun,intwParam,intlParam)13.[DllImport("user32",EntryPoint="CallMs
6、gFilter")]publicstaticexternintCallMsgFilterA(refMSGlpMsg,intnCode)14.CallNextHookEx15.[DllImport("user32",EntryPoint="CallWindowProc")]publicstaticexternintCallWindowProcA(intlpPrevWndFunc,inthwnd,intMSG,intwParam,intlParam)16.[DllImport("user32")]publ
7、icstaticexternshortCascadeWindows(inthwndParent,intwHow,RECTlpRect,intcKids,refintlpKids)17.[DllImport("user32")]publicstaticexternintChangeClipboardChain(inthwnd,inthWndNext)18.ChangeDisplaySettings19.[DllImport("user32",EntryPoint="ChangeMenu")]public
8、staticexternintChangeMenuA(inthMenu,intcmd,stringlpszNewItem,intcmdInsert,intflags)20.[DllImport("user32",EntryPoint="CharLower")]publicstaticexternstringCharLowerA(stringlpsz)22.[DllImport("user32",EntryPoint="CharLowerBuff")]pu