Hi,
How i return text selected in a window ?
hWnd:= FindWindow(,"Mozilla FireFox")
SendMessage(hWnd, EM_GETSELTEXT, 0, 0)
i wanna return "_text this string "
Someone can help me ?
Thanks so much.
local cBuffer := Space( 1000 )
hWnd := FindWindow(,"Mozilla FireFox")
SendMessage( hWnd, EM_GETSELTEXT, 0, @cBuffer )
#include "Fivewin.ch"
Function main()
public oWnd
define window ownd
activate window ownd On Right Click Get()
return nil
Function Get()
local hWnd, cRet
hWnd:= FindWindow(,"Mozilla FireFox")
cRet = GetSelectedStringByHandle( hWnd )
msginfo(cRet,"Retorno")
return
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
#define GETSELTEXT 1086
HB_FUNC( GETSELECTEDSTRINGBYHANDLE )
{
HWND hWndCtrl = hb_parnl( 1 );
CHAR cBuffer[1000];
SendMessage( hWndCtrl, GETSELTEXT, 0, &cBuffer );
hb_retc( cBuffer );
}
#pragma ENDDUMP
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
obj\DEMO.c:
Error E2349 DEMO.PRG 29: Nonportable pointer conversion in function HB_FUN_GETSELECTEDSTRINGBYHANDLE
Error E2342 DEMO.PRG 31: Type mismatch in parameter 'lParam' (wanted 'long', got 'signed char ( *)[1000]') in function HB_FUN_GETSELECTEDSTRINGBYHANDLE
*** 2 errors in Compile ***
Done.
Deleting: "obj\DEMO.c"
Done.
Antonio Linares wrote:The name of an array is its address
sizeof( cBuffer )
nageswaragunupudi wrote:sizeof is operator, not a function.
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( GSELECTED )
{
HWND hWndCtrl = (HWND) hb_parnl( 1 );
CHAR cBuffer[1000];
SendMessage( hWndCtrl, 1086, 0, (LONG) cBuffer );
hb_retc( cBuffer );
}
#pragma ENDDUMP
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Silvio.Falconi and 106 guests