flat assembler
Message board for the users of flat assembler.
Index
> Windows > Tooltip flickering issue |
Author |
|
bitRAKE 13 Dec 2024, 03:10
I would first try WS_EX_NOACTIVATE.
Then does removing WS_EX_TRANSPARENT solve the flickering problem? (WS_EX_TOPMOST should be sufficient.) IIRC, This message links painting to updates of controls below the tooltip and those updates are triggering redraw of the tooltip. Nothing in the code fragment you've shown indicates a need for WS_EX_TRANSPARENT. (In this example, I show the minimum required. The window hierarchy is sufficient to setup draw order - the parent is a dialog.) _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
13 Dec 2024, 03:10 |
|
extra_12345 13 Dec 2024, 09:49
bitRAKE wrote: I would first try WS_EX_NOACTIVATE. thanks for the reply, I removed WS_EX_TRANSPARENT but it's still flickering, so weird. Code: invoke CreateWindowExA,WS_EX_TOPMOST or WS_EX_NOACTIVATE, class_tooltip,0,WS_POPUP or TTS_ALWAYSTIP or TTS_NOPREFIX, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, [hWnd], 0, [hInst] , 0 mov [hwnd_Tooltip_string], rax invoke GetDlgItem, [hWnd], 10 stdcall SetToolTip, rax, tooltip_text_string, [hwnd_Tooltip_string] |
|||
13 Dec 2024, 09:49 |
|
macomics 13 Dec 2024, 11:05
Most likely, it's not about the flags. What is it that is so fast redrawing the window? There's not much to say without the window procedure code.
Maybe you have some kind of timer there that changes the states of child windows, which is why there are constant redraws? |
|||
13 Dec 2024, 11:05 |
|
AsmGuru62 13 Dec 2024, 13:31
If 'class_tooltip' is your own window class --- probably should post here the WNDPROC for the class.
Also, I recall something from long ago (when I used tooltips system provided by Win API) --- there is an interesting fact about WM_MOUSEMOVE message: lets say you have a mouse cursor on X,Y on some pixel on screen. Then window pops up and covers that pixel. When that same window will disappear, the underneath window will receive the WM_MOUSEMOVE. However, it is same X,Y --- no mouse movement was really done. Just by the other popup window appearing and disappearing, your window will get WM_MOUSEMOVE on the same pixel. Also, as I said, would be nice to see the WNDPROC, I am not sure if 'class_tooltip' is a WIN API class or yours? Also #2: it is a good debugging trick to use OutputDebugString to print into debugger window. When you deal with mouse and focuses and activation messages --- debugger stopping on a breakpoint will affect all those events. To understand what is really happening --- you need to print and not stop on breaks. |
|||
13 Dec 2024, 13:31 |
|
macomics 13 Dec 2024, 14:11
AsmGuru62 wrote: lets say you have a mouse cursor on X,Y on some pixel on screen. |
|||
13 Dec 2024, 14:11 |
|
extra_12345 13 Dec 2024, 15:51
This is the WindowProc:
proc MainProc uses rbx rsi rdi,hwnd,msg,wparam,lparam local pt:POINT mov [hwnd],rcx mov [msg],rdx mov [wparam],r8 mov [lparam],r9 .if [msg] = WM_CLOSE invoke EndDialog,[hwnd],0 mov eax,1 .elseif [msg] = WM_INITDIALOG invoke GetModuleHandle,0 invoke CreateWindowExA,WS_EX_TOPMOST or WS_EX_NOACTIVATE, class_tooltip,0,WS_POPUP or TTS_ALWAYSTIP or TTS_NOPREFIX, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, [hwnd], 0, rax , 0 mov [hwnd_Tooltip_string], rax invoke GetDlgItem, [hwnd], 10 stdcall SetToolTip, rax, tooltip_text_string, [hwnd_Tooltip_string] mov rax,[hwnd] mov [hWnd],rax mov eax,1 .else xor eax,eax .endif ret endp and class_tooltip is just a string indicating tooltip class to be used to create the window: class_tooltip db 'tooltips_class32',0 ; Tooltip class not sure if it helps but when I press and hold a key let's say space then flickering goes away and tooltip appears. |
|||
13 Dec 2024, 15:51 |
|
macomics 13 Dec 2024, 16:15
Try use
Code: invoke SetWindowPos, [hwnd_Tooltip_string], HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE Otherwise it should work. |
|||
13 Dec 2024, 16:15 |
|
extra_12345 13 Dec 2024, 17:33
macomics wrote: Try use I tried this too and it's still flickering unfortunately. |
|||
13 Dec 2024, 17:33 |
|
extra_12345 13 Dec 2024, 17:53
Figured what was the issue, it's the Windows resolution scaling (often found in Display Settings as "Scale and Layout"), when it's set to %150 then it starts flickering but it's fine on %125 and %100 and I got no idea how to fix it.
|
|||
13 Dec 2024, 17:53 |
|
macomics 13 Dec 2024, 18:07
extra_12345 wrote: Figured what was the issue, it's the Windows resolution scaling (often found in Display Settings as "Scale and Layout"), when it's set to %150 then it starts flickering but it's fine on %125 and %100 and I got no idea how to fix it. |
|||
13 Dec 2024, 18:07 |
|
Ali.Z 15 Dec 2024, 15:44
i dont believe super/sub-class is needed, it is an overkill.
this is mostly dpi awareness and dpi behavior, by defaut on recent windows automatic dpi scaling for apps is handled by the system. it is either you change ur dpi awareness during runtime, or manifest that define the dpi behavior. a possible solution is right-click the exe, set who will handle dpi thing, app or system. _________________ Asm For Wise Humans |
|||
15 Dec 2024, 15:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.