XP Accelerators and Focus Rects
-
I want to use SendMessage to send a WM_UPDATEUISTATE message that I hope will show the focus rectangle on option buttons but I cannot find the constant values for the expected wParam values: UIS_CLEAR, UIS_INITIALIZE, UIS_SET, UISF_HIDEACCEL, UISF_HIDEFOCUS, UISF_ACTIVE. I know that I can change a setting in the Control Panel (Display - Appearance - Effects) but I want to be able to control this programmatically. Any ideas?
-
I want to use SendMessage to send a WM_UPDATEUISTATE message that I hope will show the focus rectangle on option buttons but I cannot find the constant values for the expected wParam values: UIS_CLEAR, UIS_INITIALIZE, UIS_SET, UISF_HIDEACCEL, UISF_HIDEFOCUS, UISF_ACTIVE. I know that I can change a setting in the Control Panel (Display - Appearance - Effects) but I want to be able to control this programmatically. Any ideas?
If I read this right, you just want to move the input focus to a button control. In VB.NET, that's easy:
controlName.Focus()
will set the focus to that control. BUT!! (There's always one of these!) Long version: A control cannot receive focus unless it is enabled, is visible, AND HAS A WINDOW HANDLE ASSIGNED TO IT! What this means is, you can only set the focus to the control AFTER it has actually been created and it's Message Loop is up and running. Short version: If you try and set the focus to a control in a Form's Load event, you must first Show() the form, THEN set the focus to the control. Otherwise it won't work. RageInTheMachine9532
-
If I read this right, you just want to move the input focus to a button control. In VB.NET, that's easy:
controlName.Focus()
will set the focus to that control. BUT!! (There's always one of these!) Long version: A control cannot receive focus unless it is enabled, is visible, AND HAS A WINDOW HANDLE ASSIGNED TO IT! What this means is, you can only set the focus to the control AFTER it has actually been created and it's Message Loop is up and running. Short version: If you try and set the focus to a control in a Form's Load event, you must first Show() the form, THEN set the focus to the control. Otherwise it won't work. RageInTheMachine9532
RageInTheMachine9532 wrote: you just want to move the input focus to a button control Thanks for the reply, but no. What I want to do is tell Windows to show a focus rectangle around the text of a button that has input focus. By default in XP it does not. Also, I am using VB6, not .Net. If you search MSDN for the WM_CHANGEUISTATE Message you'll see exactly what I'm talking about. On the other hand, if you have .Net and you search your local help file for the UIS_ and UISF_ constants specified in this tread's header, might you be able to tell me the numeric value of these constants? For example, I know that... WM_CHANGEUISTATE = 295 (H&0127) WM_UPDATEUISTATE = 296 (H&0128) WM_QUERYUISTATE = 297 (H&0129) ...but I do not know the value for these other constants and they are not known by VB6 because it pre-dates their use in the operating system (beginning with Win2000).
-
RageInTheMachine9532 wrote: you just want to move the input focus to a button control Thanks for the reply, but no. What I want to do is tell Windows to show a focus rectangle around the text of a button that has input focus. By default in XP it does not. Also, I am using VB6, not .Net. If you search MSDN for the WM_CHANGEUISTATE Message you'll see exactly what I'm talking about. On the other hand, if you have .Net and you search your local help file for the UIS_ and UISF_ constants specified in this tread's header, might you be able to tell me the numeric value of these constants? For example, I know that... WM_CHANGEUISTATE = 295 (H&0127) WM_UPDATEUISTATE = 296 (H&0128) WM_QUERYUISTATE = 297 (H&0129) ...but I do not know the value for these other constants and they are not known by VB6 because it pre-dates their use in the operating system (beginning with Win2000).
OK. I think I understand what your trying to do now. I found the constants in WinUser.h in the VC98\Include folder. Here is the copy/paste:
/*
* LOWORD(wParam) values in WM_*UISTATE*
*/
#define UIS_SET 1
#define UIS_CLEAR 2
#define UIS_INITIALIZE 3/*
* HIWORD(wParam) values in WM_*UISTATE*
*/
#define UISF_HIDEFOCUS 0x1
#define UISF_HIDEACCEL 0x2
#if(_WIN32_WINNT >= 0x0501)
#define UISF_ACTIVE 0x4
#endif /* _WIN32_WINNT >= 0x0501 */
#endif /* _WIN32_WINNT >= 0x0500 */
#endifRageInTheMachine9532
-
OK. I think I understand what your trying to do now. I found the constants in WinUser.h in the VC98\Include folder. Here is the copy/paste:
/*
* LOWORD(wParam) values in WM_*UISTATE*
*/
#define UIS_SET 1
#define UIS_CLEAR 2
#define UIS_INITIALIZE 3/*
* HIWORD(wParam) values in WM_*UISTATE*
*/
#define UISF_HIDEFOCUS 0x1
#define UISF_HIDEACCEL 0x2
#if(_WIN32_WINNT >= 0x0501)
#define UISF_ACTIVE 0x4
#endif /* _WIN32_WINNT >= 0x0501 */
#endif /* _WIN32_WINNT >= 0x0500 */
#endifRageInTheMachine9532
Rage, Thanks a bunch. That is exactly what I was looking for. Unfortunately, my winuser.h file does NOT include these constants and frankly I don't know why (VB6 Enterprise). I'll track that issue down next. :)
-
Rage, Thanks a bunch. That is exactly what I was looking for. Unfortunately, my winuser.h file does NOT include these constants and frankly I don't know why (VB6 Enterprise). I'll track that issue down next. :)
Puchinello wrote: Unfortunately, my winuser.h file does NOT include these constants and frankly I don't know why Download the latest Platform SDK. ;)
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi -
Puchinello wrote: Unfortunately, my winuser.h file does NOT include these constants and frankly I don't know why Download the latest Platform SDK. ;)
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma GandhiGood gumba gumba! The whole SDK will take over 10 hours to download on my 56K! I'll spring 10 bucks for the CD by mail. Thanks for the insight! :-D