C#中如何调用API 使其达到 调用系统记事本中 查找和替换 对话框的效果
解决方案 »
- winfrom实现方向键(上下左右)控制焦点
- Dictionary<List<byte>,int>如何查找?
- 关于webservice的想法,有点不太清楚
- 怎么判断程序已经运行
- 如何动态显示图片而网页面不进行刷新操作?
- treeview 高手请指教!
- 为什么总报这样的错误?"无法打开计算机“otherhost”上的服务控制管理器。此操作可能需要其他特权。"
- .net中com+扮演什么角色?.net是否有新的中间件管理方案????
- delegate只能在类定义里面声明吗? 不能再函数里面声明?
- IsClientScriptBlockRegistered用在类class1.cs中怎么用?
- C#怎么取外部程序的listview,treeview的内容?
- schema.ini(ODBC Text Driver) 的问题
api大全上查查吧.
这个容易学吗?
System.UInt32 uiMsg,
System.UInt32 wParam,
System.UInt32 lParam
); [StructLayout(LayoutKind.Sequential)]
public struct FINDREPLACE
{
public System.UInt32 lStructSize;
public System.IntPtr hwndOwner;
public System.IntPtr hInstance;
public System.UInt32 Flags;
public string lpstrFindWhat;
public string lpstrReplaceWith;
public System.UInt16 wFindWhatLen;
public System.UInt16 wReplaceWithLen;
public System.UInt32 lCustData;
public FRHookProc lpfnHook;
public String lpTemplateName; }
class Win32Wrapper
{
[DllImport("comdlg32.dll",CharSet=CharSet.Ansi)]
public extern static IntPtr FindText( ref FINDREPLACE fdr); }
fr.lStructSize = (UInt32)Marshal.SizeOf(fr);
fr.hwndOwner = this.Handle;
fr.Flags = 0;
fr.lpstrFindWhat = "what is";
fr.wFindWhatLen = 80;
Win32Wrapper.FindText( ref fr);
谢谢您!
下面最后一句 Win32Wrapper.FindText( ref fr);
编译不过去 能不能把您写的程序都加个注释 我是新人 看不明白 谢谢了!
{
[DllImport("comdlg32.dll",CharSet=CharSet.Ansi)]
public extern static IntPtr FindText( ref FINDREPLACE fdr); }在DllImport中加入EntryPoint定义:
[DllImport("comdlg32.dll",CharSet=CharSet.Ansi,EntryPoint="FindTextA")]