VectorPropertyWnd(Vector* vec): ChildWnd(true), _vec(vec) { SetStyleEx(WS_EX_CONTROLPARENT); _x = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD|WS_TABSTOP|ES_AUTOHSCROLL, 0, 0, 0, 0, GetWindow(), (HMENU)1, GetModuleHandle(NULL), 0L); _y = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD|WS_TABSTOP|ES_AUTOHSCROLL, 0, 0, 0, 0, GetWindow(), (HMENU)2, GetModuleHandle(NULL), 0L); _z = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD|WS_TABSTOP|ES_AUTOHSCROLL, 0, 0, 0, 0, GetWindow(), (HMENU)3, GetModuleHandle(NULL), 0L); Layout(); Update(); _font = CreateFont(-11, 0, 0, 0, 400, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, DEFAULT_PITCH, TL(ui_font)); SendMessage(_x, WM_SETFONT, (WPARAM)(HFONT)_font, FALSE); SendMessage(_y, WM_SETFONT, (WPARAM)(HFONT)_font, FALSE); SendMessage(_z, WM_SETFONT, (WPARAM)(HFONT)_font, FALSE); ShowWindow(_x, SW_SHOW); ShowWindow(_y, SW_SHOW); ShowWindow(_z, SW_SHOW); }
BOOL BaseButton::create_window(PCWSTR title,HWND parent,int xPos,int yPos,int Height,int Width) { SetClassName(WC_BUTTON); SetPos(xPos,yPos); SetSize(Width,Height); SetWindowClassCreate(FALSE); //CreateWndClass(sizeof(WNDCLASSEX),CS_HREDRAW|CS_VREDRAW,NULL,NULL,NULL,NULL,NULL,NULL,L"Button",NULL); //return Create(title,WS_CHILD|WS_VISIBLE|BS_MULTILINE|WS_TABSTOP|WS_GROUP,parent,WS_EX_OVERLAPPEDWINDOW,NULL); SetWindowTitle((wchar_t *)(title)); SetStyle(WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON&~WS_BORDER); SetStyleEx(NULL); SetHParent(parent); //SetMenu(NULL); BOOL created= Create(); //SetWNDPROC(); return created; //return TRUE; }
/** * * Extracts details pertaining to a window * * @param WindowObj - Window data * @return void * @exception Nil * @see Nil * @since 1.0 */ void Window::ExtractWindowDetails( const HWND hWnd_i ) { // Set window handle SetHandle( hWnd_i ); // Set thread id of window SetThreadId( ::GetWindowThreadProcessId( GetHandle(), 0 )); // Get class name of window TCHAR szBuffer[MAX_PATH] = { 0 }; ::GetClassName( GetHandle(), szBuffer, MAX_PATH ); GetClassName() = szBuffer; GetClass().cbSize = sizeof( GetClass() ); GetClassInfoEx( AfxGetInstanceHandle(), szBuffer, &GetClass() ); // Get window text if any InternalGetWindowText( GetHandle(), GetTitle().GetBufferSetLength( MAX_PATH ), MAX_PATH ); GetTitle().ReleaseBuffer(); // Get normal style SetStyle( GetWindowLong( GetHandle(), GWL_STYLE )); // Get extended style SetStyleEx( GetWindowLong( GetHandle(), GWL_EXSTYLE )); // Get window id SetId( GetWindowLong( GetHandle(), GWL_ID )); // Get parent window SetParentHandle( RCAST( HWND, GetWindowLong( GetHandle(), GWL_HWNDPARENT ))); // Window state i.e. window is maximized, minimized or restored GetStateAsString( GetState() ); // For style parsing RetrieveWndStyles(); // Window bounds CRect crBounds; GetWindowRect( GetHandle(), &crBounds ); if( crBounds.Width() || crBounds.Height() ) { GetBounds().Format( _T( "L:%d T:%d R:%d B:%d" ), crBounds.left, crBounds.top, crBounds.right, crBounds.bottom ); }// End if // Retrieves unicode support status for windows SetUnicode( IsWindowUnicode( GetHandle() )); // Get window icon DWORD dwResult = 0; Utils::SndMsgTimeOutHelper( GetHandle(), WM_GETICON, ICON_SMALL, 0, dwResult ); // Get window icon SetIcon( RCAST( HICON, dwResult )); // Get enabled status of window SetEnabled( IsWindowEnabled( GetHandle() )); }// End ExtractWindowDetails