ok i working on a status bar. my code works good but now i would like to modify it so that the status bar has maybe 3 or so panels on it instead of just one big one. here is my code. .386 .model flat,stdcall option casemap:none WinMain proto :DWORD,:DWORD,:DWORD,:DWORD include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\comctl32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\comctl32.lib .data ClassName db "SimpleWinClass",0 AppName db "A Simple StatusBar",0 .data? hInstance HINSTANCE ? CommandLine LPSTR ? .const IDM_A equ 1 .code start: invoke GetModuleHandle, NULL mov hInstance,eax invoke GetCommandLine mov CommandLine,eax invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT invoke ExitProcess,eax invoke InitCommonControls WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD LOCAL wc:WNDCLASSEX LOCAL msg:MSG LOCAL hwnd:HWND mov wc.cbSize,SIZEOF WNDCLASSEX mov wc.style, CS_HREDRAW or CS_VREDRAW mov wc.lpfnWndProc, OFFSET WndProc mov wc.cbClsExtra,NULL mov wc.cbWndExtra,NULL push hInst pop wc.hInstance mov wc.hbrBackground,COLOR_WINDOW+1 mov wc.lpszMenuName,NULL mov wc.lpszClassName,OFFSET ClassName invoke LoadIcon,NULL,IDI_APPLICATION mov wc.hIcon,eax mov wc.hIconSm,eax invoke LoadCursor,NULL,IDC_ARROW mov wc.hCursor,eax invoke RegisterClassEx, addr wc INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\ WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\ CW_USEDEFAULT,300,200,NULL,NULL,\ hInst,NULL mov hwnd,eax invoke CreateStatusWindow,WS_CHILD+WS_VISIBLE,NULL,hwnd,IDM_A invoke ShowWindow, hwnd,SW_SHOWNORMAL invoke UpdateWindow, hwnd .WHILE TRUE invoke GetMessage, ADDR msg,NULL,0,0 .BREAK .IF (!eax) invoke TranslateMessage, ADDR msg invoke DispatchMessage, ADDR msg .ENDW mov eax,msg.wParam ret WinMain endp WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM .IF uMsg==WM_DESTROY invoke PostQuitMessage,NULL .ELSE invoke DefWindowProc,hWnd,uMsg,wParam,lParam ret .ENDIF xor eax,eax ret WndProc endp end start
Posted on 2001-03-25 15:02:00 by smurf
Here is how to create a Statusbar with multiple panels.

LOCAL sbPanels[4]:DWORD

invoke CreateStatusWindow,WS_CHILD or WS_VISIBLE or SBS_SIZEGRIP,NULL,hWin,STAT_ID
mov    hStatusBar,eax
mov    ,125    ; pixels from left
mov    ,250    ; pixels from left
mov    ,375    ; pixels from left
mov    , -1    ; last part
invoke SendMessage,hStatusBar,SB_SETPARTS,4,addr sbPanels
And incase you are wondering how to keep the Statusbar where it belongs when you resize the main window, add this in the WM_SIZE message handler.

invoke MoveWindow,hStatusBar,0,0,0,0,TRUE
This message was edited by anon, on 3/25/2001 7:22:54 PM This message was edited by anon, on 3/25/2001 7:24:12 PM
Posted on 2001-03-25 18:20:00 by anon
thank you for the help it works great! smurf
Posted on 2001-03-25 23:46:00 by smurf