The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Share this post

Link to post

Share on other sites

Valik 471

Valik 471

DllCall()'ing SendMessage is going to block, too. You need to use SendMessageTimeout(). Also, what is 0x14D? Will you remember what it is in a day? A week? Define a constant with a symbolic name (For your sanity, it should be the same as the Windows API constant), otherwise, 0x14D is just a magic number which might mean anything.

Share this post

Link to post

Share on other sites

Shibuya 0

Shibuya 0

DllCall()'ing SendMessage is going to block, too. You need to use SendMessageTimeout(). Also, what is 0x14D? Will you remember what it is in a day? A week? Define a constant with a symbolic name (For your sanity, it should be the same as the Windows API constant), otherwise, 0x14D is just a magic number which might mean anything.

oops, sorry

didn't meant to post a brain teaser or any of the sorts

I just took a snippet out of gafrost's code to use, which I replaced the initial constant declaration with 0x14D

anyway, this is gafrost's original code where I took the snippet from:

;===============================================================================
;
; Description: _GUICtrlComboSelectString
; Parameter(s): $h_combobox - controlID
; $i_index - Specifies the zero-based index of the item preceding the first item to be searched
; $s_search - String that contains the characters for which to search
; Requirement: None
; Return Value(s): If the string is found, the return value is the index of the selected item.
; If the search is unsuccessful, the return value is $CB_ERR and the current selection is not changed
; User CallTip: _GUICtrlComboSelectString($h_combobox, $i_index, $s_search) Search the list of a combo box for an item that begins with the characters in a specified string (required: <GuiCombo.au3>)
; Author(s): Gary Frost (custompcs@charter.net)
; Note(s): When the search reaches the bottom of the list, it continues from the top
; of the list back to the item specified by the wParam parameter.
; If $i_index is 1, the entire list is searched from the beginning
; A string is selected only if the characters from the starting point
; match the characters in the prefix string
;
;===============================================================================
Func _GUICtrlComboSelectString($h_combobox, $i_index, $s_search)
If IsHWnd($h_combobox) Then
Local $a_ret = DllCall("user32.dll", "int", "SendMessage", "hwnd", $h_combobox, "int", $CB_SELECTSTRING, "int", $i_index, "str", $s_search)
Return $a_ret[0]
Else
Return GUICtrlSendMsg($h_combobox, $CB_SELECTSTRING, $i_index, $s_search)
EndIf
EndFunc ;==>_GUICtrlComboSelectString

where $CB_SELECTSTRING is declared as:

Global Const $CB_SELECTSTRING = 0x14D

my apologies again

anyway, gafrost's code did work partially for me.

it selects the combobox, but didn't bring up the pop-up box

I was thinking that maybe sending a ascii character/command to the control could bring up the pop-up box?

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Share this post

Link to post

Share on other sites

Shibuya 0

Shibuya 0

Sad to say I don't know anything about API and DLLs and all these seems pretty hard to understand for me.

As I knew absolutely nothing about this API and DLL thing, I thought I'd research and study abit more before asking for more info, to help my understanding.

From the tiny bits of info I've gathered up to now and after reading Valik's reply for the second time, I think what Valik meant is that the DLL command used in "ControCommand - SelectString" is similar to gafrost's DLL call command.

I understand Valik's point that SendMessage() would still block my intended script execution, but I want to figure out what's the difference between the DLL command used in "ControCommand - SelectString" from gafrost's, which makes it able to bring up the pop-up dialog?

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"