findwindow function winuser h

番茄系统家园 · 2021-08-29 01:16:21

findwindow function  winuser h

,

,,?,,'stitleshowdifferentindifferentOS.

Hereismytestforyou:

[DllImport(user32.dll,SetLastError=true)]

staticexternIntPtrFindWindow(stringlpClassName,stringlpWindowName);

[DllImport(user32.dll,EntryPoint=FindWindow,SetLastError=true)]

staticexternIntPtrFindWindowByCaption(IntPtrZeroOnly,stringlpWindowName);

privatevoidbutton1_Click(objectsender,EventArgse)

{

IntPtrhandle=FindWindowByCaption(IntPtr.Zero,Untitled-Notepad);

Console.WriteLine(handle.ToString());

}

privatevoidbutton2_Click(objectsender,EventArgse)

{

IntPtrhandle=FindWindow(null,Untitled-Notepad);

Console.WriteLine(handle.ToString());

}

IcanuseeitherofthemtocatchthenotepadwhichIopeninmycomputer.Also,hereisthelinkabouthowtoinvoketheFindWindowmethodandFindWindowByCaptionmethodinC#:

http://www.pinvoke.net/default.aspx/user32/FindWindow.html

Ifanyunderstanding,pleasefeelfreeletmeknow.Thanks.

VinJin[MSFT]

MSDNCommunitySupport|Feedbacktous

GetorRequestCodeSamplefromMicrosoft

Pleaseremembertomarktherepliesasanswersiftheyhelpandunmarkthemiftheyprovidenohelp.

相关阅读

  • spy4winv0 窗口信息探测和管理工具 V0 20b 32位 64位中文版下载
  • windows 11 首次更新
  • findwindow function winuser h
  • 免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/post/52116.html
    猜你喜欢
    最新应用
    热门应用