GetWindowPlacement() trouble

This is a discussion on GetWindowPlacement() trouble within the Windows Programming forums, part of the Platform Specific Boards category; Hi! This code is not working properly: Code: VOID CALLBACK TimerProcSTMenuItAddRem(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime) { WINDOWPLACEMENT wp; wp.length = ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    365

    GetWindowPlacement() trouble

    Hi!
    This code is not working properly:

    Code:
    VOID CALLBACK TimerProcSTMenuItAddRem(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
    {
    	WINDOWPLACEMENT wp;
    	wp.length = sizeof(WINDOWPLACEMENT);
    	GetWindowPlacement(hwndGL, &wp);
    	if(wp.showCmd==SW_HIDE)
      	  MessageBox(NULL,"SW_HIDE",NULL,MB_OK);
    }
    No matter what the window state, wp.showCmd always returns 1.
    Please Help.

    Thanx.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  2. #2
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    FROM MSDN:

    If the window identified by the hWnd parameter is maximized, the showCmd member is SW_SHOWMAXIMIZED. If the window is minimized, showCmd is SW_SHOWMINIMIZED. Otherwise, it is SW_SHOWNORMAL.
    So I am guess it doesn't report SW_HIDE

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,674
    There's IsWindowVisible().

    Let us know what you're trying to accomplish if you still need assistance.

    gg

  4. #4
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    365
    Thanx guys, it went ok with IsWindowVisible().
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble with assignment in C
    By mohanlon in forum C Programming
    Replies: 17
    Last Post: 06-23-2009, 10:44 AM
  2. Replies: 6
    Last Post: 01-03-2007, 02:02 PM
  3. Is it so trouble?
    By Yumin in forum Tech Board
    Replies: 4
    Last Post: 01-30-2006, 03:10 PM
  4. trouble scanning in... and link listing
    By panfilero in forum C Programming
    Replies: 14
    Last Post: 11-21-2005, 11:58 AM
  5. C++ program trouble
    By senrab in forum C++ Programming
    Replies: 7
    Last Post: 04-29-2003, 11:55 PM

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