本文整理汇总了C++中LoadCursorA函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadCursorA函数的具体用法?C++ LoadCursorA怎么用?C++ LoadCursorA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadCursorA函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadCursorW_new
/* MAKE_EXPORT LoadCursorW_new=LoadCursorW */
HCURSOR WINAPI LoadCursorW_new(HINSTANCE hInstance, LPCWSTR lpCursorNameW)
{
if(IS_INTRESOURCE(lpCursorNameW))
return LoadCursorA(hInstance, (LPCSTR)lpCursorNameW);
ALLOC_WtoA(lpCursorName);
return LoadCursorA(hInstance, lpCursorNameA);
}
示例2: scrollbar_test_init
static void scrollbar_test_init(void)
{
WNDCLASSEXA wc;
CHAR cls_name[] = "scroll_test_class";
LONG style[] = {WS_VSCROLL, WS_HSCROLL, WS_VSCROLL | WS_HSCROLL, 0};
int i;
memset( &wc, 0, sizeof wc );
wc.cbSize = sizeof wc;
wc.style = CS_VREDRAW | CS_HREDRAW;
wc.hInstance = GetModuleHandleA(0);
wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszClassName = cls_name;
wc.lpfnWndProc = scroll_init_proc;
RegisterClassExA(&wc);
for(i = 0; i < sizeof style / sizeof style[0]; i++)
{
/* need not to destroy these windows due creation abort */
CreateWindowExA(0, cls_name, NULL, style[i],
100, 100, 100, 100, NULL, NULL, wc.hInstance, (LPVOID)TRUE);
CreateWindowExA(0, cls_name, NULL, style[i],
100, 100, 100, 100, NULL, NULL, wc.hInstance, (LPVOID)FALSE);
}
UnregisterClassA(cls_name, wc.hInstance);
}
示例3: CreateTestWindow
static HWND CreateTestWindow()
{
MSG msg;
WNDCLASSA wclass;
HANDLE hInstance = GetModuleHandleA( NULL );
HWND hWndTest;
wclass.lpszClassName = "MouseInputTestClass";
wclass.style = CS_HREDRAW | CS_VREDRAW;
wclass.lpfnWndProc = WndProc;
wclass.hInstance = hInstance;
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0;
wclass.cbWndExtra = 0;
RegisterClassA( &wclass );
/* create the test window that will receive the keystrokes */
hWndTest = CreateWindowA( wclass.lpszClassName, "MouseInputTestTest",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 100, 100,
NULL, NULL, hInstance, NULL);
assert( hWndTest );
ShowWindow( hWndTest, SW_SHOWMAXIMIZED);
SetWindowPos( hWndTest, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
SetForegroundWindow( hWndTest );
UpdateWindow( hWndTest);
SetFocus(hWndTest);
/* flush pending messages */
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
return hWndTest;
}
示例4: RegisterWindowClasses
static BOOL RegisterWindowClasses (void)
{
WNDCLASSA cls;
cls.style = 0;
cls.lpfnWndProc = DefWindowProcA;
cls.cbClsExtra = 0;
cls.cbWndExtra = 0;
cls.hInstance = g_hinst;
cls.hIcon = NULL;
cls.hCursor = LoadCursorA (NULL, IDC_ARROW);
cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
cls.lpszMenuName = NULL;
cls.lpszClassName = "GetNextDlgItemWindowClass";
if (!RegisterClassA (&cls)) return FALSE;
cls.lpfnWndProc = main_window_procA;
cls.lpszClassName = "IsDialogMessageWindowClass";
if (!RegisterClassA (&cls)) return FALSE;
GetClassInfoA(0, "#32770", &cls);
cls.lpfnWndProc = testDlgWinProc;
cls.lpszClassName = "WM_NEXTDLGCTLWndClass";
if (!RegisterClassA (&cls)) return FALSE;
return TRUE;
}
示例5: init
static void init(void)
{
WNDCLASSA wc;
RECT rect;
BOOL ret;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleA(NULL);
wc.hIcon = NULL;
wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = progressTestClass;
wc.lpfnWndProc = progress_test_wnd_proc;
RegisterClassA(&wc);
SetRect(&rect, 0, 0, 400, 20);
ret = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
ok(ret, "got %d\n", ret);
hProgressParentWnd = CreateWindowExA(0, progressTestClass, "Progress Bar Test", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressParentWnd != NULL, "failed to create parent wnd\n");
}
示例6: createwindow
static void createwindow(void)
{
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = DefWindowProcA;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleA(0);
wc.hIcon = LoadIconA(wc.hInstance, IDI_APPLICATION);
wc.hCursor = LoadCursorA(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = "TestWindowClass";
if(!RegisterClassA(&wc))
assert(0);
hwnd = CreateWindowExA(0, "TestWindowClass", "TestWindowClass",
WS_POPUP, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL, NULL, GetModuleHandleA(0), NULL);
assert(hwnd != NULL);
ShowWindow(hwnd, SW_HIDE);
UpdateWindow(hwnd);
SetFocus(hwnd);
}
示例7: GetWindowLongA
bool RenderWindow::Init(void *pData)
{
bool bRet=false;
WNDCLASSEXA wndclass;
wndclass.cbWndExtra=0;
wndclass.cbClsExtra=0;
wndclass.cbSize=sizeof(WNDCLASSEXA);
wndclass.hbrBackground=NULL;
wndclass.hCursor=LoadCursorA(NULL,MAKEINTRESOURCEA(IDC_ARROW));
wndclass.hInstance=*(HINSTANCE*)pData;
wndclass.style=CS_VREDRAW|CS_HREDRAW;
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName="vCoreMainWindow";
if (NULL==wndclass.hInstance)
{
Van::Log::ErrLog.Print("hinstance is null");
}
wndclass.hIcon=(HICON)LoadImageA(wndclass.hInstance,"../Logo.ico",IMAGE_ICON,0,0,LR_LOADFROMFILE);
wndclass.hIconSm=(HICON)LoadImageA(wndclass.hInstance,"../Logo.ico",IMAGE_ICON,0,0,LR_LOADFROMFILE);
wndclass.lpfnWndProc=SystemEventManager::SystemEventProcesser;
if (!RegisterClassExA(&wndclass))
{
Van::Log::ErrLog.Print("RegisterClassExA fail!");
return false;
}
Van::Log::DebugLog.Print("Register Render Window Sucess!");
m_hWnd=CreateWindowExA((DWORD)NULL,
"vCoreMainWindow",
"Van Core Render Window",
WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|!WS_MAXIMIZEBOX,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
*(HINSTANCE*)pData,
NULL);
if(NULL==m_hWnd)
{
Log::ErrLog.Print("create Window fail!");
return false;
}
m_hDC=GetDC(m_hWnd);
DWORD dwCurrentStyle = GetWindowLongA(m_hWnd, GWL_STYLE);
SetWindowLong(m_hWnd, GWL_STYLE, dwCurrentStyle &~WS_SYSMENU);
m_pRenderWindow=new GLRenderWindow();
RECT rect;
GetWindowRect(m_hWnd,&rect);
m_uiWidth=rect.right-rect.left;
m_uiHeight=rect.bottom-rect.top;
if(m_pRenderWindow->CreateRendererViaDevice(m_hWnd,m_hDC,m_uiWidth,m_uiHeight))
{
bRet=true;
CreateScene();
}
return bRet;
}
示例8: sgens_window_show
/**
* sgens_window_show(): Show the VDP Layer Options window.
* @param parent Parent window.
*/
void MDP_FNCALL sgens_window_show(void *parent)
{
if (sgens_window)
{
// Sonic Gens window is already visible. Set focus.
// TODO: Figure out how to do this.
ShowWindow(sgens_window, SW_SHOW);
return;
}
// Initialize the Win32 Unicode Translation Layer.
w32u_init();
sgens_window_child_windows_created = FALSE;
// If no HINSTANCE was specified, use the main executable's HINSTANCE.
if (!sgens_hInstance)
sgens_hInstance = GetModuleHandle(NULL);
if (sgens_wndclass.lpfnWndProc != sgens_window_wndproc)
{
// Create the window class.
sgens_wndclass.style = 0;
sgens_wndclass.lpfnWndProc = sgens_window_wndproc;
sgens_wndclass.cbClsExtra = 0;
sgens_wndclass.cbWndExtra = 0;
sgens_wndclass.hInstance = sgens_hInstance;
sgens_wndclass.hIcon = LoadIconA(sgens_hInstance, MAKEINTRESOURCE(IDI_SGENS));
sgens_wndclass.hCursor = LoadCursorA(NULL, IDC_ARROW);
sgens_wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
sgens_wndclass.lpszMenuName = NULL;
sgens_wndclass.lpszClassName = "mdp_misc_sgens_window";
pRegisterClassU(&sgens_wndclass);
}
// Create the window.
sgens_window = pCreateWindowU("mdp_misc_sgens_window", "Sonic Gens",
WS_DLGFRAME | WS_POPUP | WS_SYSMENU | WS_CAPTION,
CW_USEDEFAULT, CW_USEDEFAULT,
SGENS_WINDOW_WIDTH, SGENS_WINDOW_HEIGHT,
(HWND)parent, NULL, sgens_hInstance, NULL);
// Window adjustment.
gsft_win32_set_actual_window_size(sgens_window, SGENS_WINDOW_WIDTH, SGENS_WINDOW_HEIGHT);
gsft_win32_center_on_window(sgens_window, (HWND)parent);
// Update the current ROM type and information display.
sgens_window_update_rom_type();
sgens_window_update();
UpdateWindow(sgens_window);
ShowWindow(sgens_window, TRUE);
// Register the window with MDP Host Services.
sgens_host_srv->window_register(&mdp, sgens_window);
}
示例9: SetCursor
void MCScreenDC::setcursor(Window p_window, MCCursorRef p_cursor)
{
if (p_cursor == nil || p_cursor -> kind == kMCCursorNone)
SetCursor(NULL);
else if (p_cursor -> kind == kMCCursorStandard)
SetCursor(LoadCursorA(nil, p_cursor -> standard));
else
SetCursor(p_cursor -> custom);
}
示例10: WinMain
int CALLBACK
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HINSTANCE Module = hInstance;
WNDCLASSEX WindowClass = {};
WindowClass.cbSize = sizeof(WindowClass);
WindowClass.style = CS_HREDRAW | CS_VREDRAW;
WindowClass.lpfnWndProc = MainWindowProc;
WindowClass.hInstance = Module;
WindowClass.hIcon = LoadIcon(0, IDI_APPLICATION);
WindowClass.hCursor = LoadCursorA(0, IDC_ARROW);
WindowClass.lpszClassName = WINDOW_CLASS_NAME;
RegisterClassExA(&WindowClass);
DWORD WindowExStyle = WS_EX_APPWINDOW;
DWORD WindowStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
HWND MainWindow = CreateWindowEx(
WindowExStyle,
WINDOW_CLASS_NAME,
"FSWindow",
WindowStyle,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
0, 0,
Module,
0);
RECT AdjustRect = {};
AdjustRect.right = MAIN_WINDOW_WIDTH;
AdjustRect.bottom = MAIN_WINDOW_HEIGHT;
AdjustWindowRectEx(&AdjustRect, WindowStyle, FALSE, WindowExStyle);
SetWindowPos(MainWindow, 0,
0, 0,
AdjustRect.right - AdjustRect.left, AdjustRect.bottom - AdjustRect.top,
SWP_NOMOVE | SWP_NOCOPYBITS | SWP_SHOWWINDOW);
BOOL Running = TRUE;
while(Running) {
MSG Message;
while(PeekMessageA(&Message, 0, 0, 0, PM_REMOVE)) {
if(Message.message == WM_QUIT) {
Running = FALSE;
break;
}
else {
TranslateMessage(&Message);
DispatchMessageA(&Message);
}
}
Sleep(10);
}
return 0;
}
示例11: 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);
}
示例12: vlopt_window_show
/**
* vlopt_window_show(): Show the VDP Layer Options window.
* @param parent Parent window.
*/
void vlopt_window_show(void *parent)
{
if (vlopt_window)
{
// VDP Layer Options window is already visible.
// Set focus.
// TODO
return;
}
// Initialize the Win32 Unicode Translation Layer.
w32u_init();
vlopt_window_child_windows_created = FALSE;
// If no HINSTANCE was specified, use the main executable's HINSTANCE.
if (!vlopt_hInstance)
vlopt_hInstance = pGetModuleHandleU(NULL);
// Create the window class.
if (vlopt_window_wndclass.lpfnWndProc != vlopt_window_wndproc)
{
vlopt_window_wndclass.style = 0;
vlopt_window_wndclass.lpfnWndProc = vlopt_window_wndproc;
vlopt_window_wndclass.cbClsExtra = 0;
vlopt_window_wndclass.cbWndExtra = 0;
vlopt_window_wndclass.hInstance = vlopt_hInstance;
vlopt_window_wndclass.hIcon = LoadIconA(vlopt_hInstance, MAKEINTRESOURCE(IDI_VLOPT));
vlopt_window_wndclass.hCursor = LoadCursorA(NULL, IDC_ARROW);
vlopt_window_wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
vlopt_window_wndclass.lpszMenuName = NULL;
vlopt_window_wndclass.lpszClassName = "vlopt_window_wndclass";
pRegisterClassU(&vlopt_window_wndclass);
}
// Create the window.
vlopt_window = pCreateWindowU("vlopt_window_wndclass", "VDP Layer Options",
WS_DLGFRAME | WS_POPUP | WS_SYSMENU | WS_CAPTION,
CW_USEDEFAULT, CW_USEDEFAULT,
DLU_X(VLOPT_WINDOW_WIDTH), DLU_Y(VLOPT_WINDOW_HEIGHT),
(HWND)parent, NULL, vlopt_hInstance, NULL);
// Window adjustment.
gsft_win32_set_actual_window_size(vlopt_window, DLU_X(VLOPT_WINDOW_WIDTH), DLU_Y(VLOPT_WINDOW_HEIGHT));
gsft_win32_center_on_window(vlopt_window, (HWND)parent);
UpdateWindow(vlopt_window);
ShowWindow(vlopt_window, TRUE);
// Register the window with MDP Host Services.
vlopt_host_srv->window_register(&mdp, vlopt_window);
}
示例13: init
static void init(void)
{
HMODULE hComctl32;
BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
WNDCLASSA wc;
RECT rect;
BOOL ret;
hComctl32 = GetModuleHandleA("comctl32.dll");
pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx");
if (pInitCommonControlsEx)
{
INITCOMMONCONTROLSEX iccex;
iccex.dwSize = sizeof(iccex);
iccex.dwICC = ICC_PROGRESS_CLASS;
pInitCommonControlsEx(&iccex);
}
else
InitCommonControls();
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleA(NULL);
wc.hIcon = NULL;
wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = progressTestClass;
wc.lpfnWndProc = progress_test_wnd_proc;
RegisterClassA(&wc);
SetRect(&rect, 0, 0, 400, 20);
ret = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
ok(ret, "got %d\n", ret);
hProgressParentWnd = CreateWindowExA(0, progressTestClass, "Progress Bar Test", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressParentWnd != NULL, "failed to create parent wnd\n");
GetClientRect(hProgressParentWnd, &rect);
hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE,
0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressWnd != NULL, "failed to create parent wnd\n");
progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc);
ShowWindow(hProgressParentWnd, SW_SHOWNORMAL);
ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n");
flush_events();
update_window(hProgressParentWnd);
}
示例14: register_parent_wnd_class
static BOOL register_parent_wnd_class(void){
WNDCLASSA cls;
cls.style = 0;
cls.lpfnWndProc = parent_wnd_proc;
cls.cbClsExtra = 0;
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(NULL);
cls.hIcon = 0;
cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "Trackbar test parent class";
return RegisterClassA(&cls);
}
示例15: register_testwindow_class
static void register_testwindow_class(void)
{
WNDCLASSEXA cls;
ZeroMemory(&cls, sizeof(cls));
cls.cbSize = sizeof(cls);
cls.style = 0;
cls.lpfnWndProc = testwindow_wndproc;
cls.hInstance = NULL;
cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
cls.hbrBackground = (HBRUSH) COLOR_WINDOW;
cls.lpszClassName = testwindow_class;
RegisterClassExA(&cls);
}