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

📄 stutil.h

📁 WinCE开发技巧与实例的配套源码(chapter2)
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////
// File name:      STUtil.h
// 


#if !defined(AFX_STUTIL_H__C403F6AF_B3FA_4BDA_A15F_7DA68EB6E3BF__INCLUDED_)
#define AFX_STUTIL_H__C403F6AF_B3FA_4BDA_A15F_7DA68EB6E3BF__INCLUDED_

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


typedef BOOL (__stdcall *UnregisterFunc1Proc)( UINT, UINT );

/////////////////////////////////////////////////////////////////////////////
// This class is a container of some useful functions
// implemented as static methods.

class CSTUtil  
{
public:
	// Creates unique GUID. But because this function uses
	// random generator instead of computer id it cannot be
	// garanted that generated GUID is unique in the world.
	// Returns S_OK if GUID was successefully generated
	static HRESULT CoCreateGuid(GUID  *pguid);

	// Starts the given executable file with the given command line
	// arguments. Returns TRUE if the executable file was started successefully
	// and FALSE in case of some error.
	// Note: you should pass full path to the executable file.
	static BOOL RunExecutable(CString strExecutableFilePath, CString strArguments = _T(""));

	// Starts the given executable file with the given command line
	// arguments. Returns TRUE if the executable file was started successefully
	// and FALSE in case of some error. This methos waits until the start 
	// program will be finished.
	// Note: you should pass full path to the executable file.
	static BOOL RunExecutableAndWait(CString strExecutableFilePath, CString strArguments = _T(""));

	// Returns full file name of the program (currently run executable file).
	static CString GetProgramFilePath();

	// Returns folder that contains the program file (currently run executable file).
	static CString GetProgramFolder();

	//Creates utils class. Loads necessary dlls.
	CSTUtil();

	//Unoads used dlls.
	~CSTUtil();

	//Redirect hardware key to the given window. Fixes bug in standard
	//RegisterHotKey function (uses UnregisterFunc1 function from coredll.dll).
	//See help for standard RegisterHotKey function for parameters values.
	BOOL RegisterHotKey(HWND hWnd, int id, UINT vk);


private:
	static DWORD m_wClockSequenceBase;
	static WORD m_wDeviceId1;
	static WORD m_wDeviceId2;
	static WORD m_wDeviceId3;

	HINSTANCE m_hCoreDll;
	UnregisterFunc1Proc m_procUndergisterFunc;
};




#endif // !defined(AFX_STUTIL_H__C403F6AF_B3FA_4BDA_A15F_7DA68EB6E3BF__INCLUDED_)

⌨️ 快捷键说明

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