Originally posted by Chris Does anyone know how to change the start button image through some API call?
The image for the Start button is in some DLL, I think user32.dll. So if you modify the icon in there and restart the pooter, the icon will change too.
I enclose is the source that I have workout and it can remove the "Start" wording from the start button. The only thing is I fail to update a new image into it.
With the same method, I manage to transfer the image into the runtime create button in the same program.
Hope you can give me some hints
filburt1, I know that can be done by modifiy the user.sys file but juz wanna to find out a way to do it without modified this file. Hope you get my point
Well subclassing is in fact changing the windows procedure of a specified windows. Like in VB you make your own procedure and tell your window to use it for certain events (messages). Well because the WndProc is in your app (your app's memory area) the window ca access it. But when you subclass another window (like the start button), that window belongs to some other process and because in Windoes apps can't access other apps' memory space the start button can not access the WndProc in your exe. That is why you have to put it in a dll beacuse every app can access the functions in the DLL.
That is a rough explanation but easy to understand.
Here is an example i made on subclassing other windows using a DLL. This sample app subclasses the Start button. When a user left clicks on the start button a message box will appear instead of the start menu. It can easily be changed to handle messages of every window in your own way.
Just open the dll workspace file with VC++ not the exe one.
I understand what subclassing is... but I didnt understand why a DLL was needed... if you wanna give a more complicated explanation I am sure I will manage to understand. : )
Can you send messages to another window without having it a DLL?
Well, of course you can send messages without a dll. Just use the send message API function.
The DLL is needed for the other app to be able to "see" the WndProc "made" by you.
For example in the default WndProc of the desktop window there is something like this.
WM_RBUTTONDOWN
{
//popup menu code
}
This is the default behaviour of the desktop window. Its WndProc is in Explorer.exe (i think). It is its exe so it can read everything in its process.
Now let's say you want to change the behaviour of the dekstop window when it recieves the WM_RBUTTONDOWN message. You make your WndProc and using SetWindowLong that you want the desktop window to see your WndProc (to react to messages in your way)
My WndProc
WM_RBUTTONDOWN
{
//pop up message box
}
In order for the desktop window to read the WndProc it must be in a DLL (where all functions can be accessed by all programs). If the WndProc is not in a dll but it is in your exe (process) then it can not be accessed by the desktop window 'cos it can not access your apps memory space.
Originally posted by Vlatko Here is an example i made on subclassing other windows using a DLL. This sample app subclasses the Start button. When a user left clicks on the start button a message box will appear instead of the start menu. It can easily be changed to handle messages of every window in your own way.
Just open the dll workspace file with VC++ not the exe one.