Thread: Updating properties on "active x control pad" created label

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    1

    Updating properties on "active x control pad" created label

    Hi

    Building my kinda first real windows desktop application an need some help.

    I have been creating a window with a label which I want to blink simply by using a timer and alter the label's Visible property each timer tick.

    Most things works as expected but I do not find any methode of altering the Visible property of the label. I have searched MSDN and googlefor help but with all the flavours of developement tools available I do not find any tip that solves this for me.

    I am old fashion and uses C and what is called Auto C to create my applications. You may google that up if you like but I think the source created is the same as for all tools creating c - based code for creating windows apps.

    Nevertheless, even though the code below is not working it shows my intentions pretty well I think.

    Code:
    		case WM_TIMER: 
    		    switch (wParam) 
    		    { 
    		        case IDT_TIMER1: // 1000ms timer
    		        	
    		        	// Update Statuslabel
    		        	hWndChild = GetDlgItem(hWndParent, StatusLabel);
    		        	if (ToggleStatusLabel)
    		        		StatusLabel.Visible = !StatusLabel.Visible;
    		        	else
    		        		StatusLabel.Visible = TRUE;
    		        		        
    		        	break;
    		    }
    		    break;
    The timer is set to one sec intervall and works as expected.
    My label is named StatusLabel, but since this is not C# or C++ I can not use the item as shown in my code since the entity "StatusLabel" is not a struct nor an object, just a simple define.

    As you see I make a call to GetDlgItem(). This is a hint to what I think is what I need to do, i.e. get a handle and use this to set the wanted property, "Visible" in this case, through some nifty function calls. Question is which??


    Breg
    Vidar

  2. #2
    Registered User
    Join Date
    Dec 2010
    Location
    Trinidad, CO (log cabin in middle of nowhere)
    Posts
    148
    Use the ShowWindow() function to change the visibility of any window from visible to hidden. The #defines are SW_SHOWWINDOW and SW_HIDE.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 12-08-2014, 08:12 PM
  2. Windows server 2003 "No active mixer device found"
    By drdodirty2002 in forum Tech Board
    Replies: 1
    Last Post: 01-13-2006, 11:25 AM
  3. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 08:25 AM
  4. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 07:59 AM
  5. changing "active" dir
    By Shadow in forum C Programming
    Replies: 4
    Last Post: 04-23-2002, 10:47 AM