问题描述
谁能帮我吧这些代码翻译成c#版?利用API函数实现隐藏和显示桌面图标2001-10-2614:52作者:出处:yesky责任编辑:源代码如下:PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLongPrivateDeclareFunctionShowWindowLib"user32"(ByValhwndAsLong,ByValnCmdShowAsLong)AsLongPrivateConstSW_HIDE=0PrivateConstSW_RESTORE=9隐藏桌面图标PrivateSubCommand1_Click()DimHwdAsLongDimrtnAsLongHwd=FindWindow("Progman",vbNullString)rtn=ShowWindow(Hwd,SW_HIDE)EndSub显示桌面图标PrivateSubCommand2_Click()DimHwdAsLongDimrtnAsLongHwd=FindWindow("Progman",vbNullString)rtn=ShowWindow(Hwd,SW_RESTORE)EndSub
解决方案
解决方案二:
privateconstSW_HIDE=0;privateconstSW_RESTORE=9;privatevoidCommand1_Click(){longHwd=0;longrtn=0;Hwd=FindWindow("Progman",Constants.vbNullString);rtn=ShowWindow(Hwd,SW_HIDE);}privatevoidCommand2_Click(){longHwd=0;longrtn=0;Hwd=FindWindow("Progman",Constants.vbNullString);rtn=ShowWindow(Hwd,SW_RESTORE);}
解决方案三:
api对谁都一样,对着写就行了