Alguien me podria ayudar??
Necesito poner una barra de herramientas (CToolBar) en vertical y centrada en la pantalla.
Gracias a todos por vuestra ayuda
![]() |
![]() |
|
Moderador: latindeveloper

rbpkirow escribió:Hola de nuevo.
Alguien me podria ayudar??
Necesito poner una barra de herramientas (CToolBar) en vertical y centrada en la pantalla.
Gracias a todos por vuestra ayuda
- Código: Seleccionar todo
hwndRB = CreateWindowEx( WS_EX_TOOLWINDOW,
REBARCLASSNAME,
NULL,
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|
WS_CLIPCHILDREN|RBS_VARHEIGHT|
CCS_NODIVIDER,
0,0,0,0,
hwndOwner,
NULL,
g_hinst,
NULL
);
rbBand.cbSize = sizeof(REBARBANDINFO);
rbBand.fMask = RBBIM_COLORS | RBBIM_TEXT | RBBIM_BACKGROUND | RBBIM_STYLE |
RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE;
rbBand.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDBMP;
typedef struct tagREBARBANDINFO{
UINT cbSize;
UINT fMask;
UINT fStyle;
COLORREF clrFore;
COLORREF clrBack;
LPTSTR lpText;
UINT cch;
int iImage;
HWND hwndChild;
UINT cxMinChild;
UINT cyMinChild;
UINT cx;
HBITMAP hbmBack;
UINT wID;
#if (_WIN32_IE >= 0x0400)
UINT cyChild;
UINT cyMaxChild;
UINT cyIntegral;
UINT cxIdeal;
LPARAM lParam;
UINT cxHeader;
#endif
} REBARBANDINFO, *LPREBARBANDINFO;ufff, si no entendiste nada pues puedes referirte a SDK de Windows, esto solo se hace utilizando API's oki.


rbpkirow escribió:Centrarla en la pantalla.
[/code]
- Código: Seleccionar todo
// variable ke contendra las dimenciones de la ventana
RECT rFrame;
// Handle de la ventana principal
HWND hWnd;
// Funcion Principal de la ventana
LRESULT CALLBACK WndPrc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{
// Ancho de tu ToolBar
int nTbAncho;
// Alto de tu ToolBar
int nTbAlto;
switch( message )
{
case WM_CREATE:
MoveWindow( hToolBar,
( rFrame.right - nTbAncho )/2,
( rFrame.bottom - nTbAlto )/2,
nTbAncho,
nTbAlto,
TRUE
);
break;
case WM_SIZE:
GetClientRect( hWnd, &rFrame );
break;
}
return DefWindowProc( hWnd, message, wParam, lParam );
}


rbpkirow escribió:Estoy probando el codigo que me dejaste, pero la variable hwndRB, no se que tipo es. porque me me dice que no es una funcion miembro ni de toolbar ni de rebar.
Gracias por todo.
HWND hWndRB; 

Usuarios navegando por este Foro: Google [Bot] y 0 invitados