hey fellows, i'm just trying to make a little progi to change the text of the startbutton in windows Can i set the text with SetWindowText ? i got the handle of the Taskbar and of the button control In case it works with SetWindowText, would it change that little icon shown too, or just the text ? Regards Typhoon
Posted on 2001-04-02 22:53:00 by Typhoon
Typhoon, You can try it, but I doubt it will work, because it's probably an owner-drawn button, so SetWindowText will have no effect. Umbongo
Posted on 2001-04-03 07:47:00 by umbongo
Hi, you might be surprised to hear that the "Text" on the start button is a picture. You can change the picture by sending a message to the button, consult your api reference for more information.
Posted on 2001-04-03 11:28:00 by w116
Is it really a picture? I know that TweakUI can change the letters, and I kinda raise an eyebrow thinking that Microsoft included a full pictured abc :)
Posted on 2001-04-03 12:24:00 by JimmyClif
it seems to be a mixture of picture and text (don't ask me how). you can change the text there by changing the lines in "explorer.exe". if you look for "S t a r t" you'll find unfortunately more than one entry, but I already found it and changed it successfully. if you want to set a completely new picture (if you like including some text) then use PostMessage with BM_SETIMAGE
Posted on 2001-04-03 13:00:00 by [SaFc0n]
I know how to change it in the explorer.exe, so how about i change the text on the certain offset in the explorer.exe over my application, would that work ?
Posted on 2001-04-03 14:16:00 by Typhoon
hey fellows, i tried something else: i tried, just to see if the button contains an image or text, to get the Text on the button with GetWindowText i didn't give any results, so it must be an image But lets say i change that image now, how could i restore the default again ? Which would be the win logo and "Start"-text. Regards Typhoon
Posted on 2001-04-03 21:59:00 by Typhoon
Use BM_GETIMAGE before you change the bitmap. So then when you want to restore the original bitmap you can use this handle with BM_SETIMAGE.
Posted on 2001-04-03 22:24:00 by Soul~Drudge
ok, i made up a simple code to change the image on the button, after you close the appearing messagebox it sets it back to default it compiles everything just fine problems: 1)it doesn't sow the new image but removes the existing one 2)i get an error message after closing the application good thing: it sets the default image back here's my code (just very simple to try if it even works, for myself) ########################################### .data taskbar db "Shell_TrayWnd",0 Text db "Button changed",0 Caption db "Test",0 .data? hInstance HINSTANCE ? hButton dd ? htaskbar dd ? hImage dd ? hShow dd ? .code start: invoke GetModuleHandle, NULL mov hInstance, eax invoke FindWindow,addr taskbar,NULL mov htaskbar,eax invoke GetWindow,htaskbar,GW_CHILD mov hButton,eax .IF hButton != 0 invoke SendMessage,hButton,BM_GETIMAGE,0,0 mov hImage,eax invoke LoadBitmap,hInstance,1000 mov hShow,eax invoke SendMessage,hButton,BM_SETIMAGE,0,hShow invoke MessageBox,NULL,addr Text,addr Caption,MB_OK invoke SendMessage,hButton,BM_SETIMAGE,0,hImage .ENDIF end start ############################################################ resource: 1000 IMAGE DISCARDABLE "test.bmp"
Posted on 2001-04-04 23:45:00 by Typhoon
Switch 1000 IMAGE DISCARDABLE "test.bmp" with 1000 BITMAP DISCARDABLE "test.bmp" and call ExitProcess at the end of your code. This message was edited by Soul~Drudge, on 4/5/2001 12:58:29 AM
Posted on 2001-04-05 00:13:00 by Soul~Drudge
hi, i wanted to ask, what is the difference between SendMessage and PostMessage in this case and what is a owner drawn window? bye
Posted on 2001-04-05 04:23:00 by [SaFc0n]
: The difference is PostMessage sends the message and returnes right away without waiting for it to process the message, SendMessage will wait for it to process the message so you can get a returne value. A owner drawn window is where your program draws the control instead of windows. To do this you would use the SS_OWNERDRAW style and process the WM_DRAWITEM message. Typhoon: Another thing you could do instead of sending BM_GETIMAGE to get the regular bitmap is just to use the returne value from BM_SETIMAGE. Also another thing you should do is call DeleteObject on your bitmap handle after you restore the start button. This message was edited by Soul~Drudge, on 4/5/2001 5:57:08 PM
Posted on 2001-04-05 17:55:00 by Soul~Drudge