|
Dave, excuse me but can you explain me, what a keyboard hook is?
tnx!;)
Night Soul!!!
|
|
|
|
|
A keyboard hook is a function that you write and register with Windows using the SetWindowsHookEx API function. Basically, this function will be called every time the keyboard driver attempts to post a keyboard message to an input queue. You can see every keystroke message before it goes to an application. This function has a responsibility of passing along the data that the driver has given it to the next hook in the chain. (You can have multiple hooks attached, where each hook has to pass the data it receives to the next...)
The cool part is you can manipulate the message data before it's passed to the next hook. Or, if you need to disable certain keys, DON'T pass the data to the next hook. Just return nothing...
I've written hooks to disable the Windows Logo keys, eat certain keystrokes at certain times, and have even had a little fun, like 5 times a second, replace the WM_KEYDOWN message with a different key than was hit... Drives people nuts when they don't know you installed it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for the lesson!!!;)
well done!
Night Soul!!!
|
|
|
|
|
Hi everybody,
I've a simple question to you:
If two or more applications are running, and I want to get a refernece to a specific one, how can I do that
e.x
Two MS Word are running
and I want to GetObject (, "Word.Application"), of course that depends on who runs first.
the question is
How can I get always the application tha I want ?
Thanks in advance.
Carlos Mariano
Carlos Mariano
|
|
|
|
|
Are you saying that you want to retrieve a specific instance of Word that is already running? You can't. There is no way to get a reference to a specific instance of an object. If it's Word that your trying to get, only one copy of it is ever running at any one time. Once you get the reference to Word, you can use the Word object model to pick the document you want from its Documents collection.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It sounds logic, what about avoiding to run two or more word instances .
Is tit possible ?
Thanks!
Carlos Mariano
|
|
|
|
|
You CAN'T run more than one instance of Word. Word, itself, takes care of this. If you try to open multiple documents at the same time, Word will open just once and load all the documents seperately and manage them. This is what the MDI model (Multiple Document Interface) model is all about.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I know that, word was an example, may be a bad example, but there'a application tha you can run more than once at the same time.
You may want to have multiple mdi application or not ?
the queastion was if you have sutch application is it possible to get one expecifically
Thanks
CM
Carlos Mariano
|
|
|
|
|
In that case, no you can't get a specific instance.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I track email addresses from a send message and then store that particular address in a database table
jaya
|
|
|
|
|
Where is the address going to come from?
There only thing your going to be able to do to accomplish this is write your own mail server service that run locally on the machine. This sounds like alot of work to do something seemingly so simple, but I'll explain why it needs to be done this way.
If you write an extension to Outlook, your idea will only work for Outlook. It will NOT work for Eudora, Navigator, or any other email package. So you need something to sit between ALL the possible mail clients (except web mail like Yahoo or Google mail!). Plus, writing an extension for Outlook is not that easy and you'll have to write an assembly inside of a COM Callable Wrapper.
The best solution is to write a mail server service that runs on the local machine. Outlook, or any other mail package, will be setup to get/send it's mail from 127.0.0.1 (the local IP for the machine). You can use any ports you want to the POP3 and SMTP listeners, but usually the port numbers used are going to be in the thousands range somewhere. For example, your POP3 server will listen on port 2525 and the SMTP server will listen on 2626. Outlook will send and retrieve it's mail from this server. Your server will then take these messages and do whatever processing it needs to, like get the to/from addresses and store them in a database. It will then have to relay the messages to the REAL mail server on it's normal ports.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sub DisplayCustomer(ByVal position As Integer)
Dim node As XmlNode = xmlDoc.SelectSingleNode( _
"/Customers/Customer[" & position & "]")
txtCustomerID.Text = node.SelectSingleNode("@ID").InnerText
txtContactName.Text = node.SelectSingleNode("ContactName").InnerText
txtPhone.Text = node.SelectSingleNode("Phone").InnerText
End Sub
I'm not a VB programmer, but I was checking out this code. What does the "_" do in the 2nd line do?
Thanks.
/\ |_ E X E GG
|
|
|
|
|
That is a "contine on next line operator"
In C++ it is not needed because ; is the eol marker, but in VB, each individual line is assumed to be self-ending. Thus, a " _" operator is sometimes necessary for a long line.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
Since the line will be long if you put all in one line, instead, "_" helps you to write the code on a new line.
It is the same as:
Dim node As XmlNode = xmlDoc.SelectSingleNode("/Customers/Customer[" & position & "]")
|
|
|
|
|
i am tryin to convert a project that was made in 6.0 to .net and its a little tough. I was wondering if anyone knew of a way to mimic the function of the varptr in some way.
i have been trying to use the RTLmoveMemory dll call but in .net it is almost impossible to make it function. So i have been working to figure out how this function actually works. I would say i have it almost 75 percent pinned but when you send negative numbers to it comes back with numbers that i havent been able to put a mathmatical equation too. If there is any help with that it would be great.
Public Declare Sub CopyMem Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
but anycase i need to know how to use the varptr function because in the following snippet heres the problem and the reason i need to use it
<br />
For i = 0 To (ROUNDS + 1)<br />
dataX = 0<br />
For K = 0 To 3<br />
Call CopyMem(ByVal VarPtr(dataX) + 1, dataX, 3)<br />
dataX = (dataX Or Key(j))<br />
j = j + 1<br />
If (j >= KeyLength) Then j = 0<br />
Next<br />
m_pBox(i) = m_pBox(i) Xor dataX<br />
Next
rounds = 16
key contains a unicode work "text1"
key(0) = 116
key(1) = 101
key(2) = 120
key(3) = 116
key(4) = 49
when it first interates through the second for loop datax = 116
which is the first number in the byte array
but i have no idea where these other numbers are coming from
2 datax = 298313
3 datax = 7632253
4 datax = 1953856893
if i can figure out what varptr(datax) + 1 does and mimic its function and also figure out why when negative numbers are send to the api call it sends back really negative large numbers. Any help with any thing seen here would be awesome. thank you very much
|
|
|
|
|
VarPtr has no equivelent in VB.NET... All it does is return the address of the variable, which, in managed code, is not guarenteed to stay where it was created thereby invalidating the return of VarPtr.
What you would have to do is, in VB6, step through this code and watch what happens to dataX. the variable dataX looks like it is a Long, or Integer in VB.NET...a 32-bit signed integer. What it looks like it's doing is copying bytes 2, 3, and 4 to byte 1 of dataX. It might help to look at the value of dataX in the Watch window in Hexadecimal.
dataX before CopyMem dataX after CopyMem
byte1 | byte2 | byte3 | byte4 byte1 | byte2 | byte3 | byte4
2B 1A 00 FE 1A 00 FE FE
In this case, what you would need to do is mask out byte 1, 2, and 3 to get the value of the 4th byte. Then move the numbers in dataX to the left by 8 bits and finally add back in the lastByte:
' From the example above...
Dim dataX As Integer = &H2B1A00FE
Dim lastByte As Integer = (dataX And &H000000FF) ' lastByte will equal &HFE.
' This moves the data left 8 bits. This will drop the first byte and move
' the remaining bytes to the left, leaving 00 in the last byte.
' 2B1A00FE becomes 1A00FE00
dataX = dataX * 256
' Now add back in, the byte that we saved above.
' 1A00FE00 becomes 1A00FEFE
dataX = dataX + lastByte
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Im my VB.NET application, I'm using a custom dll that was written in VC++ 6.0.
When making calls to this dll from VB.NET 2003, I'm have allot of difficulty with the data types between VC++ and VB.NET.
The following function prototype is in the dll.
int32 dummyFunction( int* variable1, customDataStructType1* variable2, char[7], customDataStructType2, **variable3)
Any suggestions on what the call from VB.NET would look like? Or perhaps a link to a MSDN webpage?
Ideally, I would like to make a VB Structure or Class for customDataStructType1 and customDataStructType2, but not sure how to pass the data from that C Structure back to VB STruct or Class??
Thanks.
|
|
|
|
|
Is it possible to hide a specific column?
( when you have 5 columns, only display 4 of them)
Shin
|
|
|
|
|
The standard ListView doesn't support hiding columns. You have a couple of options.
You could extend the ColumnHeader class to include a Hidden proerty, then you would have to ownerdraw the ListView control draw the columns and items based on the Hidden property.
You could just make the width of the hidden column 0, but that doesn't mean that the user can't just resize the column to show the hidden column again.
You could avoid putting the hidden data into the Item.SubItem() collection. And instead, put the data into a seperate array, but keep the array index linked to the item index in the ListView:
ListView.Item() SubItem(0) SubItem(1) SubItem(2) | HiddenData()
(0)"Item1" "SI1" "SI2" "SI3" | (0)"HideMe"
(1)"Item2" "SI1" "SI2" "SI3" | (1)"HideMe"
(2)"Item3" "SI1" "SI2" "SI3" | (2)"HideMe"
(3)"Item4" "SI1" "SI2" "SI3" | (3)"HideMe"
This way, when ever the user selects an Item, say index 2, your hidden data will be in the array HiddenData(2).
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was thinking everytime I change the size of dialog, I change the column and whole list view width so that you don't see the last column of ListView.
what do you think?
|
|
|
|
|
I've got an issue with trying to select a value from a combo box, using code.
I have a form that opens up, with a bunch of controls. This form represents a record in a table. I'm currently using a dataset to go and get that data, and then populating the controls with the individual values from that dataset.
There is a combo box on the form that is populated using an object that holds the ID of the value, and the display text. These are then assigned to the combo box as ValueMember and DisplayMember respectively.
When I ask for the SelectedValue, I get the ValueMember, which is all well and good.
However, what I want to do, is when the form loads, I want to return a dataset containing the ID that relates the ValueMember of the combo box, and select the value in the combo box that relates to that value, so that I get the corresponding DisplayMember.
I've got no idea how to do this at the moment, and it's driving me potty! Anyone...anyone... Bueller!
TIA
Tom
|
|
|
|
|
If I understand the problem correctly... You're trying to select a value in a combobox using code? Correct?
Notice that SelectedValue is a get/SET property. You can set the value of the SelectedValue property to the ValueMember that you want and it should show you the corresponding DisplayMember in the ComboBox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks - just by writing a response, trying to show there was nothing wrong with my code, I've realised what I was doing wrong. The class I use to create an object to fill the combo box holds the ID as Long , and I was casting the value coming from the dataset as an Integer . Once I changed the cast to a Long , it worked like a dream.
I'm sorry for wasting your time!
Many Thanks
Tom
|
|
|
|
|
Good Day Every Body,
I wonder Whether any Body work on linking PC with a Machine,
I need to link a weight Indicator Machine with my PC ,
I need a result as Text File,
I don't have any Idea about Interfacing PC with Machines, through COM Port.
Please If any body can help with any small info
Lool
|
|
|
|
|
First question may seem stupid, but do you have to documentation on the interface on the scale? Without it, your going to have a tough time doing this.
Second, you'll need the proper cable to go between the PC and scale.
Third, you will need a Serial Comm class library to help you talk to the COM port. This is because there is no native .NET BCL support for serial/parallel communications. There are examples on MSDN here[^], and here[^]. There is also an example on CodeProject here[^].
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|