i was looking at it to help me and noticed that the program kept on minimizing to the task bar similar to zcoders program. i made a few changes to your code and seems to work fine now. heres the new code if your interested. i tried to email you but either the email i was tring to use was invalid or my mail server has a problem.
; -------------------------------------------------------------------------
.NOLIST
.386
.model flat, stdcall
option casemap :none ; case sensitive
;lake mezulla
; -------------------------------------------------------------------------
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
include \masm32\include\winmm.inc
include \masm32\include\advapi32.inc
include \masm32\include\masm32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\shell32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\winmm.lib
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\shell32.lib
.LISTALL
; -------------------------------------------------------------------------
; Local prototypes
WinMain PROTO :DWORD, :DWORD, :DWORD, :DWORD
WndProc PROTO :DWORD, :DWORD, :DWORD, :DWORD
TopXY PROTO :DWORD, :DWORD
; -------------------------------------------------------------------------
.data
AppName BYTE "Timer",0
ClassName BYTE "CWinTimer",0
KeyDown DWORD 0
wBackBmp DWORD 135
hBackBmp DWORD 187
rectCAPTION RECT { 21, 4, 97, 23}
; -------------------------------------------------------------------------
.data?
hInstance DWORD ?
CommandLine LPSTR ?
hdc HDC ?
hdcBuf HDC ?
lMouseX0 DWORD ?
lMouseY0 DWORD ?
hWndMain HWND ?
hBmBackground HBITMAP ?
hBmOldBuf HBITMAP ?
sBuffer DB (MAX_PATH+1) DUP(?)
; -------------------------------------------------------------------------
.const
IDI_TIMER EQU 500
IDB_BACKGROUND EQU 501
BROWN EQU 00004284H ; COLORREF == 00BBGGRR
TAN EQU 00BDDEFFH
LT_GRAY EQU 00DEDEDEH
WHITE EQU 00FFFFFFH
; -------------------------------------------------------------------------
.code
START:
invoke GetModuleHandle, NULL
mov hInstance,eax
invoke GetCommandLine
invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT
invoke ExitProcess,eax
WinMain PROC hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL msg:MSG, wc:WNDCLASSEX,
wWin:DWORD, hWin:DWORD,
xWin:DWORD, yWin:DWORD,
x1Reg:DWORD, y1Reg:DWORD,
x2Reg:DWORD, y2Reg:DWORD
; define our window class
mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style, NULL
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra,NULL
mov wc.cbWndExtra,NULL
push hInst
pop wc.hInstance
invoke CreateSolidBrush, TAN
mov wc.hbrBackground, eax
mov wc.lpszMenuName,NULL
mov wc.lpszClassName,OFFSET ClassName
invoke LoadIcon, hInst, IDI_TIMER
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx, addr wc
; background bitmap size is wBackBmp, hBackBmp
; we need to create a window with this size client area
; get some dimenstions to find the client area
mov eax, wBackBmp
mov wWin, eax
mov x2Reg, eax
mov eax, hBackBmp
mov hWin, eax
mov y2Reg, eax
invoke GetSystemMetrics, SM_CYDLGFRAME
mov y1Reg, eax
add y2Reg, eax
shl eax, 1 ; SM_CYDLGFRAME * 2
add hWin, eax
add wW