Thread: Clicking a greyed out command button

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    5

    Clicking a greyed out command button

    Okay I have a button that disables on mouse over, then reneables when it's moved away. I'v tried doing it this way:

    Code:
    {
    HWND hWndProSpam;
    HWND hWndButton;
    hWndProSpam = FindWindowEx(NULL, NULL, "ThunderRT6FormDC", "Pro Spam 1");
    hWndProSpam = Findwindow
    hWndButton = FindWindowEx(hWndProSpam, NULL, "ThunderRT6CommandButton", NULL);
    EnableWindow(hWndProSpam, 1);
    EnableWindow(hWndButton, 1);
    SendMessage(hWndButton, WM_LBUTTONDOWN, NULL, NULL);
    SendMessage(hWndButton, WM_LBUTTONUP, NULL, NULL);
    
    	return 0;
    }
    But I guess you would have to go way much deeper than using that.

    Someone told me I need to find the EXE name, Handle, buttoname, and to send a click using windows messeges. Any help?

  2. #2
    Registered User
    Join Date
    Jul 2005
    Posts
    69
    I'm not sure if this will help but it might: BM_CLICK
    Regards,
    Brian

  3. #3
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    So what you are saying is that you have a program that you didn't write/or have the source code and it has a button that disables itself when you move the mouse over it?

    Well... your method should work if it doesn't run till after you posistion the mouse over said button, because the second you move the mouse, it will probably disable the button again. Alternatively, you can try tabbing to the button. I have seen those "joke" windows where the buttons move when you try to click on them...tabbing to them and then hitting space bar always worked

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    do a search for his posts and you'd find something interesting: http://cboard.cprogramming.com/searc...earchid=194959
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Clicking in regions.
    By harmony_krieg in forum Windows Programming
    Replies: 3
    Last Post: 09-26-2007, 03:05 PM
  2. PC makes clicking noise - now won't start up
    By hk_mp5kpdw in forum Tech Board
    Replies: 9
    Last Post: 09-25-2007, 11:34 PM
  3. Programmically simulate clicking on webbrowser2 object
    By hanhao in forum Windows Programming
    Replies: 1
    Last Post: 06-25-2007, 01:19 PM
  4. Programmically simulate clicking on webbrowser2 object
    By hanhao in forum Windows Programming
    Replies: 1
    Last Post: 06-24-2007, 10:34 PM
  5. Automatic clicking
    By gustavosserra in forum C++ Programming
    Replies: 3
    Last Post: 12-07-2004, 08:25 PM