|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Having problems with SetWindowText apiI'm writing because I'm having some problems with the SetWindowText api (Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long) I know the handle, and have the string what i want to see in the title. Here is the code part: c = SetWindowText(hwnd, "string") c should be a double which is not null, it is ok because c returns a good value every time but after that the window's caption should be "string", but it's became empty, not "string". i tried another way too. It is the SendMessage function. we have the handle and the string again, and there is the code: c = SendMessage(hwnd, 12, vbNull, "string") c returns 1 so it should be ok but the caption's text not ok again. it not empty but contains only one character a Chr(8). if i replace the "string" with a vbNullString then the caption text is empty again. How can i set the right text in the caption? Thanks, Bence (iecs) >I'm writing because I'm having some problems with the SetWindowText api Make that >(Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" >(ByVal hwnd As Long, ByVal lpString As String) As Long) Declare Auto Function SetWindowText Lib "user32" (ByVal hwnd As IntPtr, ByVal lpString As String) As Boolean Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. benc***@gmail.com wrote:
> I'm writing because I'm having some problems with the SetWindowText api Your api declaration needs to be changed as Mattias already pointed> (Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" > (ByVal hwnd As Long, ByVal lpString As String) As Long) > out. For additional information see here: http://www.pinvoke.net/default.aspx/user32.SetWindowText
How to receive an array of doubles using VB from a C DLL
Question about rounding the decimal Controlling how Excel starts when using VB.Net Automation DataView Question What are the strings that define a connection's server version? Setting Null value in SQL update statement Event firing order [Newbie] How can I do that ? Get Special Folder Decision trees |
|||||||||||||||||||||||