int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR /*lpCmdLine*/, int nCmdShow) { g_hInst = hInstance; RegisterWindowClass(szWindowClass, MAKEINTRESOURCE(IDC_NOTIFICATIONICON), WndProc); RegisterWindowClass(szFlyoutWindowClass, NULL, FlyoutWndProc); // Create the main window. This could be a hidden window if you don't need // any UI other than the notification icon. WCHAR szTitle[100]; LoadString(hInstance, IDS_APP_TITLE, szTitle, ARRAYSIZE(szTitle)); HWND hwnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 250, 200, NULL, NULL, g_hInst, NULL); if (hwnd) { ShowWindow(hwnd, nCmdShow); // Main message loop: MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return 0; }
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, PSTR szCmdLine, int iCmdShow) { (void)hInst; (void)hPrev; (void)szCmdLine; (void)iCmdShow; /* Setup a child process to delete this executable when it exits. */ SelfDelete(); /* Create a simple GUI. */ RegisterWindowClass(); MainWindow = CreateWindow(MainWindowClass, MainWindowClass, MainWindowStyle, 0,0,512,512, 0, 0, GetModuleHandle(0), 0); EditWindow = CreateWindow(EditWindowClass, "", EditWindowStyle, 0,0,512,512, MainWindow, 0, GetModuleHandle(0), 0); ShowWindow(MainWindow, SW_SHOW); UpdateWindow(MainWindow); /* Create a thread to read from standard input and write to the window. */ {DWORD threadId; CreateThread(0, 1024, ReadThreadProc, 0, 0, &threadId);} /* Run the event loop until the window is closed. */ MainEventLoop(); return 0; }
CMyImage::CMyImage() { RegisterWindowClass(); m_ImageList = NULL; iImage = -1; bClicked = FALSE; /* BOOL CTestImageDlg::InsertIcon() { HICON hIcon; hIcon=::LoadIcon(AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_ICON1)); if (hIcon!=NULL) { if (cl.Add(hIcon)==-1) return FALSE; } else return FALSE; hIcon=::LoadIcon(AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_ICON2)); if (hIcon!=NULL) { if (cl.Add(hIcon)==-1) return FALSE; } else return FALSE; hIcon=::LoadIcon(AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_ICON3)); if (hIcon!=NULL) { if (cl.Add(hIcon)==-1) return FALSE; } else return FALSE; return TRUE; } */ }
/*--------------------------------------------------------------------------*/ static DWORD WINAPI WndThread(LPVOID lpParam) { HANDLE hWndScilab = NULL; HINSTANCE hInstanceThisDll = (HINSTANCE)GetModuleHandle("scilab_windows"); RegisterWindowClass(); GetFreeTitleOfWindowHidden(); hWndScilab = CreateWindow(HiddenWindowClassName, titleHiddenScilabWindow, WS_OVERLAPPEDWINDOW, 0, 0, 350, 0, NULL, NULL, hInstanceThisDll, NULL); ShowWindow (hWndScilab, SW_HIDE); UpdateWindow (hWndScilab); if (hWndScilab) { MSG Msg; while (GetMessage(&Msg, NULL, 0, 0)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } } return 0; }
//The new thread DWORD WINAPI ThreadProc(LPVOID lpParam) { MSG messages; wchar_t *pString = reinterpret_cast<wchar_t * > (lpParam); HMENU hMenu = CreateDLLWindowMenu(); RegisterWindowClass(L"InjectedWindowClass"); HWND wind = GameValueProvider::get()->getGameMainWindow(); RECT rect; GetWindowRect(wind, &rect); if (GameValueProvider::get()->isFullScreen()) { rect.right = (int) GetSystemMetrics(SM_CXSCREEN); rect.bottom = (int)GetSystemMetrics(SM_CYSCREEN); } HWND hwnd = CreateWindowEx(0, L"InjectedWindowClass", NULL, WS_POPUP | WS_EX_LAYERED, 0, 0, rect.right, rect.bottom, NULL, hMenu, NULL, NULL); if (GameValueProvider::get()->isFullScreen()) { } IOHandler::get()->setAnimWindow(hwnd); ShowWindow(hwnd, SW_HIDE); while (GetMessage(&messages, NULL, 0, 0)) { TranslateMessage(&messages); DispatchMessage(&messages); } return 1; }
/** * Entry point for the application. Registers the window class, creates a window of that * class and starts a message loop for getting events fired to the window. * * http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680(v=vs.85).aspx */ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd; MSG Msg; if(!RegisterWindowClass(hInstance)) { // TODO Handle errors upon registration of the window class. return 0; } hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, windowClassName, windowTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, hInstance, NULL); if(hwnd == NULL) { // TODO Handle errors upon creation of the Window class. return 0; } while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; }
bool Ivy::System::Win32Window::Create() { HINSTANCE hInstance = GetModuleHandle(nullptr); if(RegisterWindowClass(hInstance)) { DWORD dwStyle = WS_OVERLAPPEDWINDOW; HWND hWnd = CreateWindowW(TEXT("IVY_APP"), Core::Utility::StringToWString(title).c_str(), dwStyle, x, y, width, height, nullptr, nullptr, hInstance, nullptr); if (!hWnd) return false; ShowWindow(hWnd, SW_SHOW); UpdateWindow(hWnd); this->hDC = GetDC(hWnd); this->hWnd = hWnd; this->x = x; this->y = y; this->width = width; this->height = height; this->title = title; // This will allow us to store the reference inside the Window Procedure. SetProp(hWnd, TEXT("WINDOW"), this); std::cout << "Window created..." << std::endl; return open = true; } return false; }
// // FUNCTION: CreateInstance(HINSTANCE, int) // // Saves the instance handle, creates and displays the main window. // BOOL AppWin::CreateInstance(HINSTANCE inHInstance, int inNCmdShow) { SetInstance(inHInstance); RegisterWindowClass(L"FrontEndMain"); s_hWnd = CreateWindow(s_windowClassName.c_str(), s_windowTitle.c_str(), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, s_hThisInst, NULL); if (!s_hWnd) { return FALSE; } ShowWindow(s_hWnd, inNCmdShow); UpdateWindow(s_hWnd); s_hAccelTable = LoadAccelerators(s_hThisInst, MAKEINTRESOURCE(IDC_APPMAIN)); RECT activeArea; GetClientRect(s_hWnd, &activeArea); s_width = abs(activeArea.right - activeArea.left); s_height = abs(activeArea.bottom - activeArea.top); return TRUE; }
HWND CAWnd::Create(HWND hwndParent, LPCTSTR pstrClassName, LPCTSTR pstrName, DWORD dwStyle, DWORD dwExStyle, HINSTANCE hInstance, int x, int y, int cx, int cy, HMENU hMenu) { if(!RegisterWindowClass(pstrClassName, hInstance) ) return NULL; m_hWnd = ::CreateWindowEx(dwExStyle, pstrClassName, pstrName, dwStyle, x, y, cx, cy, hwndParent, hMenu, hInstance, this); assert(m_hWnd!=NULL); return m_hWnd; }
static int OnModulesLoded(WPARAM, LPARAM) { HookEvent(ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged); HookEvent(ME_SKIN_ICONSCHANGED, OnSkinIconsChanged); HookEvent(ME_CLUI_CONTACTDRAGGING, OnContactDrag); HookEvent(ME_CLUI_CONTACTDROPPED, OnContactDrop); HookEvent(ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged); HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted); HookEvent(ME_OPT_INITIALISE, OnOptionsInitialize); HookEvent(ME_CLIST_STATUSMODECHANGE, OnStatusModeChange); HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu); hwndMiranda = pcli->hwndContactList; mir_subclassWindow(hwndMiranda, newMirandaWndProc); // No thumbs yet bEnableTip = ServiceExists("mToolTip/ShowTip"); RegisterWindowClass(); GetScreenRect(); LoadDBSettings(); CreateBackgroundBrush(); CreateThumbsFont(); LoadContacts(); LoadMenus(); if (fcOpt.bToTop) { fcOpt.ToTopTime = (fcOpt.ToTopTime < 1) ? 1 : fcOpt.ToTopTime; fcOpt.ToTopTime = (fcOpt.ToTopTime > TOTOPTIME_MAX) ? TOTOPTIME_MAX : fcOpt.ToTopTime; ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc); } return 0; }
bool SPWindow::Initialize(HINSTANCE hInstance, int setWidth, int setHeight, bool fullScreen) { hWnd = NULL; hInst = NULL; hCursor = LoadCursor(NULL, IDC_ARROW); width = setWidth; height = setHeight; hInst = hInstance; isFullScreen = fullScreen; isLastActive = true; isActive = true; LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_SPENGINE, szWindowClass, MAX_LOADSTRING); title = szTitle; // Register window class. RegisterWindowClass(hInstance); // Create window handle. hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX, CW_USEDEFAULT, 0, width, height, GetDesktopWindow(), NULL, hInstance, NULL); if (!hWnd) { return false; } return true; }
BOOL RegisterSpinControl (void) { WNDCLASS WndClass; #ifdef _PHONE_WINDOW_STYLE if ((bmp_spinbox_v = GetStockBitmap (STOCKBMP_SPINBOX_VERT, 0, 0)) == NULL) return FALSE; if ((bmp_spinbox_h = GetStockBitmap (STOCKBMP_SPINBOX_HORZ, 0, 0)) == NULL) return FALSE; #else if ((bmp_spinbox_v = GetStockBitmap (STOCKBMP_SPINBOX_VERT, -1, -1)) == NULL) return FALSE; if ((bmp_spinbox_h = GetStockBitmap (STOCKBMP_SPINBOX_HORZ, -1, -1)) == NULL) return FALSE; #endif WndClass.spClassName = CTRL_SPINBOX; WndClass.dwStyle = WS_NONE; WndClass.dwExStyle = WS_EX_NONE; WndClass.hCursor = GetSystemCursor (IDC_ARROW); WndClass.iBkColor = GetWindowElementColor (BKC_CONTROL_DEF); WndClass.WinProc = SpinCtrlProc; return RegisterWindowClass (&WndClass); }
BOOL NativeWindow::Create(HWND hwndParent, LPCTSTR pstrName, DWORD dwStyle, DWORD dwExStyle, int x /* = CW_USEDEFAULT */, int y /* = CW_USEDEFAULT */, int cx /* = CW_USEDEFAULT */, int cy /* = CW_USEDEFAULT */, HMENU hMenu /* = NULL */) { BOOL created = FALSE; if (GetSuperClassName() != NULL) { if (!RegisterSuperClass()) { return FALSE; } } else { if(!RegisterWindowClass()) { return FALSE; } } hwnd_ = ::CreateWindowEx(dwExStyle, GetWindowClassName(), pstrName, dwStyle, x, y, cx, cy, hwndParent, hMenu, NULL, this); if (hwnd_ != NULL) { created = AfterCreated(); } return created; }
CXTPCoreTreeControl::CXTPCoreTreeControl() { RegisterWindowClass(); m_pItems = new CXTPCoreTreeItems(); m_pItems->m_pControl = this; m_pPaintManager = new CXTPCoreTreePaintManager(); m_pPaintManager->RefreshMetrics(); m_nClientHeight = 0; m_rcControl.SetRectEmpty(); m_bPreSubclassWindow = TRUE; m_bScrollVisible = FALSE; m_bInUpdateScrollBar = FALSE; m_pImageManager = new CXTPImageManager(); m_nLockRedraw = 0; m_ptPressed = CPoint(-1, -1); m_pFocusedItem = NULL; m_pDraggingItem = NULL; m_pPressedItem = NULL; m_pDragOverItem = NULL; m_nDropPosition = xtpCoreTreeDropAfter; m_pDropTarget = new CTreeDropTarget(); m_pMarkupContext = NULL; }
CChartCtrl::CChartCtrl() { RegisterWindowClass(); m_BorderColor = RGB(0,0,0); BackColor = GetSysColor(COLOR_BTNFACE); EdgeType = EDGE_RAISED; CChartAxis* pBottom = new CChartAxis(this,true); CChartAxis* pLeft = new CChartAxis(this,false); CChartAxis* pTop = new CChartAxis(this,true); pTop->SetVisible(false); pTop->SetSecondary(true); CChartAxis* pRight = new CChartAxis(this,false); pRight->SetVisible(false); pRight->SetSecondary(true); m_pAxisList.push_back(pBottom); m_pAxisList.push_back(pLeft); m_pAxisList.push_back(pTop); m_pAxisList.push_back(pRight); m_pLegend = new CChartLegend(this); m_pTitles = new CChartTitle(this); m_bMemDCCreated = false; m_bPanEnabled = true; m_bRMouseDown = false; m_bZoomEnabled = true; m_bLMouseDown = false; }
CAdvComboBox::CAdvComboBox( BOOL bInst, CWnd * pParent ) : m_pDropWnd(0), m_bDropListVisible(0), m_bInst( bInst ), m_pParent(pParent) { XLISTCTRL_TRACE(_T("in CAdvComboBox::CAdvComboBox\n")); RegisterWindowClass(); m_pEdit = NULL; m_zDelta = 0; m_nCurSel = -1; m_bDropRectStored= false; m_bHasFocus = false; m_bHasSentFocus = false; m_bSelItem = false; m_bFirstPaint = true; m_nMinVisItems = 5; m_bCodeCreate = false; m_bAutoAppend = TRUE; m_bDropButtonHot = false; m_bTrackMouseLeave = false; m_nDefaultDropItems = -1; m_dwACBStyle = 0; m_dwACBStyle |= ACBS_STANDARD; m_pFont = NULL; }
int MainWindow::Start() { RegisterWindowClass(CS_HREDRAW | CS_VREDRAW, HBRUSH(COLOR_WINDOW), IDC_ARROW, MAKEINTRESOURCE(IDI_ICON), MAKEINTRESOURCE(IDI_ICON_SMALL), MAKEINTRESOURCE(IDR_MENU)); int res = Create(); if (res) { return res; } LPWSTR figures[4] = { L"Rhombus", L"Square", L"Circle", L"Star" }; LPWSTR colors[3] = { L"Red", L"Green", L"Blue" }; FigureRadioButtonGroup = new RadioButtonGroup(Instance, ThisWindow, 0, 0, 0, 0, IDC_FIGURERADIOBUTTONGROUP, L"Figures", NULL, (const wchar_t**)figures, 4); ColorRadioButtonGroup = new RadioButtonGroup(Instance, ThisWindow, 0, 0, 0, 0, IDC_COLORRADIOBUTTONGROUP, L"Colors", NULL, (const wchar_t**)colors, 3); DrawCheckBox = new Button(IDSC_BUTTON, Instance, ThisWindow, 0, 0, 0, 0, IDC_DRAWCHECKBOX, L"Draw", BS_CHECKBOX); bool result = true; result = result && !FigureRadioButtonGroup->Start(); result = result && !ColorRadioButtonGroup->Start(); result = result && !DrawCheckBox->Start(); if (!result) return 3; return 0; }
int RadioButtonGroup::Start() { RegisterWindowClass(CS_HREDRAW | CS_VREDRAW, HBRUSH(COLOR_WINDOW)); int res = Create(); if (res) { return res; } Header = new Static(IDSC_STATIC, Instance, ThisWindow, 0, 0, 0, 0, Id + 1, Title); for (int i = 0; i < RadioButtonsCount; i++) RadioButtons[i] = new Button(IDSC_BUTTON, Instance, ThisWindow, 0, 0, 200, 20, Id + 2 + i, RadioButtonsText[i], BS_RADIOBUTTON); bool result = true; result = result && !Header->Start(); for (int i = 0; i < RadioButtonsCount; i++) result = result && !RadioButtons[i]->Start(); if (!result) return 3; CheckedButton = 1; Button_SetCheck(RadioButtons[CheckedButton - 1]->ThisWindow, TRUE); return 0; }
//エントリーポイント int __stdcall wWinMain(HINSTANCE Instance,HINSTANCE,LPWSTR,int) { MSG Msg; std::vector<wchar_t> Buffer(MAX_PATH,0); DWORD Length; //自身のディレクトリを取得する Length=GetModuleFileName(nullptr,Buffer.data(),MAX_PATH); std::wstring ThisPath(Buffer.data()); ThisPath[ThisPath.find_last_of(L'\\')]=L'\0'; //カレントディレクトリをexeと同じ場所に設定 SetCurrentDirectory(ThisPath.c_str()); //Shiftキーが押されていたらアップロードした画像を開かない ShowBrowser=!(GetKeyState(VK_SHIFT)&0x8000); if(Gdiplus::GdiplusStartup(&Token,&StartupInput,nullptr)!=Gdiplus::Status::Ok) return 1; Brush.reset(CreateSolidBrush(RGB(100,100,100)),[](void* Obj){if(Obj) DeleteObject(Obj);}); std::atexit(ShutdownGdiplus); //引数にファイルが指定されていたら if(__argc==2){ //ファイルをアップロードして終了 if(IsPNG(__wargv[1])){ //PNG はそのままアップロード UploadFile(__wargv[1],ShowBrowser); }else{ //PNG 形式に変換 std::vector<wchar_t> TempDirectory(MAX_PATH,0),TempFile(MAX_PATH,0); GetTempPath(MAX_PATH,TempDirectory.data()); GetTempFileName(TempDirectory.data(),TempPrefix,0,TempFile.data()); if(ConvertPNG(TempFile.data(),__wargv[1])){ //アップロード UploadFile(TempFile.data(),ShowBrowser); }else{ //PNGに変換できなかった... MessageBox(nullptr,L"画像をPNG形式に変換する事が出来ません。",Title,MB_OK|MB_ICONERROR); } DeleteFile(TempFile.data()); } return true; } //ウィンドウクラスを登録 RegisterWindowClass(Instance); //アプリケーションの初期化 if(!InitInstance(Instance)) return 1; //メインメッセージループ while(GetMessage(&Msg,nullptr,0,0)){ TranslateMessage(&Msg); DispatchMessage(&Msg); } return (int)Msg.wParam; }
CGraphListCtrl::CGraphListCtrl( ) { m_nItemCount = 0; // 左键图标框的索引位置 m_bAllowDefault = false; // 是否允许设置默认项 m_bAllowSel = true; // 是否允许选择 m_bShowCaption = false; // 是否显示标题 m_bSortByFixedRow = false; // 是否固定行,按列自由增减处理 m_nCurSel = -1; // 当前选择项 m_nCurDefault = -1; // 默认选项,绘制红旗标注,若没有设置为-1 m_nBarState = SB_VERT; // 控件的显示控制数据 m_nFixedRowNum = 2; // 固定行数 m_nFixedColNum = 2; // 固定列数 m_sizeItem = CSize(120, 120); // 每项尺寸 m_nCaptionHeight = 12; m_nMargin = 6; CDC* pDc = acedGetAcadFrame()->GetDC(); m_colBk = pDc->GetBkColor(); // 背景色 m_colText = pDc->GetTextColor(); // 文字颜色 m_colTextBk = GetSysColor(COLOR_MENU); // 文字背景色 m_font; // 用于控制tip的变量 m_nMouseItem = -1; m_nOldMouseItem = -1; // 用于控制滚动条的变量 m_nVScrollMax = -1; m_nHScrollMax = -1; // 成员 // 数据库 m_pCurDb = NULL; // 控制Item的显示 m_nRenderMode = AcGsView::k2DOptimized; m_viewVector = AcGeVector3d::kZAxis; m_bSetUserView = false; // m_pOwnerBtn = NULL;; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// BOOL bSuc = RegisterWindowClass(); NONCLIENTMETRICS ncm; ::ZeroMemory(&ncm, sizeof(NONCLIENTMETRICS)); ncm.cbSize = sizeof(NONCLIENTMETRICS); VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)); m_font.CreateFontIndirect(&ncm.lfMenuFont); m_pOrbitModel = acgsGetGsManager()->createAutoCADModel(); ResetDefaultIcon(); }
wxTaskBarIconEx::wxTaskBarIconEx( wxChar* szWindowTitle ) { m_hWnd = 0; m_iconAdded = FALSE; if (RegisterWindowClass()) m_hWnd = CreateTaskBarWindow( szWindowTitle ); }
CTimeViewer::CTimeViewer() : m_sTime(0) , m_mTime(0) , m_hTime(0) { //SetBitmap(IDB_BITMAP1); RegisterWindowClass(); }
wxTaskBarIconEx::wxTaskBarIconEx(void) { m_hWnd = 0; m_iconAdded = FALSE; if (RegisterWindowClass()) m_hWnd = CreateTaskBarWindow( wxTaskBarExWindow ); }
CXTPSyntaxEditTipWnd::CXTPSyntaxEditTipWnd() : m_pListBox(NULL) , m_iIndex(LB_ERR) , m_uIDEvent1(1001) , m_uIDEvent2(1002) { RegisterWindowClass(); }
HWND CWindowWnd::Create(HWND hwndParent, LPCTSTR pstrName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int cx, int cy, HMENU hMenu) { if( GetSuperClassName() != NULL && !RegisterSuperclass() ) return NULL; if( GetSuperClassName() == NULL && !RegisterWindowClass() ) return NULL; m_hWnd = ::CreateWindowEx(dwExStyle, GetWindowClassName(), pstrName, dwStyle, x, y, cx, cy, hwndParent, hMenu, CPaintManagerUI::GetInstance(), this); ASSERT(m_hWnd!=NULL); return m_hWnd; }
CCellListCtrl::CCellListCtrl() : m_hFont(NULL) , m_textColor(::GetSysColor(COLOR_WINDOWTEXT)) , m_backColor(::GetSysColor(COLOR_WINDOW)) { if (!RegisterWindowClass()) { AfxThrowResourceException(); } }
// 创建wke控件 bool CDuiWkeView::CreateControl() { if(m_bCreating) { return false; } m_bCreated = false; m_bCreating = true; // 设置wke事件回调函数 m_wkeHander.onTitleChanged = onTitleChanged; m_wkeHander.onURLChanged = onURLChanged; // 创建wke视图,并加载url或html内容 m_pWebView = wkeCreateWebView(); m_pWebView->setTransparent(m_bTransparent); m_pWebView->setClientHandler(&m_wkeHander); m_pWebView->setBufHandler(this); if(!m_strUrl.IsEmpty()) { Navigate(m_strUrl); }else if(!m_strHtml.IsEmpty()) { loadHTML(m_strHtml); } // 注册窗口类 RegisterWindowClass(); // 创建用于显示wke视图的窗口 HWND hWnd = ::CreateWindow(wkeWebViewClassName, 0, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 0, 0, m_hWnd, 0, DuiSystem::Instance()->GetInstance(), this); // 设置窗口句柄 if(hWnd && ::IsWindow(hWnd)) { ReleaseControl(); m_hwndHost = hWnd; } // 初始化wke渲染对象,将渲染对象关联到视图窗口 m_render.init(m_hwndHost); m_bCreated = true; m_bCreating = false; return true; }
// Creates the splash owner window and the splash window. static HWND CreateSplashWindow(HINSTANCE hinst) { RegisterWindowClass(hinst); gSplashWndOwner = CreateWindow(c_szSplashClass, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, hinst, NULL); return CreateWindowEx(WS_EX_LAYERED, c_szSplashClass, NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, gSplashWndOwner, NULL, hinst, NULL); }
void clViewport::AfterConstruction() { #ifdef OS_WINDOWS DWORD dwVersion = 0; DWORD dwMajorVersion = 0; dwVersion = GetVersion(); // Get the Windows version. dwMajorVersion = ( DWORD )( LOBYTE( LOWORD( dwVersion ) ) ); if ( dwMajorVersion > 5 ) { /// Anything below WinXP without SP3 does not support High DPI, so we do not enable it on WinXP at all. SetHighDPIAware(); } StoreAndDisableStickyKeys(); if ( FTakeoverContext ) { ResizeViewport( 0, 0 ); } else #endif { #ifdef OS_WINDOWS if ( FRegisterWindowClass ) { RegisterWindowClass(); } if ( FExternalWindowHandle ) { RECT Rect; GetWindowRect( FExternalWindowHandle, &Rect ); FWidth = Rect.right - Rect.left; FHeight = Rect.bottom - Rect.top; } #endif RecreateViewport(); } ReinitializeViewport(); FMouseX = Env->Console->GetVar( "Viewport.MouseX" ); FMouseY = Env->Console->GetVar( "Viewport.MouseY" ); Env->Connect( L_EVENT_SURFACE_CHANGED, BIND( &clViewport::Event_SURFACE_CHANGED ) ); }
void ZDForm::InitializeForm(UINT appIcon, UINT appIconSmall,const wchar_t* wcTitle, const wchar_t* wcHtmlRes,int ix, int iy, int iWidth, int iHeight) { m_zdClassName = L"ZDForm"; RegisterWindowClass(appIcon,appIconSmall); m_zdHtmlRes = wcHtmlRes; m_hwnd = CreateWindow(m_zdClassName, wcTitle, WS_OVERLAPPEDWINDOW, ix, iy, iWidth, iHeight, NULL, NULL, GetZDApplication()->GetInstance(), NULL); if(!m_hwnd) throw ZDException(L"fail to createwindow"); }