I want to do an animation with icons in the dialog titlebar (4 icons)
but i have this odd problem that title bar caption goes sometimes
over the icon...
Here is how I do it:
DlgProc proc hDlg:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
Invoke SetTimer, hDlg, 10h, 80h, 0h
....
.ELSEIF uMsg == WM_TIMER
cmp dword ptr , 0
jz RestoreOriginalIcon
cmp dword ptr , 5000
jnz IncreaseCounter
mov dword ptr , 0
jmp QuitSimpleGfxStuff
IncreaseCounter:
Invoke SetWindowTextA, hDlg, offset new_caption
add dword ptr , 1000 ; the 4 icons are 1000/2000/3000/4000
Invoke LoadIcon, hInst, counter
Invoke SendMessage, hDlg, WM_SETICON, TRUE, eax
jmp EndSimpleAnimIcon
RestoreOriginalIcon:
Invoke LoadIcon, hInst, 900
Invoke SendMessage, hDlg, WM_SETICON, TRUE, eax
Invoke SetWindowTextA, hDlg, offset old_caption
EndSimpleAnimIcon:
pls someone help me do this stuff properly, coz im sure there is somethin wrong in here=/
I really suck at coding win32gui
but i have this odd problem that title bar caption goes sometimes
over the icon...
Here is how I do it:
DlgProc proc hDlg:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
Invoke SetTimer, hDlg, 10h, 80h, 0h
....
.ELSEIF uMsg == WM_TIMER
cmp dword ptr , 0
jz RestoreOriginalIcon
cmp dword ptr , 5000
jnz IncreaseCounter
mov dword ptr , 0
jmp QuitSimpleGfxStuff
IncreaseCounter:
Invoke SetWindowTextA, hDlg, offset new_caption
add dword ptr , 1000 ; the 4 icons are 1000/2000/3000/4000
Invoke LoadIcon, hInst, counter
Invoke SendMessage, hDlg, WM_SETICON, TRUE, eax
jmp EndSimpleAnimIcon
RestoreOriginalIcon:
Invoke LoadIcon, hInst, 900
Invoke SendMessage, hDlg, WM_SETICON, TRUE, eax
Invoke SetWindowTextA, hDlg, offset old_caption
EndSimpleAnimIcon:
pls someone help me do this stuff properly, coz im sure there is somethin wrong in here=/
I really suck at coding win32gui
Thats funny, my docs say
WM_SETICON
wParam = (WPARAM) (BOOL) fType; // icon size (large or small)
lParam = (LPARAM) (HICON) hicon; // handle of icon
An application sends the WM_SETICON message to associate a new big or small icon with a window. Windows draws the big icon when the window is minimized, and the small icon in the window's title bar.
fType
Value of wParam. Specifies the icon being set. If TRUE, the message sets the big icon. If FALSE, the message sets the small icon.
hicon
Value of lParam. Identifies the new big or small icon. If this parameter is NULL, the icon indicated by fType is removed.
And I see you are setting the value to true which means your setting the large icon...
WM_SETICON
wParam = (WPARAM) (BOOL) fType; // icon size (large or small)
lParam = (LPARAM) (HICON) hicon; // handle of icon
An application sends the WM_SETICON message to associate a new big or small icon with a window. Windows draws the big icon when the window is minimized, and the small icon in the window's title bar.
fType
Value of wParam. Specifies the icon being set. If TRUE, the message sets the big icon. If FALSE, the message sets the small icon.
hicon
Value of lParam. Identifies the new big or small icon. If this parameter is NULL, the icon indicated by fType is removed.
And I see you are setting the value to true which means your setting the large icon...
Example in RadAsm project:
thanks the svin, that's just what I needed:)
You are wellcome :)