LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse pointer text file

Hi ,

 

I need to programatically open the Note pad and move the mouse pointer to the specified location .

 

- I was able to open the Note pad programatically ,But i am unable to move the mouse pointer to the specified location ,

 

Please tell me how to do this this is very urgently required .

0 Kudos
Message 1 of 9
(3,746 Views)

Hi prithviraj

 

I'm assuming you are on a Winodws OS. To change the mouse pointer location you call the functions SetCursorPos and ClientToScreen located in user32.dll. You can call dlls from LabVIEW using Call Library Function nodes. What parameters to call the functions with can be found on MSDN and a lot of examples in textbased code can be found by googling "move mouse pointer programmatically".

 

Best Regards

 

David

NISW

0 Kudos
Message 2 of 9
(3,738 Views)

i feel i need to give more information for my question ,

 

below is the notepad snap shot attached , here the coursor is pointing to the first position , i need to move it progrmatically to my desited position ,

 

thanks in  advance ,

0 Kudos
Message 3 of 9
(3,720 Views)

sorry i didnt send the attachment , please see the attachment in this mail

0 Kudos
Message 4 of 9
(3,718 Views)

Hi prithviraj,

 

no snapshot...

Edit: Now you added a snapshot - and even without downloading it I know it's a BMP renamed to JPG... DON'T DO THAT! Use Paint to convert your pic to a real JPG!

 

I don't think Notepad is providing an interface to control it from other programs. But you can get the window position, move the mouse to the correct position and simulate a mouseclick - all using Windows functions like mentioned above Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 9
(3,711 Views)

Hi prithviraj

 

What are you trying to accomplish with the textfile? The position to move to in notepad will be very difficult to obtain since it depends on many different factors, such as font size, position of windows etc. If you are certain of the all factors the solution with moving the mouse and clicking works, but if the endresult is to have the user select one line or someting it will be much easier to read file into LabVIEW and let them choose there. So what are you after?

 

Best Regards

 

David

0 Kudos
Message 6 of 9
(3,699 Views)

Hi David ,

 

what you are saying is right . user inputs the line number depending on the line number the cursor should be moved to that position of the text file , is this possible to do , if yes kindly send me the code , or else ways to do .

 

kindly reply urgently

 

Best Regards,

Prithviraj

0 Kudos
Message 7 of 9
(3,659 Views)

Hi Prithviraj

 

Please explain a bit more what you want the code to do. Do you to use the text inside your VI? Do you want to let the user edit the in the file? Would an exceptable solution be to read the data into the VI, have the user select the row on the frontpanel, do some edits and then write the data back to the textfile?

 

Best Regards

 

David

0 Kudos
Message 8 of 9
(3,639 Views)
Hi ,
 
Firstly tanks for ur link
 
i am attaching a code with this mail , here you need to give a .txt file and the line number to be high lighted , then the mouse coursor goes to the particular line ,
 
my question is if i have already opened a file , if i run once again another same file will be opened , i need to know hoe to check whether file is already opened or not if it is opened then the mouse course has to go to the new line , if it is not then the file has to be opened  
0 Kudos
Message 9 of 9
(3,611 Views)