flat assembler
Message board for the users of flat assembler.

Index > Windows > Combo box

Author
Thread Post new topic Reply to topic
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 19 Jul 2008, 20:22
Does anyone know why when send this message to combo box
Code:
invoke  SendMessage,[hwnd_cb],CB_SETCURSEL,0,0
    

It works as it should (eg: selects the index value in the list box and shows it in the box,) but it does not highlight it, as in change the background to dark and string to light.
Does anyone know how to make it do this ?.
Post 19 Jul 2008, 20:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 19 Jul 2008, 20:41
Maybe CB_SELECTSTRING.
Quote:
An application sends a CB_SELECTSTRING message to search the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control.
Post 19 Jul 2008, 20:41
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 20 Jul 2008, 00:42
That displays it the same as "CB_SETCURSEL", but thank anyway revolution.
Post 20 Jul 2008, 00:42
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 20 Jul 2008, 06:10
A bit more effort, but you could make your own version combo box by combining the list and edit boxes with your own wrapper.
Post 20 Jul 2008, 06:10
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 20 Jul 2008, 12:59
revolution wrote:
A bit more effort, but you could make your own version combo box by combining the list and edit boxes with your own wrapper.

That what i was thinking about doing, But now i have decide to leave it as it is (showing, but with no dark background), as its only cosmetic, as it is still highlighted as far as the program goes, as "CB_GETCURSEL" returns the right index.
Post 20 Jul 2008, 12:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 20 Jul 2008, 13:31
You could try sending (SendMessage/PostMessage) a right arrow keypress (WM_KEYDOWN/WM_KEYUP) to the combo box. I haven't tried it, but I noticed that with Windows Explorer the selected item can be highlighted by manually pressing the right arrow key.
Post 20 Jul 2008, 13:31
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 295
Alphonso 20 Jul 2008, 15:49
Not really sure if this is what you want or if it's the proper way to do it.
Code:
invoke  SendMessage,[hwnd_cb],CB_SETCURSEL,0,0
invoke  SetFocus,[hwnd_cb]    
Post 20 Jul 2008, 15:49
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 22 Jul 2008, 02:33
Thanks for both your inputs, the "invoke SetFocus,[hwnd_cb]" worked.
So i did not try the "(SendMessage/PostMessage) a right arrow keypress (WM_KEYDOWN/WM_KEYUP) to the combo box".
Post 22 Jul 2008, 02:33
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.