本文整理汇总了C++中MyRegisterClass函数的典型用法代码示例。如果您正苦于以下问题:C++ MyRegisterClass函数的具体用法?C++ MyRegisterClass怎么用?C++ MyRegisterClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MyRegisterClass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tWinMain
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: 在此放置代码。
MSG msg;
HACCEL hAccelTable;
// 初始化全局字符串
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_SOCKETSEND, szWindowClass, MAX_LOADSTRING);
LoadString(hInstance, IDS_BUTTON_TITLE, szButton, MAX_LOADSTRING);//by wxjia
MyRegisterClass(hInstance);
// 执行应用程序初始化:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SOCKETSEND));
// 主消息循环:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
示例2: wWinMain
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// Initialize global strings
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadStringW(hInstance, IDC_NOWUGO, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_NOWUGO));
MSG msg;
// Main message loop:
while (GetMessage(&msg, nullptr, 0, 0))
{
if (IsDialogMessage(msg.hwnd, &msg)) continue;
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
示例3: WinMain
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
HRESULT hr = CoInitialize(NULL);
if (FAILED(hr))
{
return FALSE;
}
// Initialize global strings.
LoadString(hInstance, IDS_APP_TITLE, wszTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_FONTCONTROL, wszWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization.
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
// Main message loop.
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
CoUninitialize();
return (int) msg.wParam;
}
示例4: WinMain
// WinMain
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MyRegisterClass(hInstance);
if (!InitInstance (hInstance, nCmdShow))
return false;
MSG msg;
while(true)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
if(!GetMessage(&msg, NULL, 0, 0))
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
if(render)
{
HDC hDC = GetDC(msg.hwnd);
if(hDC)
{
wglMakeCurrent(hDC, openGLRenderContext);
Render();
SwapBuffers(hDC);
wglMakeCurrent(0, 0);
}
ReleaseDC(msg.hwnd, hDC);
}
}
}
return (int)msg.wParam;
}
示例5: _tWinMain
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// TODO //Put in code here
MSG msg;
HACCEL hAccelTable;
//Intialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_USINGOPENCV, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// intialize application
if (!InitInstance(hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_USINGOPENCV);
//main message loop
while (GetMessage(&msg, NULL, 0, 0))
{
// if(!IsDialogMessage(dialog_handle,&msg))//EXTRA LINE OF CODE FOR MODELESS DIALOG MESSAGES // see [REF]
//{//IF 1
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
//}//END IF 1
}
return (int)msg.wParam;
}
示例6: _tWinMain
int APIENTRY _tWinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_FLUXCAPACITORCPUMETER, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_FLUXCAPACITORCPUMETER));
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
示例7: WinMain
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
HWND hwnd = FindWindow(szClass, szClass);
if (hwnd)
{
SendMessage(hwnd, WM_DESTROY, 0, 0);
MessageBox(0, _T("现在程序已经停止运行。"), szClass, MB_OK + MB_ICONINFORMATION);
return 0;
}
//注册程序类、窗口
MyRegisterClass(hInstance);
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
//WH_MOUSE_LL
g_hook = (HWND)SetWindowsHookEx(WH_MOUSE_LL, LowLevelMouseProc, hInstance, 0);
if (g_hook == NULL)
{
MessageBox(0, _T("SetWindowsHookEx Failed!"), szClass, MB_OK);
return 0;
}
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
//
UnhookWindowsHookEx((HHOOK)g_hook);
return msg.wParam;
}
示例8: wWinMain
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int nCmdShow)
{
MSG msg;
hInst = hInstance;
CDCurrentDirectory();
SetEenvironment();
//ParseProxyList();
MyRegisterClass(hInstance);
if (!InitInstance (hInstance, SW_HIDE))
{
return FALSE;
}
CreateConsole();
ExecCmdline();
//ShowTrayIcon(GetWindowsProxy());
ShowTrayIcon();
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
示例9: __declspec
__declspec(dllexport) int Main(CApplicationProto* pApp)
{
g_app = pApp;
MSG msg;
g_Instance = GetModuleHandle(NULL);
MyRegisterClass(g_Instance);
// Perform application initialization:
if (!InitInstance (g_Instance, SW_SHOW))
{
return FALSE;
}
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
}
示例10: nativeLoop
int nativeLoop(void) {
HINSTANCE hInstance = GetModuleHandle(NULL);
TCHAR* szWindowClass = TEXT("SystrayClass");
MyRegisterClass(hInstance, szWindowClass);
hWnd = InitInstance(hInstance, FALSE, szWindowClass); // Don't show window
if (!hWnd) {
return EXIT_FAILURE;
}
if (!createMenu() || !addNotifyIcon()) {
return EXIT_FAILURE;
}
systray_ready(0);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
if (msg.message == WM_DONE) {
return EXIT_SUCCESS;
};
DispatchMessage(&msg);
}
return EXIT_SUCCESS;
}
示例11: WinMain
//****Winmain函数,程序入口点函数**************************************
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
MyRegisterClass(hInstance);
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
//消息循环
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
示例12: _tWinMain
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: colocar código aquí.
MSG msg;
HACCEL hAccelTable;
// Inicializar cadenas globales
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_WIN32PROJECT1, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Realizar la inicialización de la aplicación:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WIN32PROJECT1));
// Bucle principal de mensajes:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
示例13: wWinMain
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// »нициализаци¤ глобальных строк
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadStringW(hInstance, IDC_LAB2NEXT, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// ¬ыполнить инициализацию приложени¤:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
gHDC = GetDC(hWnd);
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_LAB2NEXT));
MSG msg;
// ÷икл основного сообщени¤:
while (GetMessage(&msg, nullptr, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
示例14: InitInstance
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
TCHAR szTitle[MAX_LOADSTRING]; // title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name
g_hInst = hInstance; // Store instance handle in our global variable
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_PLAYER, szWindowClass, MAX_LOADSTRING);
if (!MyRegisterClass(hInstance, szWindowClass))
{
return FALSE;
}
hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
if (g_hWndCommandBar)
{
CommandBar_Show(g_hWndCommandBar, TRUE);
}
return TRUE;
}
示例15: WinMain
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//////////////////////////////////////////////////////////////////////////
// BEGINTEST100111 FFL_DUMP
ffl_dump_unexception_filter::install( ffl_dump_level_heavy );
// ENDTEST100111 FFL_DUMP
//////////////////////////////////////////////////////////////////////////
InitLanguageFromResource( hInstance );
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_CORESERVER, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
if (!InitInstance (hInstance, nCmdShow))
return FALSE;
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
ExitInstance();
return msg.wParam;
}