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

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

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

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

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

示例1: OnCancel

void CDialogTrustDB::OnCancel()    {    ::EndDialog(GetWindow(), IDCANCEL);     }
开发者ID:mingpen,项目名称:OpenNT,代码行数:4,


示例2: GetWindow

CEGUI::Window*CFileSystemDialogImp::GetWindowImp( void ){GUCE_TRACE;    return static_cast< CEGUI::Window* >( GetWindow()->GetImplementationPtr() );}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:6,


示例3: SetIcon

BOOL CRunTestsSheet::OnInitDialog() {  if(!m_bHideTarget){    m_prop.Add(_T("Platform"),m_strTarget);  }  m_prop.Add(_T("Active timeout"),m_nTimeout);  m_prop.Add(_T("Download timeout"),m_nDownloadTimeout);  m_prop.Add(_T("Active timeout type"),m_nTimeoutType);  m_prop.Add(_T("Download timeout type"),m_nDownloadTimeoutType);  m_prop.Add(_T("Remote"),m_bRemote);  m_prop.Add(_T("Serial"),m_bSerial);  m_prop.Add(_T("Port"),m_strPort);  m_prop.Add(_T("Baud"),m_nBaud);  m_prop.Add(_T("Local TCPIP Host"),m_strLocalTCPIPHost);  m_prop.Add(_T("Local TCPIP Port"),m_nLocalTCPIPPort);  m_prop.Add(_T("Reset Type"),m_nReset);  m_prop.Add(_T("Reset String"),m_strReset);  m_prop.Add(_T("Resource Host"),m_strResourceHost);  m_prop.Add(_T("Resource Port"),m_nResourcePort);  m_prop.Add(_T("Remote Host"),m_strRemoteHost);  m_prop.Add(_T("Remote Port"),m_nRemotePort);  m_prop.Add(_T("Recurse"),executionpage.m_bRecurse);  //m_prop.Add(_T("Loadfromdir"),executionpage.m_strLoaddir);  m_prop.Add(_T("Farmed"),m_bFarmed);  m_prop.Add(_T("Extension"),executionpage.m_strExtension);    CeCosTrace::SetOutput(TestOutputCallback,this);  CeCosTrace::SetError (TestOutputCallback,this);    // m_psh can only be used to set the small icon.  Set the large one here.  m_psh.hIcon=AfxGetApp()->LoadIcon(IDR_TT_MAINFRAME);  //sheet.m_psh.dwFlags|=PSH_USEHICON/*|PSH_HASHELP*/;  if(m_psh.hIcon){    SetIcon(m_psh.hIcon,FALSE);    SetIcon(m_psh.hIcon,TRUE);  }  GetWindowRect(m_rcPrev);#ifdef _DEBUG  CeCosTrace::EnableTracing(CeCosTrace::TRACE_LEVEL_TRACE);#endif  CeCosTrace::SetInteractive(true);    if(m_pInitFunc){    m_pInitFunc(&m_prop,false);  }    GetDlgItem(IDCANCEL)->SetWindowText(_T("&Close"));    m_nTestsToComplete=0;  BOOL bResult = CeCosPropertySheet::OnInitDialog();  SetDlgItemText(IDOK,_T("&Run"));  SetDlgItemText(ID_APPLY_NOW,_T("&Properties"));  GetDlgItem(ID_APPLY_NOW)->EnableWindow(TRUE);  GetDlgItem(IDCANCEL)->EnableWindow(TRUE); // required for modeless case    SetActivePage(&outputpage);  SetActivePage(&summarypage);  SetActivePage(&executionpage); 	  if(m_pInitFunc){    m_pInitFunc(&m_prop,false);    outputpage.UpdateData(FALSE);    summarypage.UpdateData(FALSE);    executionpage.UpdateData(FALSE);  }  /*  CString strCaption = _T("Output");  TC_ITEM tcItem;  tcItem.mask = TCIF_TEXT;  tcItem.pszText = (LPTSTR)((LPCTSTR)strCaption);  GetTabControl()->SetItem(2, &tcItem );  strCaption=_T("Summary");  GetTabControl()->SetItem(3, &tcItem );  */  // Allow resizing    // WS_OVERLAPPEDWINDOW would preclude caption bar help button  ModifyStyle(0,WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME ,0);    CRect rect;  GetWindowRect(rect);  m_rcPrev=rect;    m_cxMin=rect.Width();  m_cyMin=rect.Height();    m_bAllowResizing=true;    WINDOWPLACEMENT wndpl;  if (5==_stscanf(m_strPlacement,_T("%d %d %d %d %d"),&rect.left,&rect.top,&rect.right,&rect.bottom,&wndpl.showCmd)){    CRect rcMax;    SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)(RECT *)rcMax, 0);        if(rect.Width()<100 || rect.Height()<100 || rect.Width()>rcMax.Width() || rect.Height()>rcMax.Height()){      rect=CFrameWnd::rectDefault;    }        wndpl.length = sizeof(WINDOWPLACEMENT);    wndpl.flags = 0;    //.........这里部分代码省略.........
开发者ID:Robertysc,项目名称:ecos,代码行数:101,


示例4: InternalCreateDialog

//.........这里部分代码省略.........        nYBorder = GetSystemMetrics(SM_CYBORDER);    }    if (dwStyle & WS_THICKFRAME) {        nXBorder = GetSystemMetrics(SM_CXFRAME);        nYBorder = GetSystemMetrics(SM_CYFRAME);    }    X -= nXBorder;    Y -= nYBorder;    nWidth += 2*nXBorder;    nHeight += 2*nYBorder;    if ((dwStyle & WS_CAPTION) == WS_CAPTION) {        cyCaption = GetSystemMetrics(SM_CYCAPTION);        Y -= cyCaption;        nHeight += cyCaption;    }    if (dwStyle & WS_VISIBLE) {        bVisible = TRUE;        dwStyle &= ~WS_VISIBLE;    }    else        bVisible = FALSE;    hDlg = CreateWindow(               (!HIWORD(dp->szClassName) || !strlen(dp->szClassName))?               TWIN_DIALOGCLASS:dp->szClassName,               (HIWORD(dp->szCaption) && strlen(dp->szCaption))?               dp->szCaption:" ",               dwStyle,               X,Y,nWidth,nHeight,               hWnd,               (HMENU)0,               (hInst)?hInst:               (hWnd?GetWindowInstance(hWnd):0),               NULL           );    if(hDlg == 0) {        return 0;    }    /*     * The following code was removed because it needlessly leaves     * an hour glass on all of the applications windows while the dialog     * box is up.  Another call to SetCursor() was also commented out     * at the end of this function.     */#if 0    hCursHourGlass = LoadCursor((HINSTANCE)0, IDC_WAIT);    hCursOld       = SetCursor(hCursHourGlass);#endif    SetWF(hDlg,WFDIALOGWINDOW);    SetWindowWord(hDlg,DWW_STATUS,0);    SetWindowWord(hDlg,DWW_PARENT,hWnd);    SetWindowLong(hDlg,DWL_DLGPROC,(LONG)lpFunc);    SetWindowLong(hDlg,DWL_LPARAM,lParam);    SetWindowWord(hDlg,DWW_DEFID,(WORD)0L);    if (hFont)        SendMessage(hDlg, WM_SETFONT, (WPARAM)hFont,                    (LPARAM)MAKELONG(FALSE,0));    for(i=0,cp=dp->controlinfo; i<(int)(dp->bNumberOfItems); i++,cp++) {        hCtl = CreateWindow(                   cp->szClass?cp->szClass:"STATIC",
开发者ID:ErisBlastar,项目名称:osfree,代码行数:67,


示例5: OnButtonTeleport

    bool OnButtonTeleport()    {        ImodelIGC* pDestination = (ImodelIGC*)(m_plistPaneDestinations->GetSelection());        IstationIGC* pstation = NULL;        if (pDestination == NULL || trekClient.MyMission() == NULL             || trekClient.GetShip()->GetCluster() != NULL)            return true;        if (pDestination->GetObjectType() == OT_ship)        {            // if this is a ship, try boarding it.            IshipIGC* pship;            CastTo(pship, pDestination);            if (trekClient.GetShip()->GetParentShip() != NULL)            {                trekClient.DisembarkAndBoard(pship);            }            else            {                trekClient.BoardShip(pship);            }            trekClient.PlaySoundEffect(personalJumpSound);        }        else        {            // try teleporting to that station            IstationIGC* pstation;            CastTo(pstation, pDestination);            if (trekClient.GetShip()->GetParentShip() != NULL)            {                // if they are already there, just get off of the ship                if (pstation == trekClient.GetShip()->GetParentShip()->GetStation())                {                    trekClient.BoardShip(NULL);                }                else                {                    trekClient.DisembarkAndTeleport(pstation);                }            }            else            {                if (pstation != trekClient.GetShip()->GetStation())                {                    trekClient.SetMessageType(BaseClient::c_mtGuaranteed);                    BEGIN_PFM_CREATE(trekClient.m_fm, pfmDocked, C, DOCKED)                    END_PFM_CREATE                    pfmDocked->stationID = pstation->GetObjectID();                    trekClient.StartLockDown(                        "Teleporting to " + ZString(pstation->GetName()) + "....",                         BaseClient::lockdownTeleporting);                }            }        }        // dismiss the teleport pane.        GetWindow()->TurnOffOverlayFlags(ofTeleportPane);        return true;    }
开发者ID:borgified,项目名称:Allegiance,代码行数:66,


示例6: FreeWindow

static voidFreeWindow(HWND hWnd){    HWND hWndFree,hWndFreeNext;    HWND32 hWnd32;    DWORD dwClassStyle;    if (!(hWnd32 = GETHWND32(hWnd)))	return;    hWndFree = hWnd32->hWndChild;    while (hWndFree) {	hWndFreeNext = GetWindow(hWndFree,GW_HWNDNEXTSIB);	FreeWindow(hWndFree);	hWndFree = hWndFreeNext;    }    if (hWnd == GetActiveWindow()) {	if (hWnd32->hWndOwner)	    SetActiveWindow(hWnd32->hWndOwner);	else	    SetActiveWindow(TWIN_FindAnotherOverlapped(hWnd));    }    if (hWnd == GetFocus())	SetFocus(0);    if (hWnd == GetCapture())	ReleaseCapture();    if (!(hWnd32->dwStyle & WS_CHILD))	if (hWnd32->hMenu) {	    if (IsMenu(hWnd32->hMenu))		DestroyMenu(hWnd32->hMenu);	}    if (hWnd32->hSysMenu) {	if (IsMenu(hWnd32->hSysMenu))	    DestroyMenu(hWnd32->hSysMenu);    }    /* NOTE: this used to be after releasing OWN/CLASS DC, but */    /* at least one app does a GetDC(hWnd) during the NCDESTROY*/    /* so, don't release it until after. The GetDC code needs  */    /* the DC to maintain the hardware DC, (read gc for X11)   */    /* send the last message to this window */    SendMessage(hWnd,WM_NCDESTROY,0,0);    /* get rid of DCs that may still be gotten */    dwClassStyle = GetClassStyle(hWnd);    if ((dwClassStyle & CS_OWNDC) && hWnd32->hDC)	TWIN_GdiDestroyDC(hWnd32->hDC);    if (!(hWnd32->dwStyle & WS_CHILD))	/* physically destroy the window */	DRVCALL_WINDOWS(PWSH_DESTROYWINDOW,0L,0L,			WIN_GETDRVDATA(Get32WindowFrame(hWnd32)));    if (hWnd32->UpdateRegion)	DRVCALL_REGIONS(PRH_DESTROYREGION,hWnd32->UpdateRegion,0,0);    LockClass(hWnd32->hWindowClass32,FALSE);    SendMessage(Get32WindowFrame(hWnd32),WM_NCDESTROY,0,0L);    FREEHWND(Get32WindowFrame(hWnd32));    if (hWnd32->hWndHZScroll) {	SendMessage(hWnd32->hWndHZScroll,WM_DESTROY,0,0L);	FREEHWND(hWnd32->hWndHZScroll);    }    if (hWnd32->hWndVTScroll) {	SendMessage(hWnd32->hWndVTScroll,WM_DESTROY,0,0L);	FREEHWND(hWnd32->hWndVTScroll);    }    RELEASEWININFO(hWnd32);    TWIN_FlushWindowMessages(hWnd);    FREEHWND(hWnd);}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:78,


示例7: switch

/** /brief Message Handling Callback. * This handles all callbacks to the remote view window. */void RemoteIconView::HandleMessage( Message* pcMessage ){	switch( pcMessage->GetCode() )	{		case M_REMOTE_DIRLISTING:		{			if( !m_bUpdatePending ) {				DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING while no dirlisting is pending!/n" );				return;			}						String zPath;			if( pcMessage->FindString( "path", &zPath ) != 0 ) {				DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING without path!/n" );				return;			}			if( zPath != m_zPath ) {				DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING with wrong path %s! Expecting %s./n", zPath.c_str(), m_zPath.c_str() );				return;			}						std::vector< RemoteNode >* pacNodes;			/* The Server creates an array of RemoteNodes and passes us the pointer. We should delete it when done. */			if( pcMessage->FindPointer( "list", (void**)&pacNodes ) ) {				DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING without pointer to data!/n" );				return;			}						bool bInitial;			if( pcMessage->FindBool( "initial", &bInitial ) != 0 ) bInitial = false;						bool bFinal;			if( pcMessage->FindBool( "final", &bFinal ) != 0 ) bFinal = false;						SetContents( pacNodes, bInitial, bFinal );			if( pacNodes ) delete( pacNodes );					break;		}		/* Messages from the context menu */		case M_REMOTE_RENAME:		{			/* Check that only one icon is selected & get the selected icon */			uint nSelectedIcon = -1;			uint nNumSelected = 0;			for( uint i = 0; i < GetIconCount(); i++ ) {				if( GetIconSelected( i ) ) {					nSelectedIcon = i;					nNumSelected++;				}			}			if( nNumSelected != 1 ) {				DEBUG( "RemoteView: Got M_REMOTE_RENAME while %i icons are selected!/n", nNumSelected );				break;			}			RemoteIconData* pcData = (RemoteIconData*)GetIconData( nSelectedIcon );			/* Display rename dialog */			Window* pcDialog = new RenameRequester( pcData->m_cNode.m_zPath, this );			pcDialog->CenterInWindow( GetWindow() );			pcDialog->Show();			pcDialog->MakeFocus( true );			break;		}		case M_REMOTE_DELETE:		{			/* Save a list of the selected files */			std::vector< RemoteNode >* pacDeleteList = new std::vector< RemoteNode >;			for( uint i = 0; i < GetIconCount(); i++ ) {				if( GetIconSelected( i ) ) {					pacDeleteList->push_back( ((RemoteIconData*)GetIconData( i ))->m_cNode );				}			}			if( pacDeleteList->size() == 0 ) {				DEBUG( "RemoteView: Got M_REMOTE_DELETE while no icons are selected!/n" );				delete( pacDeleteList );				break;			}			/* Display confirmation dialog */			Window* pcDialog = new DeleteConfirmDialog( pacDeleteList, this );			pcDialog->CenterInWindow( GetWindow() );			pcDialog->Show();			pcDialog->MakeFocus( true );			break;					}		case M_REMOTE_MKDIR:		{			Window* pcDialog = new MkDirRequester( m_zPath, this );			pcDialog->CenterInWindow( GetWindow() );			pcDialog->Show();			pcDialog->MakeFocus( true );			break;		}		case M_DELETE_CONFIRMED:		{			std::vector< RemoteNode >* pacDeleteList = NULL;//.........这里部分代码省略.........
开发者ID:PyroOS,项目名称:Pyro,代码行数:101,


示例8: SSLGiveSRPClientPassword

static char* SSLGiveSRPClientPassword(SSL *s, void *arg){    LOG(INFO) << "SSLGiveSRPClientPassword " << GetWindow("ServerBrowser/Password")->getText();    return BUF_strdup(GetWindow("ServerBrowser/Password")->getText().c_str());}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:5,


示例9: NS_ENSURE_ARG_POINTER

nsresultsbWindowWatcher::CallWithWindow_Proxy(const nsAString&           aWindowType,                                  sbICallWithWindowCallback* aCallback,                                  bool                     aWait){  // Validate arguments.  NS_ENSURE_ARG_POINTER(aCallback);  // Function variables.  nsresult rv;  // If not on main thread, call back through a proxy.  if (!SB_IsMainThread(mThreadManager)) {    nsRefPtr<sbRunnable_<nsresult>> job =      new sbRunnableMethod3_<nsresult,sbWindowWatcher,      const nsAString&,sbICallWithWindowCallback*,bool>(          *this,&sbWindowWatcher::CallWithWindow_Proxy,          aWindowType,aCallback,aWait);    // Call back through the proxy.  Wait for window if specified to do so.    rv = NS_OK;    while (1) {      // Call the proxied window watcher.  Exit loop on success or if not      // waiting.      NS_DispatchToMainThread(job);      rv = job->Wait();      if (NS_SUCCEEDED(rv) || !aWait)        break;      if (rv != NS_ERROR_NOT_AVAILABLE)        NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);      // Wait for a window if none available.      rv = WaitForWindow(aWindowType);      NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);    }    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);    return NS_OK;  }  // Operate within the monitor.  mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);  // Check if window is already available.  nsCOMPtr<nsIDOMWindow> window;  rv = GetWindow(aWindowType, getter_AddRefs(window));  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);  // If a window is available or this instance is shutting down, call the  // callback.  Otherwise, place the call with window information on the call  // with window list.  if (window || mIsShuttingDown) {    aCallback->HandleWindowCallback(window);  } else {    // If specified to wait and the window is not available, return a not    // available error indication instead of enqueuing onto the call with window    // list.    if (aWait)      return NS_ERROR_NOT_AVAILABLE;    // Place the call with window information on the call with window list.    CallWithWindowInfo callWithWindowInfo;    callWithWindowInfo.windowType = aWindowType;    callWithWindowInfo.callback = aCallback;    mCallWithWindowList.AppendElement(callWithWindowInfo);  }  return NS_OK;}
开发者ID:Brijen,项目名称:nightingale-hacking,代码行数:68,


示例10: RefreshWindowList

void RefreshWindowList(HWND hwndCombobox, ConfigDialogData &configData){    SendMessage(hwndCombobox, CB_RESETCONTENT, 0, 0);    configData.ClearData();    HWND hwndCurrent = GetWindow(GetDesktopWindow(), GW_CHILD);    do    {        if(IsWindowVisible(hwndCurrent))        {            RECT clientRect;            GetClientRect(hwndCurrent, &clientRect);            HWND hwndParent = GetParent(hwndCurrent);            DWORD exStyles = (DWORD)GetWindowLongPtr(hwndCurrent, GWL_EXSTYLE);            DWORD styles = (DWORD)GetWindowLongPtr(hwndCurrent, GWL_STYLE);            if( (exStyles & WS_EX_TOOLWINDOW) == 0 && (styles & WS_CHILD) == 0 /*&& hwndParent == NULL*/)            {                String strWindowName;                strWindowName.SetLength(GetWindowTextLength(hwndCurrent));                GetWindowText(hwndCurrent, strWindowName, strWindowName.Length()+1);                bool b64bit = false;                //-------                DWORD processID;                GetWindowThreadProcessId(hwndCurrent, &processID);                if(processID == GetCurrentProcessId())                    continue;                TCHAR fileName[MAX_PATH+1];                scpy(fileName, TEXT("unknown"));                HANDLE hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ | PROCESS_VM_WRITE, FALSE, processID);                if(hProcess)                {                    DWORD dwSize = MAX_PATH;                    QueryFullProcessImageName(hProcess, 0, fileName, &dwSize);                }                else                {                    hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, processID);                    if(hProcess)                    {                        CloseHandle(hProcess);                    }                    continue;                }                //-------                String strFileName = fileName;                strFileName.FindReplace(TEXT("//"), TEXT("/"));                String strText;                strText << TEXT("[") << GetPathFileName(strFileName);                strText << (b64bit ? TEXT("*64") : TEXT("*32"));                strText << TEXT("]: ") << strWindowName;                int id = (int)SendMessage(hwndCombobox, CB_ADDSTRING, 0, (LPARAM)strText.Array());                SendMessage(hwndCombobox, CB_SETITEMDATA, id, (LPARAM)hwndCurrent);                String strClassName;                strClassName.SetLength(256);                GetClassName(hwndCurrent, strClassName.Array(), 255);                strClassName.SetLength(slen(strClassName));                WindowInfo &info    = *configData.windowData.CreateNew();                info.strClass       = strClassName;                info.strProcess     = fileName;            }        }    } while (hwndCurrent = GetNextWindow(hwndCurrent, GW_HWNDNEXT));}
开发者ID:devinkb,项目名称:DWMCapture,代码行数:78,


示例11: DlgProcUrlSend

INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){	struct UrlSendData* dat = (struct UrlSendData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);	switch (msg) {	case WM_INITDIALOG:		TranslateDialogDefault(hwndDlg);		Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_URL);		Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));		Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));		Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View user's history"));		Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User menu"));		SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, 450, 0);		dat = (struct UrlSendData*)mir_alloc(sizeof(struct UrlSendData));		SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);		dat->hContact = lParam;		dat->hAckEvent = NULL;		dat->hSendId = NULL;		dat->sendBuffer = NULL;		WindowList_Add(hUrlWindowList, hwndDlg, dat->hContact);		{			TCHAR *str = pcli->pfnGetContactDisplayName(dat->hContact, 0);			SetDlgItemText(hwndDlg, IDC_NAME, str);		}		GetOpenBrowserUrls(hwndDlg, GetDlgItem(hwndDlg, IDC_URLS));		SendDlgItemMessage(hwndDlg, IDC_URLS, CB_SETCURSEL, 0, 0);		if (SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCOUNT, 0, 0))SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_URLS, CBN_SELCHANGE), 0);		EnableWindow(GetDlgItem(hwndDlg, IDOK), (SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCURSEL, 0, 0) == CB_ERR)?FALSE:TRUE);		Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, "SRUrl", "send");		mir_subclassWindow( GetDlgItem(hwndDlg, IDC_MESSAGE), SendEditSubclassProc);		mir_subclassWindow( GetWindow(GetDlgItem(hwndDlg, IDC_URLS), GW_CHILD), SendEditSubclassProc);		// From message dlg		if ( !db_get_b(dat->hContact, "CList", "NotOnList", 0))			ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);		SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0);		// From message dlg end		return TRUE;	case WM_DDE_DATA:	case WM_DDE_ACK:		return DdeMessage(hwndDlg, msg, wParam, lParam);	case WM_TIMER:		if (wParam == 0) {			//ICQ sendurl timed out			KillTimer(hwndDlg, 0);			MessageBox(hwndDlg, TranslateT("Send timed out"), _T(""), MB_OK);			EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);			EnableWindow(GetDlgItem(hwndDlg, IDC_URLS), TRUE);			SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETREADONLY, FALSE, 0);		}		break;	case WM_MEASUREITEM:		return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);	case WM_DRAWITEM:		{			LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;			if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {				char *szProto = GetContactProto(dat->hContact);				if (szProto) {					HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);					if (hIcon) {						DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);						DestroyIcon(hIcon);		}	}	}	}		return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);	case DM_UPDATETITLE:		sttUpdateTitle(hwndDlg, dat->hContact);		break;	case WM_COMMAND:		if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))			break;		switch (LOWORD(wParam)) {		case IDOK:			{				char *body, *url;				int bodySize, urlSize;				urlSize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URLS))+1;				url = (char*)mir_alloc(urlSize);				GetDlgItemTextA(hwndDlg, IDC_URLS, url, urlSize);				if (url[0] == 0) {					mir_free(url);					break;				}				bodySize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE))+1;				body = (char*)mir_alloc(bodySize);				GetDlgItemTextA(hwndDlg, IDC_MESSAGE, body, bodySize);				dat->sendBuffer = (char*)mir_realloc(dat->sendBuffer, lstrlenA(url)+lstrlenA(body)+2);				lstrcpyA(dat->sendBuffer, url);//.........这里部分代码省略.........
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:101,


示例12: defined

bool CMPCVideoDecSettingsWnd::OnActivate(){	DWORD	dwStyle = WS_VISIBLE|WS_CHILD|WS_BORDER;	int		nPosY	= 10;	GUID*	DxvaGui = NULL;#if defined(REGISTER_FILTER) | INCLUDE_MPC_VIDEO_DECODER	m_grpFFMpeg.Create (ResStr (IDS_VDF_FFSETTINGS), WS_VISIBLE|WS_CHILD | BS_GROUPBOX, CRect (10,  nPosY, 330, nPosY+150), this, IDC_STATIC);	#if defined(REGISTER_FILTER) | INTERNAL_DECODER_H264	// Decoding threads	nPosY += VERTICAL_SPACING;	m_txtThreadNumber.Create (ResStr (IDS_VDF_THREADNUMBER), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING,  nPosY, 190, nPosY+15), this, IDC_STATIC);	m_cbThreadNumber.Create  (WS_VISIBLE|WS_CHILD|CBS_DROPDOWNLIST|WS_VSCROLL, CRect (200,  nPosY-4, 260, nPosY+90), this, IDC_PP_THREAD_NUMBER);	m_cbThreadNumber.AddString (_T("1"));	m_cbThreadNumber.AddString (_T("2"));	m_cbThreadNumber.AddString (_T("3"));	m_cbThreadNumber.AddString (_T("4"));	m_cbThreadNumber.AddString (_T("5"));	m_cbThreadNumber.AddString (_T("6"));	m_cbThreadNumber.AddString (_T("7"));	m_cbThreadNumber.AddString (_T("8"));	// H264 deblocking mode	nPosY += VERTICAL_SPACING;	m_txtDiscardMode.Create (ResStr (IDS_VDF_SKIPDEBLOCK), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING,  nPosY, 190, nPosY+15), this, IDC_STATIC);	m_cbDiscardMode.Create  (WS_VISIBLE|WS_CHILD|CBS_DROPDOWNLIST|WS_VSCROLL, CRect (200,  nPosY-4, 315, nPosY+90), this, IDC_PP_DISCARD_MODE);	m_cbDiscardMode.AddString (ResStr (IDS_VDF_DBLK_NONE));	m_cbDiscardMode.AddString (ResStr (IDS_VDF_DBLK_DEFAULT));	m_cbDiscardMode.AddString (ResStr (IDS_VDF_DBLK_NONREF));	m_cbDiscardMode.AddString (ResStr (IDS_VDF_DBLK_BIDIR));	m_cbDiscardMode.AddString (ResStr (IDS_VDF_DBLK_NONKFRM));	m_cbDiscardMode.AddString (ResStr (IDS_VDF_DBLK_ALL));	#endif		// Error recognition	nPosY += VERTICAL_SPACING;	m_txtErrorRecognition.Create (ResStr (IDS_VDF_ERROR_RECOGNITION), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING,  nPosY, 190, nPosY+15), this, IDC_STATIC);	m_cbErrorRecognition.Create  (WS_VISIBLE|WS_CHILD|CBS_DROPDOWNLIST|WS_VSCROLL, CRect (200,  nPosY-4, 315, nPosY+90), this, IDC_PP_DISCARD_MODE);	m_cbErrorRecognition.AddString (ResStr (IDS_VDF_ERR_CAREFUL));	m_cbErrorRecognition.AddString (ResStr (IDS_VDF_ERR_COMPLIANT));	m_cbErrorRecognition.AddString (ResStr (IDS_VDF_ERR_AGGRESSIVE));	m_cbErrorRecognition.AddString (ResStr (IDS_VDF_ERR_VERYAGGRESSIVE));	// IDCT Algo	nPosY += VERTICAL_SPACING;	m_txtIDCTAlgo.Create (ResStr (IDS_VDF_IDCT_ALGO), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING,  nPosY, 190, nPosY+15), this, IDC_STATIC);	m_cbIDCTAlgo.Create  (WS_VISIBLE|WS_CHILD|CBS_DROPDOWNLIST|WS_VSCROLL, CRect (200,  nPosY-4, 315, nPosY+90), this, IDC_PP_DISCARD_MODE);	m_cbIDCTAlgo.AddString (ResStr (IDS_VDF_IDCT_AUTO));	m_cbIDCTAlgo.AddString (ResStr (IDS_VDF_IDCT_LIBMPG2));	m_cbIDCTAlgo.AddString (ResStr (IDS_VDF_IDCT_SIMPLE_MMX));	m_cbIDCTAlgo.AddString (ResStr (IDS_VDF_IDCT_XVID));	m_cbIDCTAlgo.AddString (ResStr (IDS_VDF_IDCT_SIMPLE));	nPosY += VERTICAL_SPACING;	m_cbARMode.Create (ResStr (IDS_VDF_AR_MODE), WS_VISIBLE|WS_CHILD|BS_AUTOCHECKBOX|BS_LEFTTEXT, CRect (LEFT_SPACING,  nPosY, 315, nPosY+15), this, IDC_PP_AR);	m_cbARMode.SetCheck(FALSE);	nPosY = 170;#endif	m_grpDXVA.Create   (ResStr (IDS_VDF_DXVA_SETTING),   WS_VISIBLE|WS_CHILD | BS_GROUPBOX, CRect (10, nPosY, 330, nPosY+110), this, IDC_STATIC);	// DXVA mode	nPosY += VERTICAL_SPACING;	m_txtDXVAMode.Create (ResStr (IDS_VDF_DXVA_MODE), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING,  nPosY, 120, nPosY+15), this, IDC_STATIC);	m_edtDXVAMode.Create (WS_CHILD|WS_VISIBLE|WS_DISABLED, CRect (120,  nPosY, 315, nPosY+20), this, 0);	// Video card description	nPosY += VERTICAL_SPACING;	m_txtVideoCardDescription.Create (ResStr (IDS_VDF_VIDEOCARD), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING,  nPosY, 120, nPosY+15), this, IDC_STATIC);	m_edtVideoCardDescription.Create (WS_CHILD|WS_VISIBLE|WS_DISABLED, CRect (120,  nPosY, 315, nPosY+20), this, 0);	m_edtVideoCardDescription.SetWindowText (m_pMDF->GetVideoCardDescription());			DxvaGui = m_pMDF->GetDXVADecoderGuid();	if (DxvaGui != NULL)	{		CString DXVAMode = GetDXVAMode (DxvaGui);		m_edtDXVAMode.SetWindowText (/*GetDXVAMode (DxvaGui)*/DXVAMode);	}	else	{		m_txtDXVAMode.ShowWindow (SW_HIDE);		m_edtDXVAMode.ShowWindow (SW_HIDE);	}	for(CWnd* pWnd = GetWindow(GW_CHILD); pWnd; pWnd = pWnd->GetNextWindow())		pWnd->SetFont(&m_font, FALSE);	#if defined(REGISTER_FILTER) | INCLUDE_MPC_VIDEO_DECODER	if (m_pMDF)	{		#if defined(REGISTER_FILTER) | INTERNAL_DECODER_H264		m_cbThreadNumber.SetCurSel		(m_pMDF->GetThreadNumber() - 1);		m_cbDiscardMode.SetCurSel		(FindDiscardIndex (m_pMDF->GetDiscardMode()));		#endif		m_cbErrorRecognition.SetCurSel	(m_pMDF->GetErrorRecognition()-1);		m_cbIDCTAlgo.SetCurSel			(m_pMDF->GetIDCTAlgo());//.........这里部分代码省略.........
开发者ID:Fluffiest,项目名称:splayer,代码行数:101,


示例13: WindowOf

void CDialogTrustDB::OnInitDialog()    {    //    // Initialize our internals    //    if (Init() != S_OK)        return;    //    // Set the state of our commercial checkbox per the current registry setting    //     ::SendMessage(        WindowOf(IDC_TRUSTCOMMERCIAL),        BM_SETCHECK,         (m_pdb->AreCommercialPublishersTrusted()==S_OK) ? BST_CHECKED : BST_UNCHECKED,        0L);    //    // If we are a property sheet, then hide the OK & Cancel buttons and    // make the banter wider    //    if (m_fPropertySheet)        {        RECT rcBanter, rcOk;        GetWindowRect(WindowOf(IDC_BANTER), &rcBanter);     // get in screen coords        GetWindowRect(WindowOf(IDOK      ), &rcOk);         // get in screen coords        ::SetWindowPos(WindowOf(IDC_BANTER), NULL,             0, 0, Width(rcBanter) + (rcOk.right - rcBanter.right), Height(rcBanter),             SWP_NOMOVE | SWP_NOZORDER);        ::ShowWindow(WindowOf(IDOK),     SW_HIDE);        ::ShowWindow(WindowOf(IDCANCEL), SW_HIDE);        }    else        {        //        // We are the modal dialog variation. Center ourselves in our        // parent window        //	    RECT rcParent, rcMe;        ::GetWindowRect(m_hWndParent,  &rcParent);	    ::GetWindowRect(GetWindow(), &rcMe);        POINT ptParent = Center(rcParent);        POINT ptMe     = Center(rcMe);        POINT pt;        pt.x = ptParent.x - ptMe.x + rcMe.left;        pt.y = ptParent.y - ptMe.y + rcMe.top;	    ::SetWindowPos            (            GetWindow(),             NULL,            pt.x,            pt.y,            0,            0,            SWP_NOZORDER | SWP_NOSIZE            );        //        // Make sure we're on the screen        //        EnsureOnScreen(GetWindow());        }    //    // Populate our list box    //    RefreshTrustList();    }
开发者ID:mingpen,项目名称:OpenNT,代码行数:72,


示例14: JEWEL_ASSERT

boolDateValidator::TransferFromWindow(){    JEWEL_ASSERT (GetWindow()->IsKindOf(CLASSINFO(TextCtrl)));    return true;}
开发者ID:matt-harvey,项目名称:dailycashmanager,代码行数:6,


示例15: CreateWindowExW

/* * @implemented */HWNDWINAPIDECLSPEC_HOTPATCHCreateWindowExW(DWORD dwExStyle,                LPCWSTR lpClassName,                LPCWSTR lpWindowName,                DWORD dwStyle,                int x,                int y,                int nWidth,                int nHeight,                HWND hWndParent,                HMENU hMenu,                HINSTANCE hInstance,                LPVOID lpParam){    MDICREATESTRUCTW mdi;    HWND hwnd;    if (!RegisterDefaultClasses)    {       ERR("CreateWindowExW RegisterSystemControls/n");       RegisterSystemControls();    }    if (dwExStyle & WS_EX_MDICHILD)    {        POINT mPos[2];        UINT id = 0;        HWND top_child;        PWND pWndParent;        pWndParent = ValidateHwnd(hWndParent);        if (!pWndParent) return NULL;        if (pWndParent->fnid != FNID_MDICLIENT)        {           WARN("WS_EX_MDICHILD, but parent %p is not MDIClient/n", hWndParent);           return NULL;        }        /* lpParams of WM_[NC]CREATE is different for MDI children.        * MDICREATESTRUCT members have the originally passed values.        */        mdi.szClass = lpClassName;        mdi.szTitle = lpWindowName;        mdi.hOwner = hInstance;        mdi.x = x;        mdi.y = y;        mdi.cx = nWidth;        mdi.cy = nHeight;        mdi.style = dwStyle;        mdi.lParam = (LPARAM)lpParam;        lpParam = (LPVOID)&mdi;        if (pWndParent->style & MDIS_ALLCHILDSTYLES)        {            if (dwStyle & WS_POPUP)            {                WARN("WS_POPUP with MDIS_ALLCHILDSTYLES is not allowed/n");                return(0);            }            dwStyle |= (WS_CHILD | WS_CLIPSIBLINGS);        }        else        {            dwStyle &= ~WS_POPUP;            dwStyle |= (WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION |                WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX);        }        top_child = GetWindow(hWndParent, GW_CHILD);        if (top_child)        {            /* Restore current maximized child */            if((dwStyle & WS_VISIBLE) && IsZoomed(top_child))            {                TRACE("Restoring current maximized child %p/n", top_child);                SendMessageW( top_child, WM_SETREDRAW, FALSE, 0 );                ShowWindow(top_child, SW_RESTORE);                SendMessageW( top_child, WM_SETREDRAW, TRUE, 0 );            }        }        MDI_CalcDefaultChildPos(hWndParent, -1, mPos, 0, &id);        if (!(dwStyle & WS_POPUP)) hMenu = UlongToHandle(id);        if (dwStyle & (WS_CHILD | WS_POPUP))        {            if (x == CW_USEDEFAULT || x == CW_USEDEFAULT16)            {                x = mPos[0].x;                y = mPos[0].y;//.........这里部分代码省略.........
开发者ID:hoangduit,项目名称:reactos,代码行数:101,


示例16: CreateSolidBrush

void CBadTrustDialog::OnInitDialog()    {    //    // Get the background brush for our edit controls    //    m_hbrBackground = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));    // Load the icon    LPSTR idi;    switch (m_rrn.hrValid)        {    case HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND):    case TRUST_E_NOSIGNATURE:        idi = IDI_EXCLAMATION;        break;    default:        idi = IDI_HAND;        break;        }    HICON hicon = LoadIcon(NULL, idi);    ::SendDlgItemMessage(m_hWnd, IDC_BADTRUSTICON, STM_SETICON, (WPARAM)hicon, (LPARAM)0);    // Set the window title		{		TCHAR sz[128];        WideCharToMultiByte(CP_ACP, 0, m_rrn.wszDialogTitle, -1, (LPSTR)sz, 128, NULL, NULL);		::SetWindowText(GetWindow(), sz);		}    // Set the banter text    int cchBanter2;        {        const int cchMax = INTERNET_MAX_URL_LENGTH+64;        TCHAR sz[cchMax];        // Set the top level banter        ::LoadString(hinst, IDS_BADTRUSTBANTER1, &sz[0], cchMax);        ::SetWindowText(WindowOf(IDC_BADTRUSTBANTER1), &sz[0]);        // Set the program name            {            //            // The 'program' name we see can in fact often be a full URL. URLs            // can be very long, up to 1024 or so.            //            if (m_rrn.wszProgramName)                {                WideCharToMultiByte(CP_ACP, 0, m_rrn.wszProgramName, -1, &sz[0], cchMax, NULL, NULL);                }            else                ::LoadString(hinst, IDS_UNKNOWNPROGRAM, &sz[0], cchMax);            TCHAR szF[cchMax];            ::FormatMessage(hinst, &szF[0], cchMax, IDS_BADTRUSTBANTER2, &sz[0]);            ::SetWindowText(WindowOf(IDC_BADTRUSTBANTER2), &szF[0]);            cchBanter2 = lstrlen(&szF[0]);            //            // This control is read-only. Note that the text on the control            // can be copied using the context menu in the control.            //            SendMessage(WindowOf(IDC_BADTRUSTBANTER2), EM_SETREADONLY, (WPARAM)TRUE, 0);            }        // Set the trailing banter        UINT ids;        switch (m_rrn.hrValid)            {        case HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND):        case TRUST_E_NOSIGNATURE:            ids = IDS_BADTRUSTBANTER31;            break;        case CERT_E_EXPIRED:        case CERT_E_VALIDIYPERIODNESTING:            ids = IDS_BADTRUSTBANTER32;            break;        case NTE_BAD_SIGNATURE:            ids = IDS_BADTRUSTBANTER33;            break;        default:            ids = IDS_BADTRUSTBANTER34;            break;            }        ::LoadString(hinst, ids, &sz[0], cchMax);        ::SetWindowText(WindowOf(IDC_BADTRUSTBANTER3), &sz[0]);        }    // Position the controls so that all are visible        {        UINT spacing = GetSystemMetrics(SM_CYFIXEDFRAME) * 2;        RECT rc1, rc2, rc3;        int h;        POINT pt;        //        // Where on the screen is the client area of the dialog?        //        pt.x = 0;//.........这里部分代码省略.........
开发者ID:mingpen,项目名称:OpenNT,代码行数:101,


示例17: DestroyWindow

BOOL WINAPIDestroyWindow(HWND hWnd){    HWND32 hWnd32, hWndSib32;    HWND hWndSibling, hWndAncestor, hWndFocus, hWndTmp, hWndOwner;    DWORD dwStyle;    int parent_with_focus;    if (!(hWnd32 = CHECKHWND32(hWnd))) {	return FALSE;    }#ifdef	LATER	Send WM_CANCELMODE, if caption is active	Call RealizeDefaultPalette	Send WM_PALETTECHANGED to all windows#endif    if ((hWnd32->dwStyle & WS_CHILD) &&	!(hWnd32->dwExStyle & WS_EX_NOPARENTNOTIFY)) {	hWndAncestor = hWnd;	do {	    hWndAncestor = GetParent(hWndAncestor);	    dwStyle = GetWindowStyle(hWndAncestor);	    SendMessage(hWndAncestor,WM_PARENTNOTIFY,		GET_WM_PARENTNOTIFY_MPS(WM_DESTROY,hWnd32->wChildID,hWnd));	} while (dwStyle & WS_CHILD);    }    if (!IsWindow(hWnd))	return TRUE;    if (hWnd32->dwStyle & WS_VISIBLE) {	if (hWnd32->dwStyle & WS_CHILD)	    ShowWindow(hWnd, SW_HIDE);	else	/* top-level */	    SetWindowPos(hWnd,0,0,0,0,0,		SWP_HIDEWINDOW|SWP_NOACTIVATE|		SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE);    }    if (!IsWindow(hWnd))	return TRUE;    if (hWnd32->hWndIconTitle)	DestroyWindow(hWnd32->hWndIconTitle);    if (!(hWnd32->dwStyle & WS_CHILD)) {	hWndSibling = GetWindow(hWnd, GW_HWNDFIRST);	while (hWndSibling) {	    /* save the next sibling before this one is destroyed */	    hWndSib32 = GETHWND32(hWndSibling);	    hWndTmp = hWndSib32->hWndSibling;	    hWndOwner = hWndSib32->hWndOwner;	    RELEASEWININFO(hWndSib32);	    	    if (hWndOwner == hWnd)		DestroyWindow(hWndSibling);	    if (hWndTmp && !IsWindow(hWndTmp))	/* start all over */		hWndSibling = GetWindow(hWnd, GW_HWNDFIRST);	    else		hWndSibling = hWndTmp;	}    }    /* if focus is held by this window or one of it's descendants,	revert to the parent */    parent_with_focus= 0;    if ((hWndFocus = GetFocus()))	if (hWndFocus == hWnd || IsChild(hWnd,hWndFocus))	    if(IsWindow(hWnd)) {		parent_with_focus= GetParent(hWnd);		SetFocus(parent_with_focus);	    }    /* if we are destroying the frame that has the cursor, reset	the cursor ownership */    if (!(hWnd32->dwStyle & WS_CHILD)) {	if (Get32WindowFrame(hWnd32) == TWIN_GetCursorWindow()) {	    TWIN_SetCursorWindow((HWND)0);	    if (parent_with_focus) {		int n;		POINT FAR lppt;		GetCursorPos(&lppt);		n=SendMessage(parent_with_focus, WM_NCHITTEST,(WPARAM)0, MAKELPARAM(lppt.x,lppt.y));		SendMessage(parent_with_focus, WM_SETCURSOR, (WPARAM)parent_with_focus, n);	    }	}    }    SendDestroyMessages(hWnd);    RemoveFromList(hWnd32);    RELEASEWININFO(hWnd32);    FreeWindow(hWnd);    return TRUE;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:97,


示例18: GetWindow

voidRenamePickLabelAction::Execute(){    GetWindow()->RenamePickLabel(args.GetStringArg1(), args.GetStringArg2());}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:5,


示例19: TEST_F

TEST_F(EntityFixture, PlayerTest) {    GetInput().assignKey(sf::Keyboard::W, Input::Up);    GetInput().assignKey(sf::Keyboard::A, Input::Left);    GetInput().assignKey(sf::Keyboard::S, Input::Down);    GetInput().assignKey(sf::Keyboard::D, Input::Right);    GetInput().assignMouseButton(sf::Mouse::Left, Input::Shoot);    GetInput().setMouseLock(true);    GetWindow().setMouseCursorVisible(false);    dot.setFillColor(sf::Color::Red);    // Add behaviors    playerUpdater = da::BehaviorPtr(new PlayerUpdater(GetView(), GetInput()));    GetManager().addBehavior(playerUpdater);    GetManager().addBehavior(velocitiesUpdater);    GetManager().addBehavior(walker);    GetManager().addBehavior(poseUpdater);    GetManager().addBehavior(xformHistorian);    // Add spatial    GetRenderer().registerSpatial<SpriteSpatial>();    // Create entity    entity = GetManager().create();    entity->addAttribute(new da::Transform);    entity->addAttribute(new da::Depth);    da::TexturePtr texture = GetContent().load<sf::Texture>("mans.png");    entity->addAttribute(new Sprite(texture));    entity->addAttribute(new TransformHistory);    entity->addAttribute(new Collider);    entity->addAttribute(new Velocities);    Poses *poses = new Poses;    Pose pose(6);    for (unsigned int j = 0; j < DirectionCount; j++) {        for (unsigned int i = 0; i < pose.getFrameCount(); i++) {            Pose::Frame frame = {                sf::IntRect(i * 16, j * 24, 16, 24),                sf::Vector2f(8, 20)            };            pose.setFrame((CardinalDirection)j, i, frame);        }    }    poses->addPose("walk", pose);    poses->isLoop = true;    poses->timePerFrame = sf::seconds(0.25f);    poses->setPose("walk", 0);    entity->addAttribute(poses);    Player *player = new Player;    player->walkSpeed = 100.f;    player->viewDistance = 40.f;    entity->addAttribute(player);    GetManager().refresh(entity);    Run(update, emptyHandler, draw);}
开发者ID:RolandMQuiros,项目名称:StoriesFromDelAbismo,代码行数:62,


示例20: AboutBoxWndProc

BOOL CALLBACK AboutBoxWndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)    {    static HWND hAbout ;    char cTmp  [255] ;    switch (iMsg)        {        case WM_INITDIALOG :            if (! STATE_EnterDialogBox ())                {                EndDialog (hwnd, FALSE) ;                return FALSE ;                }            hAbout = GetDlgItem (hwnd, IDD_ABOUT_VERSION) ;#ifndef KICS            sprintf (cTmp, "%s %s", THIEF_VER, THIEF_NICK) ;#endif#ifdef KICS            sprintf (cTmp, "%s %s", THIEF_VER, THIEF_KICS_NICK) ;#endif			if (LUDENS)				{				strncat(cTmp,THIEF_NICK_LUDENS,strlen(THIEF_NICK_LUDENS));				}            SetWindowText (hAbout, cTmp) ;            TOOLBOX_CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER)) ;            return TRUE ;        case WM_COMMAND:            switch (LOWORD (wParam))                {                case IDOK :                case IDCANCEL :						EndDialog (hwnd, TRUE) ;						STATE_LeaveDialogBox () ;						return TRUE ;				case IDD_CREDITS :						strcpy(cTmp,TOOLBOX_GetInstDirPath ());						strcat(cTmp,"//credits.txt");						TOOLBOX_OpenNotePad (cTmp);						break ;				case IDD_THANKS :						strcpy(cTmp,TOOLBOX_GetInstDirPath ());						strcat(cTmp,"//thanks.txt");						TOOLBOX_OpenNotePad (cTmp);						break ;				case IDD_CHANGES :						strcpy(cTmp,TOOLBOX_GetInstDirPath ());						strcat(cTmp,"//changes.txt");						TOOLBOX_OpenNotePad (cTmp);						break ;				case IDD_LGPL :						strcpy(cTmp,TOOLBOX_GetInstDirPath ());						strcat(cTmp,"//LGPL.txt");						TOOLBOX_OpenNotePad (cTmp);						break ;                }            break ;        }    return FALSE ;    }
开发者ID:abl17,项目名称:BugHouseClient,代码行数:66,


示例21: GetMinimumSize

 PixelSize GetMinimumSize() const override {   return GetWindow().GetSize(); }
开发者ID:Advi42,项目名称:XCSoar,代码行数:3,


示例22: ControlKeyBoxWndProc

BOOL CALLBACK ControlKeyBoxWndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)    {    static int nSel ;    static HWND hFunction ;    static int nKey [MAX_CONTROL_KEY] ;    int nI, nJ, nF ;    char c, cTmp [2048] ;    switch (iMsg)        {        case WM_INITDIALOG :            if (! STATE_EnterDialogBox ())                {                EndDialog (hwnd, FALSE) ;                return FALSE ;                }            hFunction = GetDlgItem (hwnd, IDD_CONTROL_FUNCTION) ;            for (nI = 0 ; nI < MAX_CONTROL_KEY ; nI++)                {                NewC_Type [nI] = ControlKey.nType [nI] ;                if ((NewC_Type [nI] < 0) || (NewC_Type [nI] >= MAX_FMENU))                    {                    NewC_Type [nI] = FUNCTION_NONE ;                    }                if (TOOLBOX_NeedCommandValue (NewC_Type [nI]))                    {                    strcpy (NewC_FKey [nI], ControlKey.cFKey [nI]) ;                    }                else                    {                    strcpy (NewC_FKey [nI], "") ;                    }                }            nJ = 0 ;            SendDlgItemMessage (hwnd, IDD_CONTROL_LIST, LB_RESETCONTENT, 0, 0) ;            for (nI = 0 ; nI < MAX_CONTROL_KEY ; nI++)                {                if (nI < 26)                    {                    c = (char) (nI + 'a') ;                    if ((c == 'a') || (c == 'c') || (c == 'v') || (c == 'x'))                        {                        nKey [nI] = -1 ;                        }                    else                        {                        nKey [nJ] = nI ;                        sprintf (cTmp, "%02d. Control %c", nJ + 1, (char) (nI + 'A')) ;                        SendDlgItemMessage (hwnd, IDD_CONTROL_LIST, LB_ADDSTRING, 0, (LPARAM) cTmp) ;                        nJ = nJ + 1 ;                        }                    }                else                    {                    nKey [nJ] = nI ;                    sprintf (cTmp, "%02d. Control %c", nJ + 1, (char) ((nI - 26) + '0')) ;                    SendDlgItemMessage (hwnd, IDD_CONTROL_LIST, LB_ADDSTRING, 0, (LPARAM) cTmp) ;                    nJ = nJ + 1 ;                    }                }            SendDlgItemMessage (hwnd, IDD_CONTROL_LIST, LB_SETCURSEL, 0, 0) ;            SendMessage (hFunction, CB_RESETCONTENT, 0, 0) ;            for (nI = 0 ; nI < MAX_FMENU ; nI++)                {                strcpy (cTmp, FString [nI]) ;                SendMessage (hFunction, CB_ADDSTRING, 0, (LPARAM) cTmp) ;                }            nSel = nKey [0] ;            strcpy (cTmp, FString [NewC_Type [nSel]]) ;            if (SendMessage (hFunction, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) cTmp) == CB_ERR)                {                SendMessage (hFunction, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0) ;                SendMessage (hFunction, WM_SETTEXT, (WPARAM) 0, (LPARAM) cTmp) ;                }            SendDlgItemMessage (hwnd, IDD_CONTROL_COMMAND, WM_SETTEXT, 0, (LPARAM) NewC_FKey [nSel]) ;            EnableWindow (GetDlgItem (hwnd, IDD_CONTROL_COMMAND), TOOLBOX_NeedCommandValue (NewC_Type [nSel])) ;                        TOOLBOX_CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER)) ;            return TRUE ;        case WM_COMMAND:            switch (LOWORD (wParam))                {                case IDD_CONTROL_LIST :                    if (HIWORD (wParam) == LBN_SELCHANGE)                        {                        nJ = SendDlgItemMessage (hwnd, IDD_CONTROL_LIST, LB_GETCURSEL, 0, 0) ;                        nI = nKey [nJ] ;//.........这里部分代码省略.........
开发者ID:abl17,项目名称:BugHouseClient,代码行数:101,


示例23: OnButtonBack

    bool OnButtonBack()    {        GetWindow()->TurnOffOverlayFlags(ofTeleportPane);        return true;    }
开发者ID:borgified,项目名称:Allegiance,代码行数:6,


示例24: GetVars

void COXCustomizeShortkeysPage::OnInitDialog(){	// must call default implementation	COXCustomizePage::OnInitDialog();	// add here initialization code for your demo dialog. Treat it as a	// normal CDialog::OnInitDialog function	// separators	COLORREF clr=::GetSysColor(COLOR_WINDOW);	m_sepShortkeys.SetTextColor(clr);	m_sepDescription.SetTextColor(clr);	m_sepConflict.SetTextColor(clr);	m_sepCommands.SetTextColor(clr);	// populate tree	GetVars();	// populate table of accelerator contexts	COXArrAccelTables* pAccelTables=m_shortkeysOrganizer.GetAccelTables();	ASSERT(pAccelTables!=NULL);	if(pAccelTables->GetSize()==0)	{		// there is no accelerator tables defined for this application		// as aresult all controls on this dialog must be disabled		CWnd* pWndChild=GetWindow(GW_CHILD);		while(pWndChild!=NULL)		{			pWndChild->EnableWindow(FALSE);			pWndChild=pWndChild->GetNextWindow();		}		m_bReadOnly=TRUE;	}	else	{		for(int nIndex=0; nIndex<pAccelTables->GetSize(); nIndex++)		{			CString sText=OXDEFAULTACCEL;			if(pAccelTables->GetAt(nIndex).m_docTemplate!=NULL)			{				pAccelTables->GetAt(nIndex).m_docTemplate->					GetDocString(sText,CDocTemplate::docName);			}			m_comboTable.AddString(sText);		}	}	m_nAccelTableIndex=0;	// layout	//	m_LayoutManager.TieChild(&m_treeCommands,OX_LMS_ANY,OX_LMT_SAME);	m_LayoutManager.TieChild(&m_sepCommands,		OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(&m_sepDescription,		OX_LMS_LEFT|OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_STATIC_DESCRIPTION,		OX_LMS_LEFT|OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_SEPARATOR_SHORTKEYS,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_STATIC_FOR,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_COMBO_TABLE,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_STATIC_CURRENT_KEYS,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_LIST_SHORTKEYS,		OX_LMS_RIGHT|OX_LMS_BOTTOM|OX_LMS_TOP,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_BUTTON_ASSIGN,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_BUTTON_REMOVE,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_BUTTON_REMOVE_ALL,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_BUTTON_RESET_ALL,OX_LMS_RIGHT,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_STATIC_NEW_KEY,		OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_HOTKEY_SHORTKEY,		OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_SEPARATOR_CONFLICTS,		OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME);	m_LayoutManager.TieChild(IDC_OX_STATIC_ASSIGNED_TO,		OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME);	//	///////////////////////////////////////	UpdateData(FALSE);	GetShortkeys();	ShowVars();	m_bInitialized=TRUE;}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:86,


示例25: GetWindow

 //------------------------------------------------------------------------------ void        SwapWeaponAction::Execute (void) {     GetWindow ()->SwapPart(m_equipmentType, m_mount); }
开发者ID:AllegianceZone,项目名称:Allegiance,代码行数:5,


示例26: GetWindowStyle

 // fill task bar with buttons for enumerated top level windowsBOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam){	TaskBar* pThis = (TaskBar*)lparam;	DWORD style = GetWindowStyle(hwnd);	DWORD ex_style = GetWindowExStyle(hwnd);	if ((style&WS_VISIBLE) && !(ex_style&WS_EX_TOOLWINDOW) &&		!GetParent(hwnd) && !GetWindow(hwnd,GW_OWNER)) {		TCHAR title[BUFFER_LEN];		if (!GetWindowText(hwnd, title, BUFFER_LEN))			title[0] = '/0';		TaskBarMap::iterator found = pThis->_map.find(hwnd);		int last_id = 0;		if (found != pThis->_map.end()) {			last_id = found->second._id;			if (!last_id)				found->second._id = pThis->_next_id++;		} else {			HBITMAP hbmp;			HICON hIcon = get_window_icon_small(hwnd);			BOOL delete_icon = FALSE;			if (!hIcon) {				hIcon = LoadIcon(0, IDI_APPLICATION);				delete_icon = TRUE;			}			if (hIcon) {				hbmp = create_bitmap_from_icon(hIcon, GetSysColorBrush(COLOR_BTNFACE), WindowCanvas(pThis->_htoolbar));				if (delete_icon)					DestroyIcon(hIcon); // some icons can be freed, some not - so ignore any error return of DestroyIcon()			} else				hbmp = 0;			TBADDBITMAP ab = {0, (UINT_PTR)hbmp};			int bmp_idx = SendMessage(pThis->_htoolbar, TB_ADDBITMAP, 1, (LPARAM)&ab);			TaskBarEntry entry;			entry._id = pThis->_next_id++;			entry._hbmp = hbmp;			entry._bmp_idx = bmp_idx;			entry._title = title;			pThis->_map[hwnd] = entry;			found = pThis->_map.find(hwnd);		}		TBBUTTON btn = {-2/*I_IMAGENONE*/, 0, TBSTATE_ENABLED/*|TBSTATE_ELLIPSES*/, BTNS_BUTTON, {0, 0}, 0, 0};		TaskBarEntry& entry = found->second;		++entry._used;		btn.idCommand = entry._id;		HWND foreground = GetForegroundWindow();		HWND foreground_owner = GetWindow(foreground, GW_OWNER);		if (hwnd==foreground || hwnd==foreground_owner) {			btn.fsState |= TBSTATE_PRESSED|TBSTATE_CHECKED;			pThis->_last_foreground_wnd = hwnd;		}		if (!last_id) {			 // create new toolbar buttons for new windows			if (title[0])				btn.iString = (INT_PTR)title;			btn.iBitmap = entry._bmp_idx;			entry._btn_idx = SendMessage(pThis->_htoolbar, TB_BUTTONCOUNT, 0, 0);			SendMessage(pThis->_htoolbar, TB_INSERTBUTTON, entry._btn_idx, (LPARAM)&btn);			pThis->ResizeButtons();		} else {			 // refresh attributes of existing buttons			if (btn.fsState != entry._fsState)				SendMessage(pThis->_htoolbar, TB_SETSTATE, entry._id, MAKELONG(btn.fsState,0));			if (entry._title != title) {				TBBUTTONINFO info;				info.cbSize = sizeof(TBBUTTONINFO);				info.dwMask = TBIF_TEXT;				info.pszText = title;				SendMessage(pThis->_htoolbar, TB_SETBUTTONINFO, entry._id, (LPARAM)&info);				entry._title = title;			}		}		entry._fsState = btn.fsState;#ifdef __REACTOS__	// now handled by activating the ARW_HIDE flag with SystemParametersInfo(SPI_SETMINIMIZEDMETRICS)//.........这里部分代码省略.........
开发者ID:svn2github,项目名称:ros-explorer,代码行数:101,


示例27: AssertWrapperOk

/** * Tries to switch to the main window of the VM process. * * @return true if successfully switched and false otherwise. */bool UIVMItem::switchTo(){#ifdef Q_WS_MAC    ULONG64 id = m_machine.ShowConsoleWindow();#else    WId id = (WId) m_machine.ShowConsoleWindow();#endif    AssertWrapperOk(m_machine);    if (!m_machine.isOk())        return false;    /* winId = 0 it means the console window has already done everything     * necessary to implement the "show window" semantics. */    if (id == 0)        return true;#if defined (Q_WS_WIN32) || defined (Q_WS_X11)    return vboxGlobal().activateWindow(id, true);#elif defined (Q_WS_MAC)    /*     * This is just for the case were the other process cannot steal     * the focus from us. It will send us a PSN so we can try.     */    ProcessSerialNumber psn;    psn.highLongOfPSN = id >> 32;    psn.lowLongOfPSN = (UInt32)id;    OSErr rc = ::SetFrontProcess(&psn);    if (!rc)        Log(("GUI: %#RX64 couldn't do SetFrontProcess on itself, the selector (we) had to do it.../n", id));    else        Log(("GUI: Failed to bring %#RX64 to front. rc=%#x/n", id, rc));    return !rc;#endif    return false;    /// @todo Below is the old method of switching to the console window    //  based on the process ID of the console process. It should go away    //  after the new (callback-based) method is fully tested.#if 0    if (!canSwitchTo())        return false;#if defined (Q_WS_WIN32)    HWND hwnd = mWinId;    /* if there are blockers (modal and modeless dialogs, etc), find the     * topmost one */    HWND hwndAbove = NULL;    do    {        hwndAbove = GetNextWindow(hwnd, GW_HWNDPREV);        HWND hwndOwner;        if (hwndAbove != NULL &&            ((hwndOwner = GetWindow(hwndAbove, GW_OWNER)) == hwnd ||             hwndOwner  == hwndAbove))            hwnd = hwndAbove;        else            break;    }    while (1);    /* first, check that the primary window is visible */    if (IsIconic(mWinId))        ShowWindow(mWinId, SW_RESTORE);    else if (!IsWindowVisible(mWinId))        ShowWindow(mWinId, SW_SHOW);#if 0    LogFlowFunc(("mWinId=%08X hwnd=%08X/n", mWinId, hwnd));#endif    /* then, activate the topmost in the group */    AllowSetForegroundWindow(m_pid);    SetForegroundWindow(hwnd);    return true;#elif defined (Q_WS_X11)    return false;#elif defined (Q_WS_MAC)    ProcessSerialNumber psn;    OSStatus rc = ::GetProcessForPID(m_pid, &psn);    if (!rc)    {        rc = ::SetFrontProcess(&psn);//.........这里部分代码省略.........
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:101,


示例28: OnApplyNow

void CDialogTrustDB::OnOK()    {    OnApplyNow();    ::EndDialog(GetWindow(), IDOK);    }
开发者ID:mingpen,项目名称:OpenNT,代码行数:5,



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


C++ GetWindowBounds函数代码示例
C++ GetWidth函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。