static void Child_Web(HWND __hWnd)
{
register LPEDITOR _lpEditor ;
LPSTR _lpszTmp ;
int _iNumBytes ;
DWORD _dwTmp ;
CHARRANGE _Cr, _CharRange,*_lpCharRange ;
char _szSelection[1024] ;
char _szTmp[1024] ;
GETTEXTEX _Gte,*_lpGte ;
_lpEditor = (LPEDITOR) GetWindowLongPtr(__hWnd,GWLP_USERDATA) ;
if(!_lpEditor) return ;
SendMessage(_lpEditor->hEdit,EM_GETSEL,(WPARAM) &_Cr.cpMin,(LPARAM) &_Cr.cpMax) ;
if(_Cr.cpMin == _Cr.cpMax)
{
_dwTmp = sizeof(_szSelection) ;
AssocQueryString(0,ASSOCSTR_EXECUTABLE,".htm","open",_szSelection,&_dwTmp) ;
_lpszTmp = _szTmp ;
sqlite3_snprintf(sizeof(_szTmp),_lpszTmp,"\"%s\"",_szSelection) ;
WinExec(_lpszTmp,SW_SHOWMAXIMIZED) ;
return ;
}
_lpCharRange = &_CharRange ;
_lpGte = &_Gte ;
_lpCharRange->cpMin = 0 ;
_lpCharRange->cpMax = 0 ;
SendMessage(_lpEditor->hEdit,EM_EXGETSEL,0,(LPARAM) _lpCharRange) ;
_iNumBytes = _lpCharRange->cpMax - _lpCharRange->cpMin ;
if(_iNumBytes == 0) return ;
_lpGte->cb = _iNumBytes ;
_lpGte->flags = GT_SELECTION ;
_lpGte->codepage = CP_ACP ;
_lpGte->lpDefaultChar = NULL ;
_lpGte->lpUsedDefChar = NULL ;
SendMessage(_lpEditor->hEdit,EM_GETSELTEXT,(WPARAM) _lpGte,(LPARAM) szGlobalBufferW) ;
WideCharToMultiByte(CP_ACP,WC_NO_BEST_FIT_CHARS,(const wchar_t *) szGlobalBufferW,-1,szGlobalBufferA,_iNumBytes,NULL,NULL) ;
SendMessage(_lpEditor->hEdit,EM_REPLACESEL,TRUE,(LPARAM) szGlobalBufferA) ;
_dwTmp = sizeof(_szSelection) ;
AssocQueryString(0,ASSOCSTR_EXECUTABLE,".htm","open",_szSelection,&_dwTmp) ;
_lpszTmp = _szTmp ;
sqlite3_snprintf(sizeof(_szTmp),_lpszTmp,"\"%s\"\"https://www.google.com/search?q=%s\"",_szSelection,szGlobalBufferA) ;
WinExec(_lpszTmp,SW_SHOWMAXIMIZED) ;
return ;
}
OR
MOV RCX,RDI
CALL PathFindExtensionA ; Get the file extension
MOV R8,RAX
MOV _dwTmp,SIZEOF _szTmp
XOR RCX,RCX
MOV RDX,ASSOCF_OPEN_BYEXENAME
MOV R9,OFFSET szVerb_Open
MOV [RSP + 20h],RSI
LEA RAX,_dwTmp
MOV [RSP + 28h],RAX
CALL AssocQueryStringA Get the file associated with the extension
MOV RCX,SIZEOF _szExec
LEA RDX,_szExec
MOV R8,OFFSET szFmt_FindFiles_Exec
MOV R9,RSI
MOV RAX,RDI
MOV [RSP + 20h],RAX
CALL sqlite3_snprintf ; Format the string to execute
LEA RCX,_szExec
MOV EDX,SW_NORMAL
CALL WinExec ; Launch the program with the file in parameter
char szFmt_FindFiles_Exec[] = "\"%s\" \"%s\"" ;
szVerb_Open BYTE "open",0
If that can help you