| | | Programming Discuss all your programming needs here. |  | 
04-28-2009
|  | Knight-Lieutenant | | | Join Date: Aug 2008 Location: Sweden
Posts: 358
Reputation: 68 Level up: 56%, 314 Points needed |    | | | Code Error in Start button Renamer hi i have followed a guide how to create a Windows Start Button Renamer but there is somthing wrong with my code... can some1 take a look? Code: Public Class Form1
Private Const WM_SETTEXT = &HC
Private Const WM_GETTEXT = &HD
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Sub SetStartCaption(ByVal str As String)
Dim StartBar As Long
Dim StartBarText As Long
Dim sCaption As String
StartBar = FindWindow("Shell_TrayWnd", vbNullString)
StartBarText = FindWindowEx(StartBar, 0&, "button", vbNullString)
sCaption = Left(str, 5)
SendMessageSTRING(StartBarText, WM_SETTEXT, 256, sCaption)
Exit Sub
End Sub
Private Sub Command1_Click()
SetStartCaption(TextBox1.Text)
End Sub
End Class
As u can see have i done the Left word red becous there is somethign wrong with it? ^^ i dont understand the error :P ^^ thx
__________________ Lines of Coding: |||||||||| Goal 1000
Current: 546 Achived Goals: 500 Lines  | Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx. 
04-28-2009
| | Contributor | | | Join Date: Mar 2008 Location: Behind you
Posts: 197
Reputation: 85 Level up: 20%, 564 Points needed |     | | Code: Public Class Form1
Private Const WM_SETTEXT = &HC
Private Const WM_GETTEXT = &HD
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Sub SetStartCaption(ByVal str As String)
Dim StartBar As Long
Dim StartBarText As Long
Dim sCaption As String
StartBar = FindWindow("Shell_TrayWnd", vbNullString)
StartBarText = FindWindowEx(StartBar, 0&, "button", vbNullString)
sCaption = Microsoft.VisualBasic.Left(str, 5)
SendMessageSTRING(StartBarText, WM_SETTEXT, 256, sCaption)
Exit Sub
End Sub
Private Sub Command1_Click()
SetStartCaption(TextBox1.Text)
End Sub
End Class
the simple left worked in the prev versions | 
04-29-2009
|  | Knight-Lieutenant | | | Join Date: Aug 2008 Location: Sweden
Posts: 358
Reputation: 68 Level up: 56%, 314 Points needed |    | | oh! ^^ thank u so much!! 
i have another question... how do i do so a textbox shows some information?
__________________ Lines of Coding: |||||||||| Goal 1000
Current: 546 Achived Goals: 500 Lines 
Last edited by Jonthe838; 04-29-2009 at 12:44 AM.
| 
04-30-2009
|  | Archer | | | Join Date: Dec 2006 Location: Edinburgh, Scotland
Posts: 1,567
Reputation: 448 Level up: 84%, 179 Points needed |     | | | Textbox1.Text = "Blah blah blah" | 
04-30-2009
| | Contributor | | | Join Date: Mar 2008 Location: Behind you
Posts: 197
Reputation: 85 Level up: 20%, 564 Points needed |     | | | and textbox1.readonly = true (optional) | 
05-01-2009
|  | Knight-Lieutenant | | | Join Date: Aug 2008 Location: Sweden
Posts: 358
Reputation: 68 Level up: 56%, 314 Points needed |    | | nice! thx  +rep after that i have spread :/
__________________ Lines of Coding: |||||||||| Goal 1000
Current: 546 Achived Goals: 500 Lines  | 
05-03-2009
|  | Master Sergeant | | | Join Date: Jul 2007 Location: H4x0r W0r|d
Posts: 97
Reputation: 12 Level up: 37%, 447 Points needed |     | | | I cant make it work in Visual Basic 2008 (Have changed button codes and such) so its vb 2008 codes, but nothing happens when i press. | 
05-03-2009
|  | Knight-Lieutenant | | | Join Date: Aug 2008 Location: Sweden
Posts: 358
Reputation: 68 Level up: 56%, 314 Points needed |    | | | i got the same problem... im going to try to solve it but im not sure if i will able to :/
__________________ Lines of Coding: |||||||||| Goal 1000
Current: 546 Achived Goals: 500 Lines  |  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -4. The time now is 03:28 PM. |