Setting Focus in Dialog

This is a discussion on Setting Focus in Dialog within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I have a custom control that can only be set as the first window to receive messages (from keyboard, ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    81

    Setting Focus in Dialog

    Hello, I have a custom control that can only be set as the first window to receive messages (from keyboard, mouse, etc...) using the "tabstop" feature. So if I set the custom control to be tabstopable then I can switch which custom control window receives the messages.

    I think this is unintuitive for a user of the application, and I'd like it to be so that if a user clicks on my custom control it will active it as the "main window for receiving messages" so that when the mousewheel is moved and keyboard presses happen it gets the messages.

    This is a dialog application. (control sits inside a dialog window)


    My question is just... how do i do what tabstop is doing to set the window?

    I've tried SetActiveWindow() SetFocus() SetForegroundWindow()... nothing seems to work

    EDIT: I should mention I am working with the Win32 API.
    Last edited by keira; 01-21-2009 at 09:31 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Setting a control to have startup focus
    By bennyandthejets in forum C# Programming
    Replies: 1
    Last Post: 09-19-2004, 10:14 PM
  3. Setting focus
    By tyouk in forum Windows Programming
    Replies: 10
    Last Post: 11-04-2003, 11:12 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM
  5. setting focus on a dialog box control
    By face_master in forum Windows Programming
    Replies: 2
    Last Post: 05-14-2002, 05:11 PM

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