• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LoadCursorW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: InitApplication

static BOOL InitApplication(HINSTANCE hInstance)
{
  WNDCLASSEXW wc;

  /* Load the application description strings */
  LoadStringW(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle)/sizeof(WCHAR));

  /* Fill in window class structure with parameters that describe the
     main window */

  wc.cbSize        = sizeof(WNDCLASSEXW);
  wc.style         = CS_HREDRAW | CS_VREDRAW;             /* Class style(s) */
  wc.lpfnWndProc   = WndProc;                             /* Window Procedure */
  wc.cbClsExtra    = 0;                          /* No per-class extra data */
  wc.cbWndExtra    = 0;                         /* No per-window extra data */
  wc.hInstance     = hInstance;                      /* Owner of this class */
  wc.hIcon         = NULL;
  wc.hIconSm       = NULL;
  wc.hCursor       = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);           /* Default color */
  wc.lpszMenuName  = szAppName;                       /* Menu name from .rc */
  wc.lpszClassName = szAppName;                      /* Name to register as */

  if (!RegisterClassExW(&wc)) return FALSE;

  /* Call module specific initialization functions here */

  return TRUE;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:29,代码来源:view.c


示例2: _glfwRegisterWindowClass

// Registers the GLFW window class
//
GLboolean _glfwRegisterWindowClass(void)
{
    WNDCLASSW wc;

    wc.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wc.lpfnWndProc   = (WNDPROC) windowProc;
    wc.cbClsExtra    = 0;                           // No extra class data
    wc.cbWndExtra    = sizeof(void*) + sizeof(int); // Make room for one pointer
    wc.hInstance     = GetModuleHandleW(NULL);
    wc.hCursor       = LoadCursorW(NULL, IDC_ARROW);
    wc.hbrBackground = NULL;                        // No background
    wc.lpszMenuName  = NULL;                        // No menu
    wc.lpszClassName = _GLFW_WNDCLASSNAME;

    // Load user-provided icon if available
    wc.hIcon = LoadIconW(GetModuleHandleW(NULL), L"GLFW_ICON");
    if (!wc.hIcon)
    {
        // No user-provided icon found, load default icon
        wc.hIcon = LoadIconW(NULL, IDI_WINLOGO);
    }

    if (!RegisterClassW(&wc))
    {
        _glfwInputError(GLFW_PLATFORM_ERROR,
                        "Win32: Failed to register window class");
        return GL_FALSE;
    }

    return GL_TRUE;
}
开发者ID:RubenMagallanes,项目名称:comp308sheepSim,代码行数:33,代码来源:win32_window.c


示例3: main

int main(int argc, char *argv[])
{
	WNDCLASSW wc;
	MSG msg;

	ZeroMemory(&wc, sizeof (WNDCLASSW));
	wc.lpszClassName = L"mainwin";
	wc.lpfnWndProc = wndProc;
	wc.hInstance = GetModuleHandle(NULL);
	wc.hIcon = LoadIconW(NULL, IDI_APPLICATION);
	wc.hCursor = LoadCursorW(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
	RegisterClassW(&wc);

	mainwin = CreateWindowExW(0,
		L"mainwin", L"mainwin",
		WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT,
		400, 400,
		NULL, NULL, GetModuleHandle(NULL), NULL);

	if (argc > 1)
		dialog = CreateWindowExW(WS_EX_CONTROLPARENT,
			WC_DIALOG, L"",
			WS_CHILD | WS_VISIBLE,
			100, 100, 200, 200,
			mainwin, NULL, GetModuleHandle(NULL), NULL);
	else {
		const BYTE dlgtemplate[] = {
			0x01, 0x00,				// version
			0xFF, 0xFF,				// signature
			0x00, 0x00, 0x00, 0x00,		// help
			0x00, 0x00, 0x01, 0x00,		// WS_EX_CONTROLPARENT
			0x00, 0x00, 0x00, 0x50,		// WS_CHILD | WS_VISIBLE
			0x00, 0x00,				// no controls
			100, 0,					// X/Y/Width/Height
			100, 0,
			100, 0,
			100, 0,
			0x00, 0x00,				// menu
			0x00, 0x00,				// class
			0x00, 0x00,				// title
			0x00, 0x00, 0x00, 0x00,		// some padding
			0x00, 0x00, 0x00, 0x00,		// more padding
			0x00, 0x00, 0x00, 0x00,		// just to be safe
		};

		dialog = CreateDialogIndirectW(GetModuleHandle(NULL), (LPCDLGTEMPLATEW) dlgtemplate, mainwin, dlgproc);
	}
	printf("%I32X\n", EnableThemeDialogTexture(dialog, ETDT_ENABLE | ETDT_USETABTEXTURE | ETDT_ENABLETAB));

	ShowWindow(mainwin, SW_SHOWDEFAULT);
	UpdateWindow(mainwin);

	while (GetMessageW(&msg, NULL, 0, 0) > 0) {
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	return 0;
}
开发者ID:andlabs,项目名称:misctestprogs,代码行数:60,代码来源:winetdttest.c


示例4: RegisterSystemControls

BOOL WINAPI RegisterSystemControls(VOID)
{
    WNDCLASSEXW WndClass;
    UINT i;
    ATOM atom;

    if (RegisterDefaultClasses) return TRUE;

    ZeroMemory(&WndClass, sizeof(WndClass));

    WndClass.cbSize = sizeof(WndClass);

    for (i = 0; i != sizeof(g_SysClasses) / sizeof(g_SysClasses[0]); i++)
    {
        WndClass.lpszClassName = g_SysClasses[i].desc->name;

        // Set Global bit!
        WndClass.style = g_SysClasses[i].desc->style|CS_GLOBALCLASS;
        WndClass.lpfnWndProc = g_SysClasses[i].desc->procW;
        WndClass.cbWndExtra = g_SysClasses[i].desc->extra;
        WndClass.hCursor = LoadCursorW(NULL, g_SysClasses[i].desc->cursor);
        WndClass.hbrBackground= g_SysClasses[i].desc->brush;

        atom = RegisterClassExWOWW( &WndClass,
                                     0,
                                     g_SysClasses[i].fnid,
                                     0,
                                     FALSE);
        if (atom)
           RegisterDefaultClasses |= ICLASS_TO_MASK(g_SysClasses[i].ClsId);
    }

    return TRUE;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:34,代码来源:regcontrol.c


示例5: _glfwRegisterWindowClassWin32

// Registers the GLFW window class
//
GLFWbool _glfwRegisterWindowClassWin32(void)
{
    WNDCLASSEXW wc;

    ZeroMemory(&wc, sizeof(wc));
    wc.cbSize        = sizeof(wc);
    wc.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wc.lpfnWndProc   = (WNDPROC) windowProc;
    wc.cbWndExtra    = sizeof(void*) + sizeof(int); // Make room for one pointer
    wc.hInstance     = GetModuleHandleW(NULL);
    wc.hCursor       = LoadCursorW(NULL, IDC_ARROW);
    wc.lpszClassName = _GLFW_WNDCLASSNAME;

    // Load user-provided icon if available
    wc.hIcon = LoadImageW(GetModuleHandleW(NULL),
                          L"GLFW_ICON", IMAGE_ICON,
                          0, 0, LR_DEFAULTSIZE | LR_SHARED);
    if (!wc.hIcon)
    {
        // No user-provided icon found, load default icon
        wc.hIcon = LoadImageW(NULL,
                              IDI_APPLICATION, IMAGE_ICON,
                              0, 0, LR_DEFAULTSIZE | LR_SHARED);
    }

    if (!RegisterClassExW(&wc))
    {
        _glfwInputError(GLFW_PLATFORM_ERROR,
                        "Win32: Failed to register window class");
        return GLFW_FALSE;
    }

    return GLFW_TRUE;
}
开发者ID:timur-losev,项目名称:glfw,代码行数:36,代码来源:win32_window.c


示例6: GetModuleHandleW

		void Window::Register()
		try {
			HINSTANCE instanceHandle = GetModuleHandleW(nullptr);
			WNDCLASSEXW windowClass;
			ZeroMemory(&windowClass, sizeof(windowClass));

			windowClass.cbSize = sizeof(WNDCLASSEXW);
			windowClass.style = CS_OWNDC;
			windowClass.lpfnWndProc = WindowHandleMessage;
			windowClass.hInstance = instanceHandle;
			windowClass.hIcon = LoadIconW(instanceHandle, MAKEINTRESOURCEW(IDI_ICON1));
			windowClass.hCursor = LoadCursorW(nullptr, MAKEINTRESOURCEW(IDI_APPLICATION));
			windowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
			windowClass.lpszMenuName = nullptr;
			windowClass.lpszClassName = CLASS_NAME;

			if (!RegisterClassExW(&windowClass)) {
				throw std::runtime_error("Registration of Window failed");
			}

			wasRegistered = true;
		} catch (std::runtime_error error) {
			MessageBoxA(0, error.what(), "Error!", MB_ICONEXCLAMATION | MB_OK);
			PostQuitMessage(-1);
		}
开发者ID:CodeOmar,项目名称:Game,代码行数:25,代码来源:Window.cpp


示例7: RegisterIMEClass

BOOL
WINAPI
RegisterIMEClass(VOID)
{
    WNDCLASSEXW WndClass;
    ATOM atom;

    ZeroMemory(&WndClass, sizeof(WndClass));

    WndClass.cbSize = sizeof(WndClass);
    WndClass.lpszClassName = imeW;
    WndClass.style = CS_GLOBALCLASS;
    WndClass.lpfnWndProc = ImeWndProcW;
    WndClass.cbWndExtra = sizeof(LONG_PTR);
    WndClass.hCursor = LoadCursorW(NULL, IDC_ARROW);

    atom = RegisterClassExWOWW( &WndClass,
                                 0,
                                 FNID_IME,
                                 0,
                                 FALSE);
    if (atom)
    {
       RegisterDefaultClasses |= ICLASS_TO_MASK(ICLS_IME);
       TRACE("Register IME Class!\n");
       return TRUE;
    }
    ERR("Failed to register IME Class!\n");
    return FALSE;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:30,代码来源:imm.c


示例8: RefreshTreeView

BOOL RefreshTreeView(HWND hwndTV)
{
    HTREEITEM hItem;
    HTREEITEM hSelectedItem;
    HCURSOR hcursorOld;
    HTREEITEM hRoot;

    WINE_TRACE("\n");
    hSelectedItem = (HTREEITEM)SendMessageW(hwndTV, TVM_GETNEXTITEM, TVGN_CARET, 0);
    hcursorOld = SetCursor(LoadCursorW(NULL, (LPCWSTR)IDC_WAIT));
    SendMessageW(hwndTV, WM_SETREDRAW, FALSE, 0);

    hRoot = (HTREEITEM)SendMessageW(hwndTV, TVM_GETNEXTITEM, TVGN_ROOT, 0);
    hItem = (HTREEITEM)SendMessageW(hwndTV, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hRoot);
    while (hItem) {
        RefreshTreeItem(hwndTV, hItem);
        hItem = (HTREEITEM)SendMessageW(hwndTV, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem);
    }

    SendMessageW(hwndTV, WM_SETREDRAW, TRUE, 0);
    InvalidateRect(hwndTV, NULL, FALSE);
    SetCursor(hcursorOld);
    
    /* We reselect the currently selected node, this will prompt a refresh of the listview. */
    SendMessageW(hwndTV, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hSelectedItem);
    return TRUE;
}
开发者ID:VOID001,项目名称:wine-void,代码行数:27,代码来源:treeview.c


示例9: registerWindowClass

/*--------------------------------------
 * Function: registerWindowClass()
 *------------------------------------*/
static void registerWindowClass(void) {
    WNDCLASSEXW wcx = { 0 };

    wchar_t* class_name = wstrdup(ClassName);

    wcx.cbSize        = sizeof(WNDCLASSEXW);
    wcx.style         = CS_HREDRAW | CS_VREDRAW;
    wcx.lpfnWndProc   = WindowProc;
    wcx.cbClsExtra    = 0;
    wcx.cbWndExtra    = 0;
    wcx.hInstance     = GetModuleHandleW(NULL);
    wcx.hIcon         = LoadIconW(NULL, IDI_APPLICATION);
    wcx.hCursor       = LoadCursorW(NULL, IDC_ARROW);
    wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wcx.lpszMenuName  = NULL;
    wcx.lpszClassName = class_name;
    wcx.hIconSm       = NULL;

    if (!RegisterClassExW(&wcx)) {
        free(class_name);
        error("could not register window class");
    }

    free(class_name);
}
开发者ID:philiparvidsson,项目名称:ral-viz,代码行数:28,代码来源:graphics_win32.c


示例10: register_classes

static BOOL WINAPI register_classes( INIT_ONCE *once, void *param, void **context )
{
    WNDCLASSW wndClass;

    ZeroMemory(&wndClass, sizeof(WNDCLASSW));
    wndClass.style = CS_GLOBALCLASS | CS_IME | CS_HREDRAW | CS_VREDRAW;
    wndClass.lpfnWndProc = IME_WindowProc;
    wndClass.cbClsExtra = 0;
    wndClass.cbWndExtra = 2 * sizeof(LONG_PTR);
    wndClass.hInstance = x11drv_module;
    wndClass.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
    wndClass.hIcon = LoadIconW(NULL, (LPWSTR)IDI_APPLICATION);
    wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);
    wndClass.lpszMenuName   = 0;
    wndClass.lpszClassName = UI_CLASS_NAME;

    RegisterClassW(&wndClass);

    WM_MSIME_SERVICE = RegisterWindowMessageA("MSIMEService");
    WM_MSIME_RECONVERTOPTIONS = RegisterWindowMessageA("MSIMEReconvertOptions");
    WM_MSIME_MOUSE = RegisterWindowMessageA("MSIMEMouseOperation");
    WM_MSIME_RECONVERTREQUEST = RegisterWindowMessageA("MSIMEReconvertRequest");
    WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert");
    WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
    WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
    return TRUE;
}
开发者ID:AmesianX,项目名称:wine,代码行数:27,代码来源:ime.c


示例11: sizeof

// 初始化
HRESULT ThisApp::Initialize(HINSTANCE hInstance, int nCmdShow){
    HRESULT hr = E_FAIL;
    //register window class
    WNDCLASSEX wcex = { sizeof(WNDCLASSEX) };
    wcex.style = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc = ThisApp::WndProc;
    wcex.cbClsExtra = 0;
    wcex.cbWndExtra = sizeof(LONG_PTR);
    wcex.hInstance = hInstance;
    wcex.hCursor = LoadCursorW(nullptr, IDC_ARROW);
    wcex.hbrBackground = nullptr;
    wcex.lpszMenuName = nullptr;
    wcex.lpszClassName = L"Direct2DTemplate";
    wcex.hIcon = nullptr;
    // 注册窗口
    ::RegisterClassExW(&wcex);
    // 计算窗口大小
    RECT window_rect = { 0, 0, WNDWIDTH, WNDHEIGHT };
    DWORD window_style = WS_OVERLAPPEDWINDOW;
    ::AdjustWindowRect(&window_rect, window_style, FALSE);
    window_rect.right -= window_rect.left;
    window_rect.bottom -= window_rect.top;
    window_rect.left = (::GetSystemMetrics(SM_CXFULLSCREEN) - window_rect.right) / 2;
    window_rect.top = (::GetSystemMetrics(SM_CYFULLSCREEN) - window_rect.bottom) / 2;
    // 创建窗口
    m_hwnd = ::CreateWindowExW(
#ifdef USING_DirectComposition
        WS_EX_NOREDIRECTIONBITMAP, 
#else
        0,
#endif
        wcex.lpszClassName, TITLE, window_style,
        window_rect.left, window_rect.top, window_rect.right, window_rect.bottom, 
        0, 0, hInstance, this
        );
    hr = m_hwnd ? S_OK : E_FAIL;
    // 设置窗口句柄
    if (SUCCEEDED(hr)) {
        hr = m_ImagaRenderer.SetHwnd(m_hwnd);
    }
    // 显示窗口
    if (SUCCEEDED(hr)) {
        ::ShowWindow(m_hwnd, nCmdShow);
        ::UpdateWindow(m_hwnd);
        m_threadRender.std::thread::~thread();
        m_threadRender.std::thread::thread(
            [this]() {
                ::CoInitialize(nullptr);
                while (true) {
                    m_ImagaRenderer.OnRender(1);
                    if (m_bExit) break;
                }
                ::CoUninitialize();
                return S_OK;
            }
            );
    }
    return hr;
}
开发者ID:dustpg,项目名称:NoteFL,代码行数:60,代码来源:ThisApp.cpp


示例12: SdtSaveListToFile

/*
* SdtSaveListToFile
*
* Purpose:
*
* Dump table to the selected file
*
*/
VOID SdtSaveListToFile(
	_In_ HWND hwndDlg
	)
{
	
	WCHAR ch;
	INT BufferSize = 0;
	INT	numitems;
	INT	row, subitem;
	SIZE_T sz, k;
	LPWSTR pItem = NULL;
	HCURSOR hSaveCursor;
	HCURSOR hHourGlass;
	WCHAR szTempBuffer[MAX_PATH + 1];

	RtlSecureZeroMemory(szTempBuffer, sizeof(szTempBuffer));

	_strcpy(szTempBuffer, TEXT("list.txt"));
	if (supSaveDialogExecute(hwndDlg, (LPWSTR)&szTempBuffer, TEXT("Text files\0*.txt\0\0"))) {

		hHourGlass = LoadCursorW(NULL, IDC_WAIT);

		ch = (WCHAR)0xFEFF;
		supWriteBufferToFile(szTempBuffer, &ch, sizeof(WCHAR), FALSE, FALSE);

		SetCapture(hwndDlg);
		hSaveCursor = SetCursor(hHourGlass);

		numitems = ListView_GetItemCount(SdtDlgContext.ListView);
		for (row = 0; row < numitems; row++) {

			output[0] = 0;
			for (subitem = 0; subitem < SdtDlgContext.lvColumnCount; subitem++) {

				sz = 0;
				pItem = supGetItemText(SdtDlgContext.ListView, row, subitem, &sz);
				if (pItem) {
					_strcat(output, pItem);
					HeapFree(GetProcessHeap(), 0, pItem);
				}
				if (subitem == 1) {
					for (k = 54; k > sz / sizeof(WCHAR); k--) {
						_strcat(output, TEXT(" "));
					}
				}
				else {
					_strcat(output, TEXT("\t"));
				}
			}
			_strcat(output, L"\r\n");
			BufferSize = (INT)_strlen(output);
			supWriteBufferToFile(szTempBuffer, output, BufferSize * sizeof(WCHAR), FALSE, TRUE);
		}

		SetCursor(hSaveCursor);
		ReleaseCapture();
	}
}
开发者ID:yuang1516,项目名称:WinObjEx64,代码行数:66,代码来源:extrasSSDT.c


示例13: InitInstance

static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
    WCHAR empty = 0;
    WNDCLASSEXW wndclass = {0};

    /* Frame class */
    wndclass.cbSize = sizeof(WNDCLASSEXW);
    wndclass.style = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc = FrameWndProc;
    wndclass.hInstance = hInstance;
    wndclass.hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_REGEDIT));
    wndclass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
    wndclass.lpszClassName = szFrameClass;
    wndclass.hIconSm = LoadImageW(hInstance, MAKEINTRESOURCEW(IDI_REGEDIT), IMAGE_ICON,
                                  GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
    RegisterClassExW(&wndclass);

    /* Child class */
    wndclass.lpfnWndProc = ChildWndProc;
    wndclass.cbWndExtra = sizeof(HANDLE);
    wndclass.lpszClassName = szChildClass;
    RegisterClassExW(&wndclass);

    hMenuFrame = LoadMenuW(hInstance, MAKEINTRESOURCEW(IDR_REGEDIT_MENU));
    hPopupMenus = LoadMenuW(hInstance, MAKEINTRESOURCEW(IDR_POPUP_MENUS));

    /* Initialize the Windows Common Controls DLL */
    InitCommonControls();

    /* register our hex editor control */
    HexEdit_Register();

    nClipboardFormat = RegisterClipboardFormatW(strClipboardFormat);

    hFrameWnd = CreateWindowExW(0, szFrameClass, szTitle,
                                WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE,
                                CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                                NULL, hMenuFrame, hInstance, NULL/*lpParam*/);

    if (!hFrameWnd) {
        return FALSE;
    }

    /* Create the status bar */
    hStatusBar = CreateStatusWindowW(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS,
                                     &empty, hFrameWnd, STATUS_WINDOW);
    if (hStatusBar) {
        /* Create the status bar panes */
        SetupStatusBar(hFrameWnd, FALSE);
        CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
    }
    ShowWindow(hFrameWnd, nCmdShow);
    UpdateWindow(hFrameWnd);
    return TRUE;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:55,代码来源:main.c


示例14: FillTreeView

/******************************************************************************
 * FillTreeView [Internal]
 *
 * For each child (given by lpe) of the parent shell folder, which is given by
 * lpsf and whose PIDL is pidl, insert a treeview-item right under hParent
 *
 * PARAMS
 *  info    [I] data for the dialog
 *  lpsf    [I] IShellFolder interface of the parent shell folder
 *  pidl    [I] ITEMIDLIST of the parent shell folder
 *  hParent [I] The treeview item that represents the parent shell folder
 *  lpe     [I] An iterator for the children of the parent shell folder
 */
static void FillTreeView( browse_info *info, IShellFolder * lpsf,
                 LPITEMIDLIST  pidl, HTREEITEM hParent, IEnumIDList* lpe)
{
	HTREEITEM	hPrev = 0;
	LPITEMIDLIST	pidlTemp = 0;
	ULONG		ulFetched;
	HRESULT		hr;
	HWND		hwnd = GetParent( info->hwndTreeView );

	TRACE("%p %p %p %p\n",lpsf, pidl, hParent, lpe);

	/* No IEnumIDList -> No children */
	if (!lpe) return;

	SetCapture( hwnd );
	SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) );

	while (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))
	{
	    ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
	    IEnumIDList* pEnumIL = NULL;
	    IShellFolder* pSFChild = NULL;
	    IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
	    if (ulAttrs & SFGAO_FOLDER)
	    {
	        hr = IShellFolder_BindToObject(lpsf,pidlTemp,NULL,&IID_IShellFolder,(LPVOID*)&pSFChild);
	        if (SUCCEEDED(hr))
                {
	            DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
	            hr = IShellFolder_EnumObjects(pSFChild, hwnd, flags, &pEnumIL);
                    if (hr == S_OK)
                    {
                        if ((IEnumIDList_Skip(pEnumIL, 1) != S_OK) ||
                             FAILED(IEnumIDList_Reset(pEnumIL)))
                        {
                            IEnumIDList_Release(pEnumIL);
                            pEnumIL = NULL;
                        }
                    }
                    IShellFolder_Release(pSFChild);
                }
	    }

	    if (!(hPrev = InsertTreeViewItem(info, lpsf, pidlTemp, pidl, pEnumIL, hParent)))
	        goto done;
	    SHFree(pidlTemp);  /* Finally, free the pidl that the shell gave us... */
	    pidlTemp=NULL;
	}

done:
	ReleaseCapture();
	SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW));
    SHFree(pidlTemp);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:67,代码来源:brsfolder.c


示例15: hugsprim_LoadCursorW_1

static void hugsprim_LoadCursorW_1(HugsStackPtr hugs_root)
{
    HsPtr arg1;
    HsPtr arg2;
    HsPtr res1;
    arg1 = hugs->getPtr();
    arg2 = hugs->getPtr();
    res1 = LoadCursorW(arg1, arg2);
    hugs->putPtr(res1);
    hugs->returnIO(hugs_root,1);
}
开发者ID:xpika,项目名称:winhugs,代码行数:11,代码来源:Misc.c


示例16: SetCursor

	void UGameWindow::ShowCursor(bool bVisible)
	{
		if (bVisible)
		{
			SetCursor(LoadCursorW(nullptr, IDC_ARROW));
		}
		else
		{
			SetCursor(NULL);
		}
	}
开发者ID:steventr,项目名称:MADEngine,代码行数:11,代码来源:GameWindow.cpp


示例17: LoadCursorW

void BURGER_API Burger::OSCursor::SetImageFromIDNumber(eCursor eCursorNumber)
{
	// Was there a change?

	if (eCursorNumber!=g_Global.m_eIDNumber) {
		WordPtr uCursorResource = 0;
		if (eCursorNumber!=CURSOR_NONE) {
			HINSTANCE hInstance;
			// Reset to the system cursor?
			if (eCursorNumber < CURSOR_COUNT) {
				uCursorResource = g_uSystemCursors[eCursorNumber-1];
				hInstance = NULL;
			} else {
				uCursorResource = static_cast<WordPtr>(eCursorNumber);
				hInstance = Globals::GetInstance();
			}
			// Try from the application's resource
			HCURSOR hCurs = LoadCursorW(hInstance,MAKEINTRESOURCEW(uCursorResource));
			// Did it load?
			if (!hCurs) {
				// Try the operating system instead
				hCurs = LoadCursorW(NULL,MAKEINTRESOURCEW(g_uSystemCursors[0]));
			}
			if (hCurs) {
				g_Global.m_eIDNumber = eCursorNumber;
				g_Global.m_pCursorImage = hCurs;
				g_Global.m_bActiveFlag = TRUE;
				// Tell windows to use this cursor
				SetCursor(hCurs);
				Show();
				return;
			}
		}
		// Force to a system cursor
		Hide();
		SetCursor(LoadCursorW(NULL,MAKEINTRESOURCEW(g_uSystemCursors[0])));
		g_Global.m_bActiveFlag = FALSE;
		g_Global.m_pCursorImage = NULL;
		g_Global.m_eIDNumber = CURSOR_NONE;
	}
}
开发者ID:Olde-Skuul,项目名称:burgerlib,代码行数:41,代码来源:broscursorwindows.cpp


示例18: updateCursorImage

// Updates the cursor image according to its cursor mode
//
static void updateCursorImage(_GLFWwindow* window)
{
    if (window->cursorMode == GLFW_CURSOR_NORMAL)
    {
        if (window->cursor)
            SetCursor(window->cursor->win32.handle);
        else
            SetCursor(LoadCursorW(NULL, IDC_ARROW));
    }
    else
        SetCursor(NULL);
}
开发者ID:kypp,项目名称:glfw,代码行数:14,代码来源:win32_window.c


示例19: ZeroMemory

/// <summary>
/// Creates the main window and begins processing
/// </summary>
/// <param name="hInstance">handle to the application instance</param>
/// <param name="nCmdShow">whether to display minimized, maximized, or normally</param>
int CFaceBasics::Run(HINSTANCE hInstance, int nCmdShow)
{
    MSG       msg = {0};
    WNDCLASS  wc;

    // Dialog custom window class
    ZeroMemory(&wc, sizeof(wc));
    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.cbWndExtra    = DLGWINDOWEXTRA;
    wc.hCursor       = LoadCursorW(NULL, IDC_ARROW);
    wc.hIcon         = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_APP));
	wc.lpszMenuName =  MAKEINTRESOURCE(IDR_MENU1);
    wc.lpfnWndProc   = DefDlgProcW;
    wc.lpszClassName = L"Face-And-HDFace-Basics-D2DAppDlgWndClass";

    if (!RegisterClassW(&wc))
    {
        return 0;
    }

	//hMenu = LoadMenuW(hInstance, MAKEINTRESOURCE(IDR_MENU1));
	
    // Create main application window
    HWND hWndApp = CreateDialogParamW(        NULL,         MAKEINTRESOURCE(IDD_APP),         NULL,        (DLGPROC)CFaceBasics::MessageRouter,         reinterpret_cast<LPARAM>(this));

	//HWND hWndApp = CreateDialogParamW(        NULL,         MAKEINTRESOURCE(IDD_APP),         NULL,        (DLGPROC)CFaceBasics::MessageRouter,  WS_CAPTION);


    // Show window
    ShowWindow(hWndApp, nCmdShow);
	//ShowWindow(hWndApp, 3);

    // Main message loop
    while (WM_QUIT != msg.message)
    {
        Update();

        while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
        {
            // If a dialog message will be taken care of by the dialog proc
            if (hWndApp && IsDialogMessageW(hWndApp, &msg))
            {
                continue;
            }

            TranslateMessage(&msg);
            DispatchMessageW(&msg);
        }
    }

    return static_cast<int>(msg.wParam);
}
开发者ID:dngoins,项目名称:KinectFaceStudio,代码行数:57,代码来源:FaceBasics.cpp


示例20: LoadCursorW

	void UGameWindow::ShowCursor(bool bVisible)
	{
		static const auto defaultCursor = LoadCursorW(nullptr, IDC_ARROW);

		if (bVisible)
		{
			SetCursor(defaultCursor);
		}
		else
		{
			SetCursor(nullptr);
		}
	}
开发者ID:Valakor,项目名称:MADEngine,代码行数:13,代码来源:GameWindow.cpp



注:本文中的LoadCursorW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LoadDBC函数代码示例发布时间:2022-05-30
下一篇:
C++ LoadCursorA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap