⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 network.cpp

📁 一个国人自己实现图像库的程序(有参考价值)
💻 CPP
字号:
#include "stdafx.h"
#include "..\Include\C_Network.h"

//===================================================================
typedef DWORD (WINAPI *PROCSYSTEMFOCUSDIALOG)(HWND,UINT,LPWSTR,DWORD,LPBOOL,LPWSTR,DWORD);
#define FOCUSDLG_DOMAINS_ONLY             1
#define FOCUSDLG_SERVERS_ONLY             2
#define FOCUSDLG_SERVERS_DOMAINS          3
#define FOCUSDLG_BROWSE_LOGON_DOMAIN      0x00010000
#define FOCUSDLG_BROWSE_WKSTA_DOMAIN      0x00020000
#define FOCUSDLG_BROWSE_OTHER_DOMAINS     0x00040000
#define FOCUSDLG_BROWSE_TRUSTING_DOMAINS  0x00080000
#define FOCUSDLG_BROWSE_WORKGROUP_DOMAINS 0x00100000
#define FOCUSDLG_BROWSE_ALL_DOMAINS       (  \
        FOCUSDLG_BROWSE_LOGON_DOMAIN       | \
        FOCUSDLG_BROWSE_WKSTA_DOMAIN       | \
        FOCUSDLG_BROWSE_OTHER_DOMAINS      | \
        FOCUSDLG_BROWSE_TRUSTING_DOMAINS   | \
        FOCUSDLG_BROWSE_WORKGROUP_DOMAINS )
//===================================================================
BOOL  fooChooseDomainDlg (HWND hParent, LPWSTR wCompName, DWORD dwBufLen)
{
	PROCSYSTEMFOCUSDIALOG SystemFocusDialog ;
    HINSTANCE             hLibrary ;
    DWORD                 dwError ;

	hLibrary = ::LoadLibrary (TEXT("ntlanman.dll")) ;
	if (hLibrary == NULL)
       return FALSE ;

	SystemFocusDialog = (PROCSYSTEMFOCUSDIALOG) ::GetProcAddress (hLibrary, "I_SystemFocusDialog") ;

    if (SystemFocusDialog == NULL)
	{
        FreeLibrary (hLibrary) ;
        return FALSE ;
	}

	BOOL	bOK ;
	dwError = SystemFocusDialog (hParent, // Handle to the owner window for the dialog box.
                                 FOCUSDLG_SERVERS_DOMAINS|FOCUSDLG_BROWSE_ALL_DOMAINS, // Flags specifying the options for the dialog box.
                                 wCompName, // Address of a buffer to receive the display name of the computer selected by the user (UNICODE!).
                                 dwBufLen, // The size of the buffer wszName in characters.
                                 &bOK, // Pointer to a boolean variable that receives TRUE if the OK button was pressed by the user.
                                 NULL, // Address of an unicode string containing the path, if necessary, and the name of the Help file.
                                 0) ; // Help context identifier.
	FreeLibrary (hLibrary) ;
    if (dwError != NO_ERROR)
        return FALSE ;
	return bOK ;
}
//===================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -