<Windows.h> SendMessage Help

SendMessage(hWnd, WM_SETTEXT, NULL, (LPARAM)L"xyz");

hello how does it look like i mean send message parameters when i want to sent something that is stored in any varibale e.g

cin>>link;

SendMessage(hWnd,link,etc...)

it doesnot work when i enter link there.
link is string variable

Second parameter is of UINT type. You cannot pass something else to it.

If you meant to pass it as fourth parameter, you should consider following:

1) AFAIR WM_SETTEXT expects a wide string (and L in your example confirms it) so you should use std::wstring instead.
2) Function expect c-string, so you need to pass results of .c_str() function
1
2
3
std::wstring link;
std::wcin >> link;
SendMessage(hWnd, WM_SETTEXT, NULL, (LPARAM)(link.c_str()));
minipaa and for example i want to send that input to google chrome and also into text field that is in www.google.com

how do i code that ? i want my program to copy that string into searching field on google site.
Unless program itself is not made to handle that, you cannot do anything. (Chrome can do that, google "chrome extensions creation"; for example https://developer.chrome.com/extensions/getstarted )

Another way is to sumulate input events to click on address bar and write your request here.

And another one is to just generate URL and open it in chrome, like
LONG r = ShellExecute(NULL, "open", "http://www.google.com/search?q=How+to+search", NULL, NULL, SW_SHOWNORMAL);
http://googlesystem.blogspot.ru/2013/02/the-shortest-google-search-urls.html
and minipaa one more thing pls the shellexecute parameter SW_MINIMIZE looks like it doesnot work atall it start webpage but mozilla is not on toolbar i want to start page and not opening mozilla outof toolbar... whats up
SW_MINIMIZE is intended to be used on already existing windows. Use SW_SHOWMINIMIZED
Topic archived. No new replies allowed.