您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CreateWindowExW函数代码示例

51自学网 2021-06-01 20:15:27
  C++
这篇教程C++ CreateWindowExW函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CreateWindowExW函数的典型用法代码示例。如果您正苦于以下问题:C++ CreateWindowExW函数的具体用法?C++ CreateWindowExW怎么用?C++ CreateWindowExW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CreateWindowExW函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CreateWindowExW

void NzWindowImpl::WindowThread(HWND* handle, DWORD styleEx, const wchar_t* title, DWORD style, unsigned int x, unsigned int y, unsigned int width, unsigned int height, NzWindowImpl* window, NzMutex* mutex, NzConditionVariable* condition){	HWND& winHandle = *handle;	winHandle = CreateWindowExW(styleEx, className, title, style, x, y, width, height, nullptr, nullptr, GetModuleHandle(nullptr), window);	mutex->Lock();	condition->Signal();	mutex->Unlock(); // mutex et condition sont considérés invalides à partir d'ici	if (!winHandle)		return;	while (window->m_threadActive)		window->ProcessEvents(true);	DestroyWindow(winHandle);}
开发者ID:GuillaumeBelz,项目名称:NazaraEngine,代码行数:17,


示例2: GetParent

/****************************************************************************** * create_listbox */void CAutoComplete::CreateListbox(){    HWND hwndParent = GetParent(hwndEdit);    /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */    hwndListBox = CreateWindowExW(0, WC_LISTBOXW, NULL,                                  WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT,                                  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,                                  hwndParent, NULL,                                  (HINSTANCE)GetWindowLongPtrW(hwndParent, GWLP_HINSTANCE), NULL);    if (hwndListBox)    {        wpOrigLBoxProc = (WNDPROC)SetWindowLongPtrW(hwndListBox, GWLP_WNDPROC, (LONG_PTR)ACLBoxSubclassProc);        SetWindowLongPtrW(hwndListBox, GWLP_USERDATA, (LONG_PTR)this);    }}
开发者ID:Moteesh,项目名称:reactos,代码行数:20,


示例3: AddContentTab

static BOOL AddContentTab(HHInfo *info){    if(info->tabs[TAB_CONTENTS].id == -1)        return TRUE; /* No "Contents" tab */    info->tabs[TAB_CONTENTS].hwnd = CreateWindowExW(WS_EX_CLIENTEDGE, WC_TREEVIEWW,           szEmpty, WS_CHILD | WS_BORDER | 0x25, 50, 50, 100, 100,           info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);    if(!info->tabs[TAB_CONTENTS].hwnd) {        ERR("Could not create treeview control/n");        return FALSE;    }    ResizeTabChild(info, TAB_CONTENTS);    ShowWindow(info->tabs[TAB_CONTENTS].hwnd, SW_SHOW);    return TRUE;}
开发者ID:YokoZar,项目名称:wine,代码行数:17,


示例4: CreateWindowExW

HWND WindowImpl::createWindow(Point pos, WDims dims, wchar_t const windowname[], wchar_t const classname[], DWORD style){	HWND hWnd = CreateWindowExW(		WS_EX_APPWINDOW,		classname, windowname,//		WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW | style,		WS_OVERLAPPEDWINDOW | style,		pos.x, pos.y,		dims.width, dims.height,		NULL, NULL,		GetModuleHandle(NULL), NULL	);	if( hWnd == NULL ) {		throw std::runtime_error(log::nativeErrorString());	}    return hWnd;}
开发者ID:thinlizzy,项目名称:die-tk,代码行数:17,


示例5: main

int main(int argc, char *argv[]){	D2D1_FACTORY_OPTIONS opts;	WNDCLASSW wc;	HWND mainwin;	MSG msg;	HRESULT hr;	CoInitialize(NULL);	ZeroMemory(&opts, sizeof (D2D1_FACTORY_OPTIONS));	opts.debugLevel = D2D1_DEBUG_LEVEL_NONE;	hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,		IID_ID2D1Factory,		&opts,		(void **) (&d2dfactory));	if (hr != S_OK) {		loghr("D2D1CreateFactory()", hr);		return 1;	}	ZeroMemory(&wc, sizeof (WNDCLASSW));	wc.lpszClassName = L"mainwin";	wc.lpfnWndProc = wndproc;	wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);	RegisterClassW(&wc);	mainwin = CreateWindowExW(0,		L"mainwin", L"mainwin",		WS_OVERLAPPEDWINDOW,		CW_USEDEFAULT, CW_USEDEFAULT,		640, 480,		NULL, NULL, NULL, NULL);	ShowWindow(mainwin, SW_SHOWDEFAULT);	UpdateWindow(mainwin);	while (GetMessageW(&msg, NULL, 0, 0)) {		TranslateMessage(&msg);		DispatchMessageW(&msg);	}	d2dfactory->Release();	CoUninitialize();	return msg.wParam;}
开发者ID:andlabs,项目名称:misctestprogs,代码行数:45,


示例6: CreateWindowExW

// Function to create Combo Box as child of Custom Combo BoxwyBoolCCustomComboBox::CreateCtrls(HWND hwnd, LPARAM lParam){    CREATESTRUCT    *ctst = (CREATESTRUCT *)lParam;    wyInt32         ret = 0;    DWORD           style = CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP | WS_CHILD | WS_CLIPCHILDREN;    HFONT           hfont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);    m_id            = (wyInt32)ctst->hMenu;    m_hwndParent    = ctst->hwndParent;    m_hwnd          = hwnd;    if((ctst->style &  CBS_OWNERDRAWFIXED))        style |=  CBS_OWNERDRAWFIXED;    m_hwndCombo     = CreateWindowExW(NULL, WC_COMBOBOX, NULL,                                 style,                                 0, 0, ctst->cx,ctst->cy,                                 hwnd, (HMENU)IDC_COMBOCUSTOM, GetModuleHandle(NULL), 0);        if(m_hwndCombo == NULL)        return wyFalse;    SendMessage(m_hwndCombo, WM_SETFONT, (WPARAM)hfont, (LPARAM)TRUE);        ShowWindow(m_hwndCombo, SW_SHOW);    ret = GetComboBoxInfo(m_hwndCombo, &m_cbif);    m_editRect.bottom   = m_cbif.rcItem.bottom;    m_editRect.right    = m_cbif.rcItem.right;    m_editRect.left     = m_cbif.rcItem.left;    m_editRect.top      = m_cbif.rcItem.top;        if(ctst->style & WS_DISABLED)    {        SendMessage(hwnd, WM_ENABLE, FALSE, NULL);    }    SetWindowLongPtr(m_hwndCombo, GWLP_USERDATA, (LONG_PTR) this);    m_origComboCtrlProc = (WNDPROC)SetWindowLongPtr(m_hwndCombo, GWLP_WNDPROC, (LONG_PTR) CCustomComboBox::ComboCtrlProc);        SetWindowLongPtr(m_cbif.hwndItem, GWLP_USERDATA, (LONG_PTR)this);    m_origEditCtrlProc = (WNDPROC)SetWindowLongPtr(m_cbif.hwndItem, GWLP_WNDPROC, (LONG_PTR) CCustomComboBox::EditCtrlProc);    return wyTrue;}
开发者ID:AwkwardDev,项目名称:sqlyog-community,代码行数:46,


示例7: RegisterShieldClass

static ATOM RegisterShieldClass(){    static ATOM atom = 0;    if (!atom)    {        const WNDCLASSEX classex = {            .cbSize        = sizeof(WNDCLASSEX),            .style         = CS_NOCLOSE,            .lpfnWndProc   = ShieldWndProc,            .hInstance     = HINST_THISCOMPONENT,            .hbrBackground = GetStockObject(WHITE_BRUSH),            .lpszClassName = L"ClearshotShield",        };        atom = RegisterClassExW(&classex);    }    return atom;}static void ShootArea(int left, int top, int width, int height, uint8_t* buffer){    HWND window = CreateWindowExW(                      WS_EX_NOACTIVATE,                      (wchar_t*)(intptr_t)RegisterShieldClass(),                      L"Clearshot",                      WS_DISABLED | WS_POPUP,                      left, top, width, height,                      NULL, NULL, HINST_THISCOMPONENT, buffer);    if (!window)        Fatal(L"Couldn't create window.");    /* Move the shield underneath all other windows */    SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOACTIVATE);    /* Start the modal message loop */    MSG msg;    while (GetMessage(&msg, NULL, 0, 0))    {        TranslateMessage(&msg);        DispatchMessage(&msg);    }}
开发者ID:rossy,项目名称:clearshot,代码行数:45,


示例8: main

int main(int argc, char *argv[]){	HWND mainwin;	MSG msg;	INITCOMMONCONTROLSEX icc;	ZeroMemory(&icc, sizeof (INITCOMMONCONTROLSEX));	icc.dwSize = sizeof (INITCOMMONCONTROLSEX);	icc.dwICC = ICC_LISTVIEW_CLASSES;	if (InitCommonControlsEx(&icc) == 0)		panic("(test program) error initializing comctl32.dll");	initTable(NULL);	mainwin = CreateWindowExW(0,		tableWindowClass, L"Main Window",		WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,		CW_USEDEFAULT, CW_USEDEFAULT,		400, 400,		NULL, NULL, GetModuleHandle(NULL), NULL);	if (mainwin == NULL)		panic("(test program) error creating Table");	SendMessageW(mainwin, tableAddColumn, tableColumnText, (LPARAM) L"Column");	SendMessageW(mainwin, tableAddColumn, tableColumnImage, (LPARAM) L"Column 2");	SendMessageW(mainwin, tableAddColumn, tableColumnCheckbox, (LPARAM) L"Column 3");	if (argc > 1) {		NONCLIENTMETRICSW ncm;		HFONT font;		ZeroMemory(&ncm, sizeof (NONCLIENTMETRICSW));		ncm.cbSize = sizeof (NONCLIENTMETRICSW);		if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof (NONCLIENTMETRICSW), &ncm, sizeof (NONCLIENTMETRICSW)) == 0)			panic("(test program) error getting non-client metrics");		font = CreateFontIndirectW(&ncm.lfMessageFont);		if (font == NULL)			panic("(test program) error creating lfMessageFont HFONT");		SendMessageW(mainwin, WM_SETFONT, (WPARAM) font, TRUE);	}	ShowWindow(mainwin, SW_SHOWDEFAULT);	if (UpdateWindow(mainwin) == 0)		panic("(test program) error updating window");	while (GetMessageW(&msg, NULL, 0, 0) > 0) {		TranslateMessage(&msg);		DispatchMessageW(&msg);	}	return 0;}
开发者ID:tmaiaroto,项目名称:ui,代码行数:45,


示例9: create_tooltip

/* * Create a tooltip for the control passed as first parameter * duration sets the duration in ms. Use -1 for default * message is an UTF-8 string */HWND create_tooltip(HWND hControl, char* message, int duration){	TOOLINFOW toolInfo = {0};	int i;	if ( (hControl == NULL) || (message == NULL) ) {		return (HWND)NULL;	}	// Find an empty slot	for (i=0; i<MAX_TOOLTIPS; i++) {		if (ttlist[i].hTip == NULL) break;	}	if (i == MAX_TOOLTIPS) {		return (HWND)NULL; // No more space	}	// Create the tooltip window	ttlist[i].hTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hMainDialog, NULL,		main_instance, NULL);	if (ttlist[i].hTip == NULL) {		return (HWND)NULL;	}	// Subclass the tooltip to handle multiline	ttlist[i].original_proc = (WNDPROC)SetWindowLongPtr(ttlist[i].hTip, GWLP_WNDPROC, (LONG_PTR)tooltip_callback);	// Set the string to display (can be multiline)	ttlist[i].wstring = utf8_to_wchar(message);	// Set tooltip duration (ms)	PostMessage(ttlist[i].hTip, TTM_SETDELAYTIME, (WPARAM)TTDT_AUTOPOP, (LPARAM)duration);	// Associate the tooltip to the control	toolInfo.cbSize = sizeof(toolInfo);	toolInfo.hwnd = ttlist[i].hTip;	// Set to the tooltip itself to ease up subclassing	toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;	toolInfo.uId = (UINT_PTR)hControl;	toolInfo.lpszText = LPSTR_TEXTCALLBACKW;	SendMessageW(ttlist[i].hTip, TTM_ADDTOOLW, 0, (LPARAM)&toolInfo);	return ttlist[i].hTip;}
开发者ID:pbatard,项目名称:libwdi,代码行数:50,


示例10: CreateEditCtrl

bool CreateEditCtrl(EditCtrl *w) {    // Note: has to remember this here because when I GetWindowStyle() later on,    // WS_BORDER is not set, which is a mystery, because it is being drawn.    // also, WS_BORDER seems to be painted in client areay    w->hasBorder = bit::IsMaskSet<DWORD>(w->dwStyle, WS_BORDER);    RECT rc = w->initialPos;    w->hwnd = CreateWindowExW(w->dwExStyle, WC_EDIT, L"", w->dwStyle, rc.left, rc.top, RectDx(rc),                              RectDy(rc), w->parent, nullptr, GetModuleHandleW(nullptr), nullptr);    if (!w->hwnd) {        return false;    }    SetFont(w, GetDefaultGuiFont());    SetWindowSubclass(w->hwnd, EditProc, 0, (DWORD_PTR)w);    SetWindowSubclass(GetParent(w->hwnd), EditParentProc, 0, (DWORD_PTR)w);    return true;}
开发者ID:kepazon,项目名称:my_sumatrapdf,代码行数:18,


示例11: GetModuleHandleW

bool TreeCtrl::Create(const WCHAR* title) {    if (!title) {        title = L"";    }    RECT rc = this->initialPos;    HMODULE hmod = GetModuleHandleW(nullptr);    this->hwnd = CreateWindowExW(this->dwExStyle, WC_TREEVIEWW, title, this->dwStyle, rc.left, rc.top, RectDx(rc),                                 RectDy(rc), this->parent, this->menu, hmod, nullptr);    if (!this->hwnd) {        return false;    }    TreeView_SetUnicodeFormat(this->hwnd, true);    this->SetFont(GetDefaultGuiFont());    Subclass(this);    return true;}
开发者ID:jingyu9575,项目名称:sumatrapdf,代码行数:18,


示例12: create_tooltips_window

static void create_tooltips_window(HTMLDocumentObj *This){    tooltip_data *data = heap_alloc(sizeof(*data));    This->tooltips_hwnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | WS_POPUP,            CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL);    data->doc = This;    data->proc = (WNDPROC)GetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC);    SetPropW(This->tooltips_hwnd, wszTooltipData, data);    SetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC, (LONG_PTR)tooltips_proc);    SetWindowPos(This->tooltips_hwnd, HWND_TOPMOST,0, 0, 0, 0,                 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);}
开发者ID:pstrealer,项目名称:wine,代码行数:18,


示例13: sizeof

	bool CWindowsApp::Init(wchar_t *windowName, int width, int height)	{		m_wndClassEx.cbSize = sizeof(WNDCLASSEX);		m_wndClassEx.style = CS_CLASSDC;		m_wndClassEx.lpfnWndProc = MsgProc;		m_wndClassEx.cbClsExtra = 0L;		m_wndClassEx.cbWndExtra = 0L;		m_wndClassEx.hInstance = m_instanceHandle;		m_wndClassEx.hIcon = nullptr;		m_wndClassEx.hCursor = LoadCursor(nullptr, IDC_ARROW);		m_wndClassEx.hbrBackground = nullptr;		m_wndClassEx.lpszMenuName = nullptr;		m_wndClassEx.lpszClassName = L"framework_9";		m_wndClassEx.hIconSm = nullptr;		//RegisterClassEx(&m_wndClassEx);		RegisterClassExW(&m_wndClassEx);		int screenX = GetSystemMetrics(SM_CXSCREEN);		int screenY = GetSystemMetrics(SM_CYSCREEN);		RECT windowRect;		ZeroMemory(&windowRect, sizeof(windowRect));		windowRect.left = (screenX - width) / 2;		windowRect.top = (screenY - height) / 2;		windowRect.right = windowRect.left + width;		windowRect.bottom = windowRect.top + height;		AdjustWindowRectEx(&windowRect, WindowStyle, 0, 0);		//m_windowHandle = CreateWindowEx(		m_windowHandle = CreateWindowExW(			0L, m_wndClassEx.lpszClassName, windowName,			WindowStyle,			windowRect.left, windowRect.top, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top,			nullptr, nullptr, m_wndClassEx.hInstance, nullptr			);		m_width = width;		m_height = height;		if (!AllocDevice())			return false;		return true;	}
开发者ID:Nickchooshin,项目名称:Framework_9,代码行数:44,


示例14: sizeof

		DummyWindow::DummyWindow(HINSTANCE hinstance)		{			this->hinstance = hinstance;			WCHAR classname[sizeof(DummyWindow*) * 2 + 1];			win32::genClassNameStr(this, classname);			WNDCLASSEXW klass;			klass.cbSize = sizeof(WNDCLASSEXW);			klass.style = CS_OWNDC;			klass.lpfnWndProc = &wndproc;			klass.cbClsExtra = 0;			klass.cbWndExtra = 0;			klass.hInstance = hinstance;			klass.hIcon = 0;			klass.hCursor = 0;			klass.hbrBackground = 0;			klass.lpszMenuName = 0;			klass.lpszClassName = &classname[0];			klass.hIconSm = 0;			classatom = RegisterClassExW(&klass);			if(!classatom)				throw Exception("Can't register win32 window class: " + win32::getErrorMsg());			hwnd = CreateWindowExW(				0,				&classname[0],				L"",	// window title				WS_POPUP | WS_DISABLED,				CW_USEDEFAULT, CW_USEDEFAULT,				100, 100, // width, height				0,				0,				hinstance,				0);			if(!hwnd)			{				DWORD err = GetLastError();				UnregisterClassW(&classname[0], hinstance);				throw wm::Exception("Can't create Window: " + wm::win32::getErrorMsg(err));			}		}
开发者ID:cordarei,项目名称:libwm,代码行数:44,


示例15: createHelperWindow

// Creates a dummy window for behind-the-scenes work//static HWND createHelperWindow(void){    MSG msg;    HWND window = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW,                                  _GLFW_WNDCLASSNAME,                                  L"GLFW message window",                                  WS_CLIPSIBLINGS | WS_CLIPCHILDREN,                                  0, 0, 1, 1,                                  NULL, NULL,                                  GetModuleHandleW(NULL),                                  NULL);    if (!window)    {        _glfwInputErrorWin32(GLFW_PLATFORM_ERROR,                             "Win32: Failed to create helper window");        return NULL;    }    // HACK: The command to the first ShowWindow call is ignored if the parent    //       process passed along a STARTUPINFO, so clear that with a no-op call    ShowWindow(window, SW_HIDE);    // Register for HID device notifications    {        DEV_BROADCAST_DEVICEINTERFACE_W dbi;        ZeroMemory(&dbi, sizeof(dbi));        dbi.dbcc_size = sizeof(dbi);        dbi.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;        dbi.dbcc_classguid = GUID_DEVINTERFACE_HID;        _glfw.win32.deviceNotificationHandle =            RegisterDeviceNotificationW(window,                                        (DEV_BROADCAST_HDR*) &dbi,                                        DEVICE_NOTIFY_WINDOW_HANDLE);    }    while (PeekMessageW(&msg, _glfw.win32.helperWindowHandle, 0, 0, PM_REMOVE))    {        TranslateMessage(&msg);        DispatchMessageW(&msg);    }   return window;}
开发者ID:Draghi,项目名称:glfw,代码行数:46,


示例16: RegisterClassW

int CIntfEnum::CreateEnumNotifWnd(HINSTANCE hInstance){	if(hInstance)	{		WNDCLASSW WndClass;		WndClass.style = 0;		WndClass.cbClsExtra = 0;		WndClass.cbWndExtra = 0;		WndClass.hIcon = 0;		WndClass.hCursor = 0;		WndClass.hbrBackground = 0;		WndClass.lpszMenuName = 0;		WndClass.lpfnWndProc = CIntfEnum::EnumNotifWndProcStatic;		WndClass.hInstance = hInstance;		WndClass.lpszClassName = L"CIntfEnumNotifWnd";		g_pEnumerator = this;		RegisterClassW(&WndClass);		m_hEnumNotifWnd = CreateWindowExW(0x80, L"CIntfEnumNotifWnd", L"CIntfEnumNotifWnd", 0x80000000u, 0, 0, 0, 0, 0, 0, hInstance, (LPVOID)this);		if(m_hEnumNotifWnd)		{			ShowWindow(m_hEnumNotifWnd, 0);		}	}	m_hSetupApiLibrary = LoadLibraryW(L"SetupApi.dll");	if(m_hSetupApiLibrary)	{#define RESOLVE_SETUPAPI_FUNC(def) do{if(!(m_pfn##def = (Def_##def*)GetProcAddress(m_hSetupApiLibrary, #def)))return 0;}while(0)		RESOLVE_SETUPAPI_FUNC(CM_Get_Parent);		RESOLVE_SETUPAPI_FUNC(CM_Get_Depth);		RESOLVE_SETUPAPI_FUNC(CM_Get_Device_IDA);		RESOLVE_SETUPAPI_FUNC(CM_Locate_DevNodeA);		RESOLVE_SETUPAPI_FUNC(CMP_WaitNoPendingInstallEvents);		RESOLVE_SETUPAPI_FUNC(SetupDiGetClassDevsW);		RESOLVE_SETUPAPI_FUNC(SetupDiGetDeviceInterfaceDetailW);		RESOLVE_SETUPAPI_FUNC(SetupDiGetDeviceRegistryPropertyW);		RESOLVE_SETUPAPI_FUNC(SetupDiEnumDeviceInterfaces);		RESOLVE_SETUPAPI_FUNC(SetupDiDestroyDeviceInfoList);		RESOLVE_SETUPAPI_FUNC(SetupDiEnumDeviceInfo);		RESOLVE_SETUPAPI_FUNC(SetupDiOpenDeviceInterfaceRegKey);		return 1;	#undef RESOLVE_SETUPAPI_FUNC	}	return 0;}
开发者ID:jte,项目名称:logitech-rce,代码行数:44,


示例17: uiWindowsNewControl

uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar){	uiWindow *w;	WCHAR *wtitle;	BOOL hasMenubarBOOL;	uiWindowsNewControl(uiWindow, w);	hasMenubarBOOL = FALSE;	if (hasMenubar)		hasMenubarBOOL = TRUE;	w->hasMenubar = hasMenubarBOOL;#define style WS_OVERLAPPEDWINDOW#define exstyle 0	wtitle = toUTF16(title);	w->hwnd = CreateWindowExW(exstyle,		windowClass, wtitle,		style,		CW_USEDEFAULT, CW_USEDEFAULT,		// use the raw width and height for now		// this will get CW_USEDEFAULT (hopefully) predicting well		// even if it doesn't, we're adjusting it later		width, height,		NULL, NULL, hInstance, w);	if (w->hwnd == NULL)		logLastError(L"error creating window");	uiFree(wtitle);	if (hasMenubar) {		w->menubar = makeMenubar();		if (SetMenu(w->hwnd, w->menubar) == 0)			logLastError(L"error giving menu to window");	}	// and use the proper size	setClientSize(w, width, height, hasMenubarBOOL, style, exstyle);	uiWindowOnClosing(w, defaultOnClosing, NULL);	windows[w] = true;	return w;}
开发者ID:08opt,项目名称:libui,代码行数:44,


示例18: CreateWND

static HWND CreateWND(HINSTANCE const hInstance,                      std::string const &window_name){    std::wstring const window_wname(window_name.begin(), window_name.end());    HWND const wnd = CreateWindowExW(0,                      // dwExStyle                                     GetWNDCLASS(hInstance), // lpClassName                                     window_wname.c_str(),   // lpWindowName                                     WS_OVERLAPPEDWINDOW,    // dwStyle                                     CW_USEDEFAULT,          // X                                     CW_USEDEFAULT,          // Y                                     CW_USEDEFAULT,          // nWidth                                     CW_USEDEFAULT,          // nHeight                                     HWND_DESKTOP,           // hWndParent                                     nullptr,                // hMenu                                     hInstance,              // hInstance                                     nullptr);               // lpParam    return wnd;}
开发者ID:mckelley3v,项目名称:BlackBox,代码行数:19,


示例19: WinCreate

//Registers, creates, and shows the Window!!bool WinCreate(){    WindowINST = GetModuleHandle(0); // Get current process handle    const WCHAR *szTitle=  (L"Cataclysm: Dark Days Ahead - 0.6git");    // Register window class    WNDCLASSEXW WindowClassType = {0};    WindowClassType.cbSize        = sizeof(WNDCLASSEXW);    WindowClassType.lpfnWndProc   = ProcessMessages;//the procedure that gets msgs    WindowClassType.hInstance     = WindowINST;// hInstance    WindowClassType.hIcon         = LoadIcon(WindowINST, MAKEINTRESOURCE(0)); // Get first resource    WindowClassType.hIconSm       = LoadIcon(WindowINST, MAKEINTRESOURCE(0));    WindowClassType.hCursor       = LoadCursor(NULL, IDC_ARROW);    WindowClassType.lpszMenuName  = NULL;    WindowClassType.lpszClassName = szWindowClass;    if (!RegisterClassExW(&WindowClassType))        return false;    // Adjust window size    uint32_t WndStyle = WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_VISIBLE; // Basic window, show on creation    RECT WndRect;    WndRect.left   = WndRect.top = 0;    WndRect.right  = WindowWidth;    WndRect.bottom = WindowHeight;    AdjustWindowRect(&WndRect, WndStyle, false);    // Center window    RECT WorkArea;    SystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);    int WindowX = WorkArea.right/2 - (WndRect.right - WndRect.left)/2;    int WindowY = WorkArea.bottom/2 - (WndRect.bottom - WndRect.top)/2;    // Magic    WindowHandle = CreateWindowExW(0, szWindowClass , szTitle, WndStyle,                                   WindowX, WindowY,                                   WndRect.right - WndRect.left,                                   WndRect.bottom - WndRect.top,                                   0, 0, WindowINST, NULL);    if (WindowHandle == 0)        return false;    return true;};
开发者ID:Anderviel,项目名称:Cataclysm-DDA,代码行数:44,


示例20: createHelperWindow

// Creates a dummy window for behind-the-scenes work//static HWND createHelperWindow(void){    HWND window = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW,                                  _GLFW_WNDCLASSNAME,                                  L"GLFW helper window",                                  WS_CLIPSIBLINGS | WS_CLIPCHILDREN,                                  0, 0, 1, 1,                                  NULL, NULL,                                  GetModuleHandleW(NULL),                                  NULL);    if (!window)    {        _glfwInputError(GLFW_PLATFORM_ERROR,                        "Win32: Failed to create helper window");        return NULL;    }    return window;}
开发者ID:IcyDefiance,项目名称:nIceFramework,代码行数:21,


示例21: closed

Window::Window()    : closed(false){    hinst = (HINSTANCE)GetModuleHandleW(nullptr);    WNDCLASSEXW wndc = { sizeof(wndc) };    wndc.lpszClassName = WINDOW_CLASS;    wndc.cbWndExtra = sizeof(Window *);    wndc.lpfnWndProc = WinProc;    RegisterClassExW(&wndc);    hwnd = CreateWindowExW(        0U, WINDOW_CLASS, L"Cnnr's Vulkan Renderer", WS_OVERLAPPEDWINDOW,        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,        nullptr, nullptr, hinst, this    );    ShowWindow(hwnd, SW_SHOW);}
开发者ID:Connorcpu,项目名称:vulkan-test,代码行数:19,


示例22: create_syslink

static HWND create_syslink(DWORD style, HWND parent){    HWND hWndSysLink;    static const WCHAR linkW[] = {'H','e','a','d',' ','<','a',' ','h','r','e','f','=','"','l','i','n','k','1','"','>','N','a','m','e','1','<','/','a','>',' ','M','i','d','d','l','e',' ','<','a',' ','h','r','e','f','=','"','l','i','n','k','2','"','>','N','a','m','e','2','<','/','a','>',' ','T','a','i','l',0};    /* Only Unicode will do here */    hWndSysLink = CreateWindowExW(0, WC_LINK, linkW,                                style, 0, 0, 150, 50,                                parent, NULL, GetModuleHandleW(NULL), NULL);    if (!hWndSysLink) return NULL;    if (GetWindowLongPtrW(hWndSysLink, GWLP_USERDATA))        /* On Windows XP SysLink takes GWLP_USERDATA for itself! */        trace("SysLink makes use of GWLP_USERDATA/n");    syslink_oldproc = (WNDPROC)SetWindowLongPtrW(hWndSysLink, GWLP_WNDPROC, (LONG_PTR)syslink_subclass_proc);    return hWndSysLink;}
开发者ID:Barrell,项目名称:wine,代码行数:19,


示例23: GetWindowRect

void little::initWindow(){    RECT& rc = m_rcDesktop;    GetWindowRect(GetDesktopWindow(), &m_rcDesktop);    m_rect.x       = rc.left;    m_rect.y       = rc.top;    m_rect.width   = rc.right - rc.left;    m_rect.height  = rc.bottom - rc.top;    m_cyFullScreen = GetSystemMetrics(SM_CYFULLSCREEN);        WNDCLASSEXW wndCls;    wndCls.cbSize        = sizeof(wndCls);    wndCls.hInstance     = m_hInst;    wndCls.lpszClassName = WNDCLASSNAME;    wndCls.style         = CS_HREDRAW | CS_VREDRAW;    wndCls.lpfnWndProc   = WndProc;    wndCls.hIcon         = NULL; // todo    wndCls.hIconSm       = NULL; // todo    wndCls.hCursor       = LoadCursor(NULL, IDC_ARROW);    wndCls.cbClsExtra    = 0;    wndCls.cbWndExtra    = 0;    wndCls.hbrBackground = NULL;    wndCls.lpszMenuName  = NULL;    RegisterClassExW(&wndCls);    m_hWnd = CreateWindowExW(WS_EX_LAYERED |                             WS_EX_TOPMOST |                             WS_EX_TOOLWINDOW|  // 
C++ CreateWindowL函数代码示例
C++ CreateWindowExA函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。