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

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

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

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

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

示例1: init

static BOOL init(void){    HMODULE hComctl32;    BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);    WNDCLASSA wc;    INITCOMMONCONTROLSEX iccex;    hComctl32 = GetModuleHandleA("comctl32.dll");    pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx");    if (!pInitCommonControlsEx)    {        win_skip("InitCommonControlsEx() is missing. Skipping the tests/n");        return FALSE;    }    iccex.dwSize = sizeof(iccex);    iccex.dwICC  = ICC_USEREX_CLASSES;    pInitCommonControlsEx(&iccex);    pSetWindowSubclass = (void*)GetProcAddress(hComctl32, (LPSTR)410);    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 = ComboExTestClass;    wc.lpfnWndProc = ComboExTestWndProc;    RegisterClassA(&wc);    hComboExParentWnd = CreateWindowExA(0, ComboExTestClass, "ComboEx test", WS_OVERLAPPEDWINDOW|WS_VISIBLE,      CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, GetModuleHandleA(NULL), 0);    ok(hComboExParentWnd != NULL, "failed to create parent window/n");    hMainHinst = GetModuleHandleA(NULL);    return hComboExParentWnd != NULL;}
开发者ID:hoangduit,项目名称:reactos,代码行数:40,


示例2: InitInstance

BOOL InitInstance(HANDLE hInstance) {    WNDCLASSEX wcex;    RECT rect;    int height, width;    memset(&wcex, 0x00, sizeof(wcex));    wcex.cbSize = sizeof(WNDCLASSEX);    wcex.style = CS_HREDRAW | CS_VREDRAW;    wcex.lpfnWndProc = WndProc;    wcex.hInstance = hInstance;    wcex.lpszClassName = ClassName;    RegisterClassExA(&wcex);    //calculate required window width and height, taking in account the required client area and borders    height = BoardHeight*BlockSize;    width = BoardWidth*BlockSize;    rect.left = 0;    rect.top = 0;    rect.bottom = height;    rect.right = width;    AdjustWindowRectEx(&rect, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_TOPMOST);    height += ((rect.bottom - rect.top) - height);    width += ((rect.right - rect.left) - width);    /////////////////////////////////////////////////    if ((hWndMain = CreateWindowExA(WS_EX_TOPMOST, ClassName, MainTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, width, height, NULL, NULL, hInstance, NULL)) == NULL) {        return FALSE;    }    ShowWindow(hWndMain, SW_SHOW);    UpdateWindow(hWndMain);    return TRUE;}
开发者ID:3A9C,项目名称:ITstep,代码行数:40,


示例3: thread

static DWORD CALLBACK thread( LPVOID arg ){    HDESK d1, d2;    HWND hwnd = CreateWindowExA(0,"WinStationClass","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0);    ok( hwnd != 0, "CreateWindow failed/n" );    d1 = GetThreadDesktop(GetCurrentThreadId());    trace( "thread %p desktop: %p/n", arg, d1 );    ok( d1 == initial_desktop, "thread %p doesn't use initial desktop/n", arg );    SetLastError( 0xdeadbeef );    ok( !CloseHandle( d1 ), "CloseHandle succeeded/n" );    ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d/n", GetLastError() );    SetLastError( 0xdeadbeef );    ok( !CloseDesktop( d1 ), "CloseDesktop succeeded/n" );    ok( GetLastError() == ERROR_BUSY || broken(GetLastError() == 0xdeadbeef), /* wow64 */        "bad last error %d/n", GetLastError() );    print_object( d1 );    d2 = CreateDesktopA( "foobar2", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );    trace( "created desktop %p/n", d2 );    ok( d2 != 0, "CreateDesktop failed/n" );    SetLastError( 0xdeadbeef );    ok( !SetThreadDesktop( d2 ), "set thread desktop succeeded with existing window/n" );    ok( GetLastError() == ERROR_BUSY || broken(GetLastError() == 0xdeadbeef), /* wow64 */        "bad last error %d/n", GetLastError() );    DestroyWindow( hwnd );    ok( SetThreadDesktop( d2 ), "set thread desktop failed/n" );    d1 = GetThreadDesktop(GetCurrentThreadId());    ok( d1 == d2, "GetThreadDesktop did not return set desktop %p/%p/n", d1, d2 );    print_object( d2 );    if (arg < (LPVOID)5)    {        HANDLE hthread = CreateThread( NULL, 0, thread, (char *)arg + 1, 0, NULL );        Sleep(1000);        WaitForSingleObject( hthread, INFINITE );        CloseHandle( hthread );    }    return 0;}
开发者ID:hoangduit,项目名称:reactos,代码行数:40,


示例4: create_updown_control

static HWND create_updown_control(DWORD style, HWND buddy){    WNDPROC oldproc;    HWND updown;    RECT rect;    GetClientRect(parent_wnd, &rect);    updown = CreateWindowExA(0, UPDOWN_CLASSA, NULL, WS_CHILD | WS_BORDER | WS_VISIBLE | style,                           0, 0, rect.right, rect.bottom,                           parent_wnd, (HMENU)1, GetModuleHandleA(NULL), NULL);    ok(updown != NULL, "Failed to create UpDown control./n");    if (!updown) return NULL;    SendMessageA(updown, UDM_SETBUDDY, (WPARAM)buddy, 0);    SendMessageA(updown, UDM_SETRANGE, 0, MAKELONG(100, 0));    SendMessageA(updown, UDM_SETPOS, 0, MAKELONG(50, 0));    oldproc = (WNDPROC)SetWindowLongPtrA(updown, GWLP_WNDPROC,                                         (LONG_PTR)updown_subclass_proc);    SetWindowLongPtrA(updown, GWLP_USERDATA, (LONG_PTR)oldproc);    return updown;}
开发者ID:Jactry,项目名称:wine,代码行数:23,


示例5: GetForegroundWindow

bool pinDialogPriv::doNonmodalNotifyDlg(bool messageLoop) {	MSG  msg ;    	HWND hwnd = GetForegroundWindow();	WNDCLASSEXA wc = {0};	wc.cbSize           = sizeof(WNDCLASSEX);	wc.lpfnWndProc      = (WNDPROC) nonmodalDialogProc;	wc.hInstance        = params.m_hInst;	wc.hbrBackground    = GetSysColorBrush(COLOR_3DFACE);	wc.lpszClassName    = "DialogClass";	RegisterClassExA(&wc);	m_hwnd = CreateWindowExA(WS_EX_DLGMODALFRAME | WS_EX_TOPMOST,  "DialogClass", "PIN message", 		WS_VISIBLE | WS_SYSMENU | WS_CAPTION , 100, 100, 380, 80, 		NULL, NULL, params.m_hInst,  this);	int counter = 20; //always pump some messages, like dialog init	while( GetMessage(&msg, NULL, 0, 0) && counter--) {		DispatchMessage(&msg);		if (messageLoop) counter = 20; 		}	return true;	}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:23,


示例6: osinterface_progressbar_create

/** *  *  rct2: 0x00407E6E */int osinterface_progressbar_create(char* title, int a2){	DWORD style = WS_VISIBLE | WS_BORDER | WS_DLGFRAME;	if (a2) {		style = WS_VISIBLE | WS_BORDER | WS_DLGFRAME | PBS_SMOOTH;	}	int width = 340;	int height = GetSystemMetrics(SM_CYCAPTION) + 24;	HWND hwnd = CreateWindowExA(WS_EX_TOPMOST | WS_EX_DLGMODALFRAME, "msctls_progress32", title, style, (RCT2_GLOBAL(0x01423C08, sint32) - width) / 2, (RCT2_GLOBAL(0x01423C0C, sint32) - height) / 2, width, height, 0, 0, RCT2_GLOBAL(RCT2_ADDRESS_HINSTANCE, HINSTANCE), 0);	RCT2_GLOBAL(RCT2_ADDRESS_PROGRESSBAR_HWND, HWND) = hwnd;	if (hwnd) {		RCT2_GLOBAL(0x009E2DFC, uint32) = 1;		if (RCT2_GLOBAL(RCT2_ADDRESS_HFONT, HFONT)) {			SendMessageA(hwnd, WM_SETFONT, (WPARAM)RCT2_GLOBAL(RCT2_ADDRESS_HFONT, HFONT), 1);		}		SetWindowTextA(hwnd, title);		osinterface_progressbar_setmax(0xFF);		osinterface_progressbar_setpos(0);		return 1;	} else {		return 0;	}}
开发者ID:jcdavis,项目名称:OpenRCT2,代码行数:27,


示例7: create_datetime_control

static HWND create_datetime_control(DWORD style){    WNDPROC oldproc;    HWND hWndDateTime = NULL;    hWndDateTime = CreateWindowExA(0,        DATETIMEPICK_CLASSA,        NULL,        style,        0,50,300,120,        NULL,        NULL,        NULL,        NULL);    if (!hWndDateTime) return NULL;    oldproc = (WNDPROC)SetWindowLongPtrA(hWndDateTime, GWLP_WNDPROC,                                         (LONG_PTR)datetime_subclass_proc);    SetWindowLongPtrA(hWndDateTime, GWLP_USERDATA, (LONG_PTR)oldproc);    return hWndDateTime;}
开发者ID:GYGit,项目名称:reactos,代码行数:23,


示例8: test_margin

static void test_margin(void){    RECT r, r1;    HWND hwnd;    DWORD ret;    hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0,                           10, 10, 300, 100,                           NULL, NULL, NULL, 0);    ok(hwnd != NULL, "failed to create tooltip wnd/n");    ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);    ok(!ret, "got %d/n", ret);    SetRect(&r, -1, -1, 1, 1);    ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, (LPARAM)&r);    ok(!ret, "got %d/n", ret);    SetRect(&r1, 0, 0, 0, 0);    ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);    ok(!ret, "got %d/n", ret);    ok(EqualRect(&r, &r1), "got %s, was %s/n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));    ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);    ok(!ret, "got %d/n", ret);    SetRect(&r1, 0, 0, 0, 0);    ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);    ok(!ret, "got %d/n", ret);    ok(EqualRect(&r, &r1), "got %s, was %s/n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));    ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, 0);    ok(!ret, "got %d/n", ret);    DestroyWindow(hwnd);}
开发者ID:bdidemus,项目名称:wine,代码行数:36,


示例9: windowThreadFunction

static unsigned __stdcallwindowThreadFunction( LPVOID _lpParam ){    WindowThreadParam *lpParam = (WindowThreadParam *)_lpParam;    // Actually create the window    lpParam->hWnd = CreateWindowExA(dwExStyle,                                    g_lpszClassName,                                    lpParam->lpszWindowName,                                    dwStyle,                                    0, // x                                    0, // y                                    lpParam->nWidth,                                    lpParam->nHeight,                                    NULL, // hWndParent                                    NULL, // hMenu                                    NULL, // hInstance                                    NULL); // lpParam    // Notify parent thread that window has been created    SetEvent(lpParam->hEvent);    BOOL bRet;    MSG msg;    while ((bRet = GetMessage(&msg, NULL, 0, 0 )) != FALSE) {        if (bRet == -1) {            // handle the error and possibly exit        } else {            TranslateMessage(&msg);            DispatchMessage(&msg);        }    }    // Return the exit code    return msg.wParam;}
开发者ID:Innovative-Ideas,项目名称:apitrace,代码行数:36,


示例10: test_customdraw

static void test_customdraw(void) {    static struct {        LRESULT FirstReturnValue;        int ExpectedCalls;    } expectedResults[] = {        /* Valid notification responses */        {CDRF_DODEFAULT, TEST_CDDS_PREPAINT},        {CDRF_SKIPDEFAULT, TEST_CDDS_PREPAINT},        {CDRF_NOTIFYPOSTPAINT, TEST_CDDS_PREPAINT | TEST_CDDS_POSTPAINT},        /* Invalid notification responses */        {CDRF_NOTIFYITEMDRAW, TEST_CDDS_PREPAINT},        {CDRF_NOTIFYPOSTERASE, TEST_CDDS_PREPAINT},        {CDRF_NEWFONT, TEST_CDDS_PREPAINT}    };   DWORD       iterationNumber;   WNDCLASSA wc;   LRESULT   lResult;   /* Create a class to use the custom draw wndproc */   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 = "CustomDrawClass";   wc.lpfnWndProc = custom_draw_wnd_proc;   RegisterClassA(&wc);   for (iterationNumber = 0;        iterationNumber < sizeof(expectedResults)/sizeof(expectedResults[0]);        iterationNumber++) {       HWND parent, hwndTip;       RECT rect;       TTTOOLINFOA toolInfo = { 0 };       /* Create a main window */       parent = CreateWindowExA(0, "CustomDrawClass", NULL,                               WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |                               WS_MAXIMIZEBOX | WS_VISIBLE,                               50, 50,                               300, 300,                               NULL, NULL, NULL, 0);       ok(parent != NULL, "Creation of main window failed/n");       /* Make it show */       ShowWindow(parent, SW_SHOWNORMAL);       flush_events(100);       /* Create Tooltip */       hwndTip = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASSA,                                NULL, TTS_NOPREFIX | TTS_ALWAYSTIP,                                CW_USEDEFAULT, CW_USEDEFAULT,                                CW_USEDEFAULT, CW_USEDEFAULT,                                parent, NULL, GetModuleHandleA(NULL), 0);       ok(hwndTip != NULL, "Creation of tooltip window failed/n");       /* Set up parms for the wndproc to handle */       CD_Stages = 0;       CD_Result = expectedResults[iterationNumber].FirstReturnValue;       g_hwnd    = hwndTip;       /* Make it topmost, as per the MSDN */       SetWindowPos(hwndTip, HWND_TOPMOST, 0, 0, 0, 0,             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);       /* Create a tool */       toolInfo.cbSize = TTTOOLINFOA_V1_SIZE;       toolInfo.hwnd = parent;       toolInfo.hinst = GetModuleHandleA(NULL);       toolInfo.uFlags = TTF_SUBCLASS;       toolInfo.uId = 0x1234ABCD;       toolInfo.lpszText = (LPSTR)"This is a test tooltip";       toolInfo.lParam = 0xdeadbeef;       GetClientRect (parent, &toolInfo.rect);       lResult = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);       ok(lResult, "Adding the tool to the tooltip failed/n");       /* Make tooltip appear quickly */       SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0));       /* Put cursor inside window, tooltip will appear immediately */       GetWindowRect( parent, &rect );       SetCursorPos( (rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2 );       flush_events(200);       if (CD_Stages)       {           /* Check CustomDraw results */           ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls ||              broken(CD_Stages == (expectedResults[iterationNumber].ExpectedCalls & ~TEST_CDDS_POSTPAINT)), /* nt4 */              "CustomDraw run %d stages %x, expected %x/n", iterationNumber, CD_Stages,              expectedResults[iterationNumber].ExpectedCalls);       }//.........这里部分代码省略.........
开发者ID:bdidemus,项目名称:wine,代码行数:101,


示例11: WinMain

INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE ignoreMe0, LPSTR ignoreMe1, INT ignoreMe2){    LPCSTR szName = "Pez App";    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, GetModuleHandle(0), 0, 0, 0, 0, szName, 0 };    DWORD dwStyle = WS_SYSMENU | WS_VISIBLE | WS_POPUP;    DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;    RECT rect;    int windowWidth, windowHeight, windowLeft, windowTop;    HWND hWnd;    PIXELFORMATDESCRIPTOR pfd;    HDC hDC;    HGLRC hRC;    int pixelFormat;    GLenum err;    DWORD previousTime = GetTickCount();    MSG msg = {0};    wc.hCursor = LoadCursor(0, IDC_ARROW);    RegisterClassEx(&wc);    SetRect(&rect, 0, 0, PEZ_VIEWPORT_WIDTH, PEZ_VIEWPORT_HEIGHT);    AdjustWindowRectEx(&rect, dwStyle, FALSE, dwExStyle);    windowWidth = rect.right - rect.left;    windowHeight = rect.bottom - rect.top;    windowLeft = GetSystemMetrics(SM_CXSCREEN) / 2 - windowWidth / 2;    windowTop = GetSystemMetrics(SM_CYSCREEN) / 2 - windowHeight / 2;    hWnd = CreateWindowExA(0, szName, szName, dwStyle, windowLeft, windowTop, windowWidth, windowHeight, 0, 0, 0, 0);    // Create the GL context.    ZeroMemory(&pfd, sizeof(pfd));    pfd.nSize = sizeof(pfd);    pfd.nVersion = 1;    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;    pfd.iPixelType = PFD_TYPE_RGBA;    pfd.cColorBits = 24;    pfd.cDepthBits = 24;    pfd.cStencilBits = 8;    pfd.iLayerType = PFD_MAIN_PLANE;    hDC = GetDC(hWnd);    pixelFormat = ChoosePixelFormat(hDC, &pfd);    SetPixelFormat(hDC, pixelFormat, &pfd);    hRC = wglCreateContext(hDC);    wglMakeCurrent(hDC, hRC);    if (PEZ_ENABLE_MULTISAMPLING)    {        int pixelAttribs[] =        {            WGL_SAMPLES_ARB, 16,            WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,            WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,            WGL_SUPPORT_OPENGL_ARB, GL_TRUE,            WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,            WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,            WGL_RED_BITS_ARB, 8,            WGL_GREEN_BITS_ARB, 8,            WGL_BLUE_BITS_ARB, 8,            WGL_ALPHA_BITS_ARB, 8,            WGL_DEPTH_BITS_ARB, 24,            WGL_STENCIL_BITS_ARB, 8,            WGL_DOUBLE_BUFFER_ARB, GL_TRUE,            0        };        int* sampleCount = pixelAttribs + 1;        int* useSampleBuffer = pixelAttribs + 3;        int pixelFormat = -1;        PROC proc = wglGetProcAddress("wglChoosePixelFormatARB");        unsigned int numFormats;        PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC) proc;        if (!wglChoosePixelFormatARB)        {            PezFatalError("Could not load function pointer for 'wglChoosePixelFormatARB'.  Is your driver properly installed?");        }        // Try fewer and fewer samples per pixel till we find one that is supported:        while (pixelFormat <= 0 && *sampleCount >= 0)        {            wglChoosePixelFormatARB(hDC, pixelAttribs, 0, 1, &pixelFormat, &numFormats);            (*sampleCount)--;            if (*sampleCount <= 1)            {                *useSampleBuffer = GL_FALSE;            }        }        // Win32 allows the pixel format to be set only once per app, so destroy and re-create the app:        DestroyWindow(hWnd);        hWnd = CreateWindowExA(0, szName, szName, dwStyle, windowLeft, windowTop, windowWidth, windowHeight, 0, 0, 0, 0);        SetWindowPos(hWnd, HWND_TOP, windowLeft, windowTop, windowWidth, windowHeight, 0);        hDC = GetDC(hWnd);        SetPixelFormat(hDC, pixelFormat, &pfd);        hRC = wglCreateContext(hDC);        wglMakeCurrent(hDC, hRC);    }#define PEZ_TRANSPARENT_WINDOW 0//.........这里部分代码省略.........
开发者ID:jsj2008,项目名称:blog-source,代码行数:101,


示例12: test_invalid_init

static void test_invalid_init(void){    HRESULT hr;    IAutoComplete *ac;    IUnknown *acSource;    HWND edit_control;    /* AutoComplete instance */    hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER,                         &IID_IAutoComplete, (void **)&ac);    if (hr == REGDB_E_CLASSNOTREG)    {        win_skip("CLSID_AutoComplete is not registered/n");        return;    }    ok(hr == S_OK, "no IID_IAutoComplete (0x%08x)/n", hr);    /* AutoComplete source */    hr = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER,                        &IID_IACList, (void **)&acSource);    if (hr == REGDB_E_CLASSNOTREG)    {        win_skip("CLSID_ACLMulti is not registered/n");        IAutoComplete_Release(ac);        return;    }    ok(hr == S_OK, "no IID_IACList (0x%08x)/n", hr);    edit_control = CreateWindowExA(0, "EDIT", "Some text", 0, 10, 10, 300, 300,                       hMainWnd, NULL, hinst, NULL);    ok(edit_control != NULL, "Can't create edit control/n");    /* The refcount of acSource would be incremented on older Windows. */    hr = IAutoComplete_Init(ac, NULL, acSource, NULL, NULL);    ok(hr == E_INVALIDARG ||       broken(hr == S_OK), /* Win2k/XP/Win2k3 */       "Init returned 0x%08x/n", hr);    if (hr == E_INVALIDARG)    {        LONG ref;        IUnknown_AddRef(acSource);        ref = IUnknown_Release(acSource);        ok(ref == 1, "Expected AutoComplete source refcount to be 1, got %d/n", ref);    }if (0){    /* Older Windows versions never check the window handle, while newer     * versions only check for NULL. Subsequent attempts to initialize the     * object after this call succeeds would fail, because initialization     * state is determined by whether a non-NULL window handle is stored. */    hr = IAutoComplete_Init(ac, (HWND)0xdeadbeef, acSource, NULL, NULL);    ok(hr == S_OK, "Init returned 0x%08x/n", hr);    /* Tests crash on older Windows. */    hr = IAutoComplete_Init(ac, NULL, NULL, NULL, NULL);    ok(hr == E_INVALIDARG, "Init returned 0x%08x/n", hr);    hr = IAutoComplete_Init(ac, edit_control, NULL, NULL, NULL);    ok(hr == E_INVALIDARG, "Init returned 0x%08x/n", hr);}    /* bind to edit control */    hr = IAutoComplete_Init(ac, edit_control, acSource, NULL, NULL);    ok(hr == S_OK, "Init returned 0x%08x/n", hr);    /* try invalid parameters after successful initialization .*/    hr = IAutoComplete_Init(ac, NULL, NULL, NULL, NULL);    ok(hr == E_INVALIDARG ||       hr == E_FAIL, /* Win2k/XP/Win2k3 */       "Init returned 0x%08x/n", hr);    hr = IAutoComplete_Init(ac, NULL, acSource, NULL, NULL);    ok(hr == E_INVALIDARG ||       hr == E_FAIL, /* Win2k/XP/Win2k3 */       "Init returned 0x%08x/n", hr);    hr = IAutoComplete_Init(ac, edit_control, NULL, NULL, NULL);    ok(hr == E_INVALIDARG ||       hr == E_FAIL, /* Win2k/XP/Win2k3 */       "Init returned 0x%08x/n", hr);    /* try initializing twice on the same control */    hr = IAutoComplete_Init(ac, edit_control, acSource, NULL, NULL);    ok(hr == E_FAIL, "Init returned 0x%08x/n", hr);    /* try initializing with a different control */    hr = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);    ok(hr == E_FAIL, "Init returned 0x%08x/n", hr);    DestroyWindow(edit_control);    /* try initializing with a different control after     * destroying the original initialization control */    hr = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);    ok(hr == E_UNEXPECTED ||       hr == E_FAIL, /* Win2k/XP/Win2k3 */       "Init returned 0x%08x/n", hr);//.........这里部分代码省略.........
开发者ID:AndreRH,项目名称:wine,代码行数:101,


示例13: GetModuleHandle

void figures::rectangle::openWindowSet3D(){	HWND hwnd;	HWND h_text_a;	HINSTANCE hInstance = GetModuleHandle(0);	hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "rectangle", "",		(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX),		CW_USEDEFAULT, CW_USEDEFAULT, 500, 350, NULL, NULL, hInstance, NULL);	//EDIT	int xE = 120;	//x pos	int bE = 50;	//Breite	//STATIC	int xS = 20;	//x pos	int bS = 90;	//Breite	//H
C++ CreateWindowExW函数代码示例
C++ CreateWindowEx函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。