ShowWindow(SW_HIDE) problem

This is a discussion on ShowWindow(SW_HIDE) problem within the Windows Programming forums, part of the Platform Specific Boards category; i made a simple test project if you didn't get my problem and never reproduced it, it will say what ...

  1. #16
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    i made a simple test project if you didn't get my problem and never reproduced it, it will say what to do exactly..

    edit: please rename it to TEST.zip lol
    Attached Files Attached Files
    Last edited by eXistenZ; 09-05-2008 at 03:16 AM.

  2. #17
    Registered User
    Join Date
    Dec 2007
    Posts
    214
    I looked at your sample and I now see what you are talking about, but this doesn't send the window to the system tray, just to the task bar. In one of your replies you mentioned the system tray. Thats part of what confused me.

  3. #18
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    Quote Originally Posted by DaveH View Post
    I looked at your sample and I now see what you are talking about, but this doesn't send the window to the system tray, just to the task bar. In one of your replies you mentioned the system tray. Thats part of what confused me.
    oh, this one doesn't but double clicking the second window is like double clicking the tray icon which should be pretty much the same, atleast it reproduces the problem exactly the same.. :P

    sorry for not explaining things

  4. #19
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    i have found a way to make it work good using the SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0); line of code in double click events..

    Code:
    void CTEST2Dlg::OnLButtonDblClk(UINT nFlags, CPoint point) 
    {
    	((CTESTDlg*)m_parent)->ShowWindow(SW_RESTORE);
    	((CTESTDlg*)m_parent)->SetCapture(); //solution <-
    	((CTESTDlg*)m_parent)->SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0);
    	ReleaseCapture(); //solution <-
    	DestroyWindow();
    	CDialog::OnLButtonDblClk(nFlags, point);
    }
    please get the test project again to test my solution if you want.. please rename it to TEST.zip..

    can there be any "side effects" by using my code?

    also can there be a better way to do this? this problem seems to happen ONLY when you click the Close menu from the taskbar from the window when it is minimized, i just don't understand why.. i even handled WM_SYSCOMMAND looking for SC_CLOSE hiding the dialog from there.. and it still didn't solve anything..

    you can also remove the 2 lines of code commented with "//solution <-" to see what happens without them..

    thanks
    Attached Files Attached Files

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21