Re: [2008] Api Wm_settext
I assume your question is how do i click a button using sendMessage
there are two ways,
1. Sending WM_LBUTTON Down
2. Sending a BM_CLICK
Code:
SendMessage(buttonHnd, BM_CLICK, 0,0)
Re: [2008] Api Wm_settext
What if I want to click a popup menu and select something on it... what would that use?
Re: [2008] Api Wm_settext
Quote:
Originally Posted by Fazi
I assume your question is how do i click a button using sendMessage
there are two ways,
1. Sending WM_LBUTTON Down
2. Sending a BM_CLICK
Code:
SendMessage(buttonHnd, BM_CLICK, 0,0)
Fazi, if the Button you want to click is already selected (the default) that code alone won't actually click the button but will only highlight it.
To test, lets say one VB program launches this,
rsp = MsgBox("Copy all files?", vbYesNo + vbDefaultButton1, "Copy All?")
Now in the other VB program tell it to click the "Yes" button (which is the selected/default) , notice the button will only get highlighted and not clicked!
Here's the fix,
Code:
SendMessage buttonHnd, WM_ACTIVATE, WA_ACTIVE, 0
SendMessage buttonHnd, BM_CLICK, 0, 0
hope that helps someone, it drove me nuts for a long time. ;)
Re: [2008] Api Wm_settext
Thanks Edgemel for the useful tips,
i got very useful informations from your last few post in various threads. but i cold not rate you coz "Spread some points to some one else before give it to edgemel" it says.
Need to find a JS code to unlock this limitation :D
Re: [2008] Api Wm_settext
RedGunner, thanks for your post, helped me a bit.
Are there any wMsg parameters for appending text to the hWnd?
Re: [2008] Api Wm_settext
Quote:
Originally Posted by forcumang
RedGunner, thanks for your post, helped me a bit.
Are there any wMsg parameters for appending text to the hWnd?
forcumang, it would be better if you will start a thread of yours so the responses would be directed to you. I am not sure about appending but I using WM_GETTEXT to get the current text should be one option, after you have received the current text then you could just append a text to it then use WM_SETTEXT.
Re: [2008] Api Wm_settext
Quote:
Originally Posted by dee-u
forcumang, it would be better if you will start a thread of yours so the responses would be directed to you. I am not sure about appending but I using WM_GETTEXT to get the current text should be one option, after you have received the current text then you could just append a text to it then use WM_SETTEXT.
perfect, thanks