hi all, i'm having problem with trayicon example . the code example was modified just with 2 line:
old:

.elseif uMsg == WM_SIZE
.if wParam == SIZE_MINIMIZED


new:

.elseif uMsg == WM_NCACTIVATE
.if wParam == 0

with this i want to hide the window while user click another window, but the problem is when i dblclick the tray, the window activate again with condition 'deactivated', so i have to click the bar to see the window again. how do i fix this?

thanks
Posted on 2002-10-08 21:18:42 by dion
Try slapping an invoke SendMessage,hWnd,WM_NCACTIVATE,TRUE,NULL in when you
restore the window... That should activate the window again, as far as I can figure atleast
Posted on 2002-10-09 02:32:27 by NervGaz
hi NervGaz, thanks 4 replying. but, if the solution was in the dblclick routine, i have do my way with SetForegroundwindow and SetActivewindow API. still... i dont want to do this thing, bcoz it somehow incorrect way to do. i just ask what message do i have to filter to do hide window properly... do u know how?

thanks
Posted on 2002-10-09 03:05:06 by dion
WM_ACTIVATE might be worth checking out when checking if youre deactivated...
but I'm not sure if that helps... In any case poke around a bit on MSDN or your
trusty Platform SDK and you should probably find what you're looking for...
Bah, back to work....
Posted on 2002-10-09 07:36:11 by NervGaz
oh, sorry to bother ur work, NervGaz.
anyway i would ask it to another guy.
actually, i know one that maybe work, its WM_NCHITTEST. but, i dont see any point for the time user click the other window. and for WM_ACTIVATE, i've try it, but failed with bug too.

thanks
Posted on 2002-10-10 04:45:15 by dion
this works (it is derived from a trayicon example as well).



.elseif (eax == WM_SIZE)

.if ((wParam == SIZE_MINIMIZED))
invoke ShowWindow, hWnd, SW_HIDE
xor eax,eax
ret
.endif
movzx ecx,word ptr lParam+0
movzx edx,word ptr lParam+2
invoke SetWindowPos, g_hWndLB, NULL, 0, 0, ecx, edx,\
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOZORDER

.elseif (eax == WM_CLOSE)

invoke CloseWindow, hWnd

.elseif (eax == WM_ACTIVATE)

movzx eax,word ptr wParam
.if (eax == WA_INACTIVE)
invoke CloseWindow, hWnd
.endif


the window closes if user clicks another window or clicks the "close" cross.

japheth
Posted on 2002-10-10 06:42:54 by japheth
hi japhet, i tried ur code.

the setwindowpos was yield a buggy window's behaviour. the client area disappear. the WM_ACTIVATE was work, as i know it worked. but the problem is not that, japhet. the issue was when i dbl click the tray again, the window dont show up in foreground. its status is "deactivated". u should read my post before this.

i want to know what exactly msg sent when user click another window, but before the window latest status was active, not after deactivated.

mmm... ok, cheers ;)
Posted on 2002-10-11 05:42:20 by dion