本文整理汇总了C++中Registry::read_reg方法的典型用法代码示例。如果您正苦于以下问题:C++ Registry::read_reg方法的具体用法?C++ Registry::read_reg怎么用?C++ Registry::read_reg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::read_reg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitInstance
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
bool InitInstance(HINSTANCE hInstance, int nCmdShow)
{
Registry reg;
int max_x, max_y;
HWND hWnd;
HMENU sys_menu;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
g_hWnd = hWnd; // store hwnd in our global variable
if (!hWnd)
return FALSE;
// Add items to system menu
sys_menu = GetSystemMenu(g_hWnd, FALSE);
AppendMenu(sys_menu, MF_SEPARATOR, 0, "");
AppendMenu(sys_menu, MF_STRING, sys_menu_item_open, "&Open...\tCtrl-O");
// Restore window location and size
reg.read_reg();
max_x = GetSystemMetrics(SM_CXSCREEN) - GetSystemMetrics(SM_CXICON);
max_y = GetSystemMetrics(SM_CYSCREEN) - GetSystemMetrics(SM_CYICON);
SetWindowPos(hWnd, HWND_TOP, min(reg.main_x, max_x), min(reg.main_y, max_y), 320, 240, SWP_SHOWWINDOW);
UpdateWindow(hWnd);
cur_frame = -1;
cur_working_path[0] = '\0';
return true;
}
示例2: DestroyWindow
bool DestroyWindow()
{
Registry reg;
WINDOWPLACEMENT wp;
// Save window position
reg.read_reg();
GetWindowPlacement(g_hWnd, &wp);
reg.main_x = wp.rcNormalPosition.left;
reg.main_y = wp.rcNormalPosition.top;
reg.write_reg();
return true;
}