|
Are you sending the paste to a specific app? If so, why not use SendKeys "^V"? It will do the exact same thing...
RageInTheMachine9532
|
|
|
|
|
How can i get the currently active window in VB.Net without
declaring an external user32.dll function and use it?
There's a function i can call directly?
Thanks, Ale.
|
|
|
|
|
I don't know of a Framework call that will do that.
Anyway, what's wrong with calling into Win32?
|
|
|
|
|
What i want to do is a background process getting notified of
system messages, such as WM_APPACTIVATE and get a reference
or an handle of activated process/app.
I had some bad experience with NativeWindow class, i think i've
not completely got all the triks it offers.
Could you suggest any solution?
Thanks.
|
|
|
|
|
OK. First, there is no WM_APPACTIVATE message. The closest match to what your looking for is WM_ACTIVATE. It is sent once to two windows. First, to the window being deactivated, then to the window being activated. The WPARAM part of the message contains the details of the ACTIVATE command and the LPARAM part will contain the handle of the window being activated or deactivated and, strangely enough, CAN BE NULL! Full details on the WM_ACTIVE message are here[^].
Second, the WM_ACTIVATE message is NOT broadcast to the entire system. In order to get your hands on that message your going to have to write a CBT Hook. With this you'll get notified of all Activate, Create, Destroy, Minimize, Maximize, Move, and Size messages going to any window, along with a bunch of other things. I'm saying this because you're hook routine is going to have to pick out the messages you want, do any processing you want, and then send the message down the hook chain quickly and efficiently or else you'll degrade system performance.
The top of the Windows Hooks documentation starts here[^], and the docs for writing a CBTProc hook function are here[^]. If your not familiar with writing Windows Hook functions, it's going to be a bit confusing to read at first. You might want to start with the basics of how Windows Messaging works, and that is here[^].
RageInTheMachine9532
|
|
|
|
|
Just curious, but what is this project doing?
RageInTheMachine9532
|
|
|
|
|
Very, very helpfull.
Thank you very much.
I'm working on a webapp controlling a very old application,
i need to simulate a terminal server session via web browser.
I'm new to .net development, i come from years of java programming.
Just another little question, i start a process and i do the following :
startedProcess = Process.Start(startInfo)
startedProcess.WaitForInputIdle(5000)
Dim name = startedProcess.MainWindowTitle()
Dim mwHandle = startedProcess.MainWindowHandle()
Dim topForm = Form.FromHandle(mwHandle)
topForm is always null.
How can i get a Form object from a window handle?
thanks again.
|
|
|
|
|
hi...i need to display the test in different colors in a RTF..
can u pls help???
lets say i have this text "Beautifull World"
now i want to display this text in such a way so that
"Beau" is in red color
"tifu" is in green
"l World" is in blu color..
onto a rich edit text box...
can someone plese help me???
tks a lot...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
With RichTextBox1<br />
.SelectionStart = .TextLength<br />
.SelectionColor = Color.Red<br />
.SelectedText = "Beau"<br />
.SelectionColor = Color.Green<br />
.SelectedText = "tifu"<br />
.SelectionColor = Color.Blue<br />
.SelectedText = "l world"<br />
End With
Csharp™ the coder formally known as dynamic
Dim TwinsHaveArrived As String = "twins arrived safely , 17/08/2003 (18:05 & 18:07)"
|
|
|
|
|
You need to encode your string manually with rtf codes as far that I know
The warlord
|
|
|
|
|
hi i prepared a rtf box in my school and it was working well with colors...
now that i came howm the colors are not apprearing..the text is always black...the project is the same that was wroking with colors in school...why are there any colors??can u pls help...
RichTextBox1.SelColor = vbRed<br />
RichTextBox1.Text = "text"
do i need to add anythin to the poroject???
the RTF control is already added...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Hi all,
I am wondering if is possible to "change" a character in Windows.
In particular, we often use the € char, but we have to push 2 keys ("Alt Gr" + E), but I would like to implement an application running in background (or even a windows service) that catches the key § (for example) and transforms it in € in every window application the user is working with.
Do you think it is possible?
Thanks in advance!
Dave
|
|
|
|
|
Hi all,
I am wondering if is possible to "change" a character in Windows.
In particular, we often use the € char, but we have to push 2 keys ("Alt Gr" + E), but I would like to implement an application running in background (or even a windows service) that catch the key § (for example) and transform it in € in every window application the user is working with.
Do you think it is possible?
Thanks in advance!
Dave
|
|
|
|
|
Yes! You'd have to write a keyboard hook. See the next post titled 'IS it possible in VB'.
|
|
|
|
|
Sir i need to develop a software where i have to change the ascii character into extended ascii character and send to the active application.
say if a user type A from the keyboard it should be converted to say € irrespective of whatever the application is running may be it is visual studio or word or notepad or photshop u name it.
Is it possible to achive this in vb 6 and if yes then how?
Codes or ideas are greatly appreciated.
Thanks in advance
|
|
|
|
|
In order to get your hands on the keystroke before NAY application got it, you would have to install a low-level keyboard hook. This is done by writing a callback function (one where the system calls you), and using the Win32 API calls to SetWindowsHookEx, UnhookWindowsHookEx, and CallNextHookEx. Documentation on these calls can be found on MSDN starting here[^].
Mind you, hooking into the system isn't really VB's forte'. I've never done it in VB. It just looked MUCH easier to write in C++. I did something similar to prevent the 'Window' key from being used.
|
|
|
|
|
I wrote a windows service in VB .NET that primarily get information from a database and does the appropriate actions. It starts up automatically on boot.
The problem is that I need to make this windows service configurable e.g. The database location might be changed and I need to have a way for the service to know that.
Any suggestions??
|
|
|
|
|
I've done this using a configuration file, and if you don't like it, you can use the registry.
Free your mind...
|
|
|
|
|
You can add an entry in the web.config file in
the <appSettings> tag.
eg.
<appSettings>
<add key="keyname" value="keyvalue"></add>
</appSettings>
You can than read this entry using ConfigurationSettings.AppSettings("keyname")
|
|
|
|
|
I think you mean the app.config file. web.config is just for ASP.NET applications.
Anyway, for the original poster...
In visual studio make sure the project of your windows service has an app.config file, you use it just like the web.config file (see Pratik Desai's post above). When you deploy your application Visual Studio will change the name from app.config to myWindowsService.exe.config or whatever the exe file is called + .config.
I have a feeling that the config file is only read once (I'm not sure if you can force it to re-read it to check for changes if it is only read once) in which case your service will have to be restarted.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
So whenever I want to deploy the windows service, I have to copy the app.config file with it? If the app.config file is all I have to modify, restarting the windows service isnt really a hassle.
Thanx
|
|
|
|
|
Yes, but remember that when you build your application windows will copy the app.config into your Debug or Release folder and rename it with the name of the exe with the addition of the .config.
Also - And it took me a while to figure out why it wasn't working the way I expected - The config file is not read while the windows service is installing. So your installer class can't access it without a lot of extra work.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
Hi guys,
I need to make a DLL that can RECIEVE and SEND data to an ASP file depending on information that an ASP file sends or recieves from this DLL.
Please help...Ive never worked with DLLs before.
I would greatly appreciate a small example.
THANKS GUYS!
Jonavis
X-ZD Designs
|
|
|
|
|
-Open the VB6 IDE
-in the new project screen choose ActiveX DLL
-in the class module you can write your functions , subs just as you make in VBScript.
register the DLL and call it from the ASP.
create it using Server.createObject
|
|
|
|
|
i want to know how can i read and save record into .xsl file by ado.net like any table.i did this by vb data control to read and write data to work sheet in excel .xsl file just like .xsl file behave like database and worksheet behave like table.if possible please tell me in detail how can i do it by ado.net and if possible give me the sample code.
tbhattacharjee
|
|
|
|