flat assembler
Message board for the users of flat assembler.

Index > Windows > ListView & Tray & Update ... problem

Author
Thread Post new topic Reply to topic
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
I have a dialog (DialogBoxParam) with a ListView (SysListView32) and when i send it to tray and then i restore the dialog the ListView is not "updated".

I have this in my project:

.ELSEIF lParam==WM_LBUTTONDBLCLK
invoke ShowWindow,hWnd,SW_RESTORE
invoke SetForegroundWindow,hWnd

I have also tried "invoke UpdateWindow,hWnd'.

Ideas?


Description:
Filesize: 11.76 KB
Viewed: 1918 Time(s)

listview.JPG


Post 12 Sep 2008, 16:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
Maybe this thread can help. Is is not quite the same problem but the solution might work for you also.
Post 12 Sep 2008, 16:40
View user's profile Send private message Visit poster's website Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
SetFocus? doesnt work...
Post 12 Sep 2008, 16:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
Perhaps you can make some minimal code that exhibits the problem and post it here. Then others may be able to help a bit more.
Post 12 Sep 2008, 16:49
View user's profile Send private message Visit poster's website Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
project.rc

CONTROL "",5000,"SysListView32",WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP|LVS_ALIGNLEFT|LVS_REPORT,5,14,339,105

project.asm

goes to tray:
...
...
.ELSEIF uMsg == WM_SIZE
.IF wParam == SIZE_MINIMIZED
invoke ShowWindow,hWnd,NULL ; SW_HIDE
invoke UpdateWindow,hWnd
.ENDIF

...

back from tray:

...

.ELSEIF uMsg==WM_SHELLNOTIFY
.IF wParam==IDI_TRAY
.IF lParam==WM_RBUTTONDOWN
invoke GetCursorPos,ADDR pt
invoke SetForegroundWindow,hWnd
invoke TrackPopupMenu,hPopupMenu,TPM_RIGHTALIGN,pt.x,pt.y,NULL,hWnd,NULL
.ELSEIF lParam==WM_LBUTTONDBLCLK
invoke ShowWindow,hWnd,SW_RESTORE
invoke SetForegroundWindow,hWnd
invoke UpdateWindow,hWnd
.ENDIF
.ENDIF
....

but the listview doesnt "refresh" at all (see image)
Post 12 Sep 2008, 17:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
Have you tried InvalidateRect?
Post 12 Sep 2008, 23:39
View user's profile Send private message Visit poster's website Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
no.. but its strange why entire window (listview included) is not refreshing correctly with this code.

i will search the forum for an InvalidateRect example... thx
Post 13 Sep 2008, 08:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
Just insert:
Code:
invoke InvalidateRect,hWnd,NULL,TRUE    
Or, if you don't like symbolic constants:
Code:
invoke InvalidateRect,hWnd,0,-1    
BTW: make sure that your hWnd is properly defined. It should assemble to [some_dword_address]. You may want to check that.
Post 13 Sep 2008, 08:56
View user's profile Send private message Visit poster's website Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
it works! thx a lot
Post 13 Sep 2008, 09:11
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

Or, if you don't like symbolic constants:

Code:
; General constants

NULL  = 0
TRUE  = 1 ; <<<< POSITIVE
FALSE = 0    

Perhaps there is no API that checks for 1 exactly but I would stick to that value just to be safe.
Post 13 Sep 2008, 11:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
I always use:
Code:
FALSE=0
TRUE = not FALSE    
Seemed quite logical to me. But thanks for pointing that out.
Post 13 Sep 2008, 11:38
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.