cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
heko_76
Level 4

Default focus on Buttons

Hi,

I would like to know how to set default focus on buttons. I have created custom dialogs in a install script project.it seems to focus the first time dialog is loaded and later it does not focus.Any help appreciated....

I am using Installshield professional 2008 edition.Is there a issue with Windows Vista as i feel its proper on WIndows XP...
Has anybody come across such an issue...
Labels (1)
0 Kudos
(4) Replies
MarkEarle
Level 6

heko,

I have not come up on this issue in Vista or any other OS that I install on. You could try the following.

_WinSubFocusControl( hWnd, nBtnId );
This function sets the input focus to the given child window. All subsequent keyboard input is directed to this child window. The child window, if any, that previously had the input focus loses it.

or

_WinSubFocusWindow( hWnd );
This function sets the input focus to the given window. All subsequent keyboard input is directed to this window. The window, if any, that previously had the input focus loses it.

I have used the _WinSubFocusWindow(); function in my custom dialogs in the past with good effect. I think the _WinSubFocusControl(); may be the one you need to use.

To get to these calls;
#include winsub.h

Hope it helps,

ME
0 Kudos
heko_76
Level 4

Hi mark,

thanks for the information i will definitely try and let u know


MarkEarle wrote:
heko,

I have not come up on this issue in Vista or any other OS that I install on. You could try the following.

_WinSubFocusControl( hWnd, nBtnId );
This function sets the input focus to the given child window. All subsequent keyboard input is directed to this child window. The child window, if any, that previously had the input focus loses it.

or

_WinSubFocusWindow( hWnd );
This function sets the input focus to the given window. All subsequent keyboard input is directed to this window. The window, if any, that previously had the input focus loses it.

I have used the _WinSubFocusWindow(); function in my custom dialogs in the past with good effect. I think the _WinSubFocusControl(); may be the one you need to use.

To get to these calls;
#include winsub.h

Hope it helps,

ME
0 Kudos
AshishBhatt
Level 3

Thanks,

_WinSubFocusWindow( dlgItem );

this really works... 🙂
0 Kudos
MarkEarle
Level 6

Glad it worked. 🙂
0 Kudos