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

📄 netmsg.h

📁 vc++6.0开发网络典型应用实例导航 1. 本光盘提供了本书中所有的实例源程序文件。 2. 附录文件夹下是Winsock 函数参考以及错误码列表
💻 H
字号:
// Netmsg.h : main header file for the NETMSG application
//

#if !defined(AFX_NETMSG_H__04E56ED4_6B1B_4AAE_8A99_72DD50CED7FC__INCLUDED_)
#define AFX_NETMSG_H__04E56ED4_6B1B_4AAE_8A99_72DD50CED7FC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#define VER 1202

#include "resource.h"       // main symbols
#include "MSNButton.h"
#include "Exports.h"
#include "NetmsgView.h"

#define WRITE_DEBUG1(text) \
	{ \
		FILE *__f = fopen("debug.txt", "a"); \
		fputs(text, __f); \
		fputs("\n", __f); \
		fclose(__f); \
	}

#define WRITE_DEBUG2(text1, text2) \
	{ \
		FILE *__f = fopen("debug.txt", "a"); \
		fprintf(__f, text1, text2); \
		fputs("\n", __f); \
		fclose(__f); \
	}


class CContactView;

#define MENU_SEND 1
#define MENU_BLOCK 2
#define MENU_UNBLOCK 3
#define MENU_NEWCONTACT 4
#define MENU_DELETE 5
#define MENU_SENDFILE 6
#define MENU_AWAY 7
#define MENU_APPEAROFFLINE 8
#define MENU_CHANGENAME 9
#define MENU_SETNORMAL 10

#define MESSAGE_AWAY 1
#define MESSAGE_CHANGENAME 2

#define WM_SOCKCONNECT WM_USER + 100
#define WM_SENDTHISMESSAGE WM_USER + 101
#define WM_DESTROYME WM_USER + 102
#define WM_BLOCKTHISCONTACT WM_USER + 103
#define WM_TYPENOTIFY WM_USER + 104
#define WM_CANCELXFER WM_USER + 105
#define WM_REQUESTXFER WM_USER + 106
#define WM_KILLXFER WM_USER + 107
#define WM_TRANSFERCOMPLETE WM_USER + 108
#define WM_RECEIVEDMESSAGE WM_USER + 109
#define WM_UPDATEMYFONT WM_USER + 110
#define WM_KILL WM_USER + 111
#define WM_APPACTIVATE WM_USER + 112

#define COL_DISABLED 1
#define COL_LIGHTITEMS 2
#define COL_LINEFRAMES 3
#define COL_NOTIFYTEXT 4
#define COL_NORMALTEXT 5
#define COL_BTNOVER 6
#define COL_BTNACTIVE 7
#define COL_BTNBACK 8

#define WIN_WINNT	0x001
#define WIN_WINNT4	0x002
#define WIN_WIN2K	0x004
#define WIN_WINXP	0x008

#define WIN_WIN32	0x010
#define WIN_WIN32S	0x020
#define WIN_WIN95	0x040
#define WIN_WIN98	0x080
#define WIN_WINME	0x100

#define OSVER GetApp()->dwOsVer

char *FormatBytes(unsigned long);
void nopath(char *, const char *);

class CContact;
class CNetSocket;
class CMainFrame;

void SendMyOnline(CContact *);
void SendToAllOnline(bool, bool, char *, ...);
int uital2(void *, size_t, char *);
int uifal2(void *, size_t, char *);
int strrpl(char *, const char *, const char *);
bool IsContact(CContact *);
bool IsSocket(CNetSocket *);
char *nstrdup(const char *);

void DrawCorner(CDC *, int x, int y, COLORREF, int, bool = false, COLORREF = RGB(255, 255, 255));
void DrawBitmap(CDC * pDC, CRect rc, UINT nFlags, CBitmap *pBitmap);

COLORREF GetColor(int);
void SetColor(int nColor, COLORREF crColor);

void RedrawEntireApplication();

class CNetmsgApp : public CWinApp
{
public:
	CNetmsgApp();
	CContactView *View;
	CNetmsgView *MainView;
	CMainFrame *MainFrame;

	COLORREF crNotifyText;
	COLORREF crNormalText;
	COLORREF crLineFrames;
	COLORREF crDisabled;
	COLORREF crLightItems;
	COLORREF crBtnBack;
	COLORREF crBtnActive;
	COLORREF crBtnOver;

	void SetOsInfo();

	DWORD dwOsVer;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNetmsgApp)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL
	COleTemplateServer m_server;
	void CheckExistingWindow();
	CList <class CNetSocket *, class CNetSocket *> Sockets;
// Implementation
	//{{AFX_MSG(CNetmsgApp)
	afx_msg void OnAppAbout();
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

inline CNetmsgApp *GetApp()
{
	return (CNetmsgApp *)AfxGetApp();
}


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NETMSG_H__04E56ED4_6B1B_4AAE_8A99_72DD50CED7FC__INCLUDED_)

⌨️ 快捷键说明

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