Highlight the words
-
Hi, I have dialog window in which I have a list box which contains file name as items, all these files are text files which open by default by note pad. Along with the file name I have some offsets (location of some words in the text file), till now I have finished just opening a file I want to know is there anyway in VC++ that we can open the file and highlight those words after file opening? I want to highlight the words in notepad or I can create a new dialog where I can display the contents of the file and highlight the words …can u please give me some information how to proceed with this work … Regards, Vinay Charan.
-
Hi, I have dialog window in which I have a list box which contains file name as items, all these files are text files which open by default by note pad. Along with the file name I have some offsets (location of some words in the text file), till now I have finished just opening a file I want to know is there anyway in VC++ that we can open the file and highlight those words after file opening? I want to highlight the words in notepad or I can create a new dialog where I can display the contents of the file and highlight the words …can u please give me some information how to proceed with this work … Regards, Vinay Charan.
I think you want to search in file_**
**_
whitesky
-
I think you want to search in file_**
**_
whitesky
-
I think you want to search in file_**
**_
whitesky
Hi WhiteSky, Thanks for the reply.... I dont want to search in the file.. I just want to Highlight the words which are present along with the file name Data which i have is filename & offsets (200,340,450,700 location of the words) now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
-
Hi, I have dialog window in which I have a list box which contains file name as items, all these files are text files which open by default by note pad. Along with the file name I have some offsets (location of some words in the text file), till now I have finished just opening a file I want to know is there anyway in VC++ that we can open the file and highlight those words after file opening? I want to highlight the words in notepad or I can create a new dialog where I can display the contents of the file and highlight the words …can u please give me some information how to proceed with this work … Regards, Vinay Charan.
You could probably read the file into CRichEditCtrl, loop through each of your words and highlight them (make them bold, change the color, etc.) using the SetSel and SetSelectionCharFormat functions. I don't have an example, just an idea you might be able to look into....
- S 50 cups of coffee and you know it's on!
-
Hi WhiteSky, Thanks for the reply.... I dont want to search in the file.. I just want to Highlight the words which are present along with the file name Data which i have is filename & offsets (200,340,450,700 location of the words) now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
Vinay wrote:
I just want to Highlight the words which are present along with the file name Data which i have is filename & offsets (200,340,450,700 location of the words) now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
You may required hooking of the NOTEPAD.exe Application so that you can explicitly highlight the words from other application. Because you are using ShellExecute() for opening files where you never get the Handle of the opened file. Other way is to Use the RichEditCtrl and open the file using CFile or CStdioFile and put the contents into that RichEditCtrl and do whatever you want, as it is in your application scope..:) Knock out 't' from can't, You can if you think you can :cool:
-
Vinay wrote:
I just want to Highlight the words which are present along with the file name Data which i have is filename & offsets (200,340,450,700 location of the words) now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
You may required hooking of the NOTEPAD.exe Application so that you can explicitly highlight the words from other application. Because you are using ShellExecute() for opening files where you never get the Handle of the opened file. Other way is to Use the RichEditCtrl and open the file using CFile or CStdioFile and put the contents into that RichEditCtrl and do whatever you want, as it is in your application scope..:) Knock out 't' from can't, You can if you think you can :cool:
-
Hi Laxman, When i add Rich Edit control i am getting run time error (VC++ Debug Library error) can u please tell what will the cause ...
vinaycool wrote:
When i add Rich Edit control i am getting run time error (VC++ Debug Library error) can u please tell what will the cause ...
use following in InitInstance of the application AfxInitRichEdit (); Knock out 't' from can't, You can if you think you can :cool:
-
Vinay wrote:
I just want to Highlight the words which are present along with the file name Data which i have is filename & offsets (200,340,450,700 location of the words) now i have open the file and i have to Highlight the words its there any way i can complete this task in VC++ ??
You may required hooking of the NOTEPAD.exe Application so that you can explicitly highlight the words from other application. Because you are using ShellExecute() for opening files where you never get the Handle of the opened file. Other way is to Use the RichEditCtrl and open the file using CFile or CStdioFile and put the contents into that RichEditCtrl and do whatever you want, as it is in your application scope..:) Knock out 't' from can't, You can if you think you can :cool: